Home Installation Computer Repair
#! /usr/bin/env python
import os

# Gnome / Compiz custom shortcut keys script by Henry Kroll www.thenerdshow.com
# License GPL2

# To use the Windows key, <Mod4>, run gnome-keyboard-properties and click on
# Layout Options->Alt/Win key behavior->Super is mapped to the Win-keys
# Please customize these key mappings as desired

cuts1=[
'panel_run_dialog "<Mod4>R"',
'panel_main_menu "<Mod4>space"',
'run_command_terminal "<Mod4>R"',
'show_desktop "<Mod4>D"']

# This dict can be expanded to 32 hotkeys (more?)
cuts2={
'<Mod4>S': 'scite',
'<Mod4>semicolon': 'gconf-editor',
'<Mod4>slash': 'searchsel.sh',
'<Mod4>C': 'gnome-calculator',
'<Mod4>E': 'nautilus',
'<Mod4>G': 'gimp',
'<Mod4>T': 'gnome-terminal',
'<Mod4>X': 'xmms',
'<ctl><alt><shift>d': 'date1.sh'
}
os.system("gconftool-2 -t string -s /apps/gnome_settings_daemon/keybindings/home \"<Alt><Ctl>E\"")

#This section need not be changed unless bugs, adding new window managers, etc.
for i,v in enumerate(cuts1):
os.system("gconftool-2 -t string -s /apps/metacity/global_keybindings/run_command_"+v)
for i,v in enumerate(cuts2):
#assign hotkeys to gnome metacity
os.system("gconftool-2 -t string -s /apps/metacity/global_keybindings/run_command_"+str(i+1)+' "'+v+'"')
os.system("gconftool-2 -t string -s /apps/metacity/keybinding_commands/command_"+str(i+1)+' "'+cuts2[v]+'"')
#assign the same hotkeys for compiz
#note metacity starts numbering at str(i+1) while compiz starts at str(i)
os.system("gconftool-2 -t string -s /apps/compiz/general/allscreens/options/run_command"+str(i)+'_key "'+v+'"')
os.system("gconftool-2 -t string -s /apps/compiz/general/allscreens/options/command"+str(i)+' "'+cuts2[v]+'"')