Created
February 4, 2012 11:46
-
-
Save AeroNotix/1737379 to your computer and use it in GitHub Desktop.
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
@hook.subscribe.client_new | |
def dialogs(window): | |
program_dict = {'firefox-aurora': 'Home', | |
'emacs': 'emacs', | |
'thunderbird': 'mail', | |
'urxvt': 'terminal', | |
'skype': 'skype'} | |
with open('/home/xeno/file', 'wb') as fname: | |
fname.write(window.window.get_wm_class()[0]) | |
def closure(*args): | |
windowtype = window.window.get_wm_class() | |
with open('/home/xeno/file', 'wb') as fname: | |
fname.write(windowtype[0]) | |
if windowtype: | |
try: | |
window.togroup(program_dict.pop(windowtype[0])) | |
except KeyError: | |
pass | |
return closure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment