BrinkerVII

undecorate

May 16th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. #! /usr/bin/python2
  2. from gtk.gdk import *
  3.  
  4. w=window_foreign_new((get_default_root_window().property_get("_NET_ACTIVE_WINDOW")[2][0]))
  5. state = w.property_get("_NET_WM_STATE")[2]
  6. maximized='_NET_WM_STATE_MAXIMIZED_HORZ' in state and '_NET_WM_STATE_MAXIMIZED_VERT' in state
  7. if maximized: w.unmaximize()
  8. if w.get_decorations() == 0 :
  9.     w.set_decorations(DECOR_ALL)
  10. else:
  11.     w.set_decorations(0)
  12.  
  13. if maximized: w.maximize()
  14. window_process_all_updates()
Add Comment
Please, Sign In to add comment