Created
February 9, 2017 23:07
-
-
Save avallete/e84dc3543ff58e29beace47b29fcf75a to your computer and use it in GitHub Desktop.
A little script to toggle all window titlebar on ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import argparse | |
from gi import require_version | |
require_version('Gdk', '3.0') | |
from gi.repository import Gdk | |
def check_args(): | |
parser = argparse.ArgumentParser(description="Script to toggle the titlebar into Unity windows.") | |
parser.add_argument('-D', '--decorate', help='Decorate window.', | |
action='store_true', dest='decorate') | |
parser.add_argument('-F', '--focus', help='apply the decoration modification only on focused window.', action='store_true') | |
return parser.parse_args() | |
if __name__ == "__main__": | |
screen = Gdk.Screen.get_default() | |
args = check_args() | |
decorator = False | |
if args.decorate: | |
decorator = Gdk.WMDecoration.ALL | |
if args.focus: | |
windows = [screen.get_active_window()] | |
else: | |
windows = screen.get_window_stack() | |
for win in windows: | |
win.set_decorations(decorator) | |
Gdk.Window.process_all_updates() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment