Skip to content

Instantly share code, notes, and snippets.

@AeroNotix
Created February 1, 2012 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AeroNotix/1719751 to your computer and use it in GitHub Desktop.
Save AeroNotix/1719751 to your computer and use it in GitHub Desktop.
program_dict = {'firefox-aurora': False,
'emacs': False,
'thunderbird': False,
'urxvt': False,
'skype': False}
@hook.subscribe.client_new
def dialogs(window):
windowtype = window.window.get_wm_class()
try:
if program_dict[windowtype]:
pass
except KeyError:
return
if windowtype:
if windowtype[0] == 'firefox-aurora':
window.togroup('Home')
if windowtype[0] == 'emacs':
window.togroup('emacs')
if windowtype[0] == 'thunderbird':
window.togroup('mail')
if windowtype[0] == 'urxvt':
window.togroup('terminal')
if windowtype[0] == 'skype':
window.togroup('skype')
program_dict[windowtype] = True
for key in program_dict:
lazy.spawn(key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment