#! /usr/bin/env python import os #Shortcut keys script for both metacity and compiz, by Henry Kroll #This lets you define your hotkeys in one place and even port them to another machine. #License: GPLv2+ #To use the Windows key, , run gnome-keyboard-properties and click on #Layout Options->Alt/Win key behavior->Super is mapped to the Win-keys cuts1=[ 'panel_run_dialog "R"', 'panel_main_menu "space"', 'run_command_terminal "R"', 'show_desktop "D"'] cuts2={ '"S"': '"scite"', '"semicolon"': '"gconf-editor"', '"slash"': '"$HOME/bin/searchsel.sh"', '"C"': '"gnome-calculator"', '"E"': '"nautilus"', '"G"': '"gimp"', '"T"': '"gnome-terminal"', '"S"': '"$HOME/bin/spamclick.sh"', '"S"': '"xterm -e $HOME/bin/xselsort.sh"', '"D"': '"xterm -e $HOME/bin/xseldate.sh"', '"L"': '"xterm -e $HOME/bin/xsellink.sh"' } os.system("gconftool-2 -t string -s /apps/gnome_settings_daemon/keybindings/home \"E\"") 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): 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]) #metacity starts numbering at 1 while compiz starts at 0 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]) """ gconftool-2 -t string -s /apps/metacity/global_keybindings/run_command_1 "S" gconftool-2 -t string -s /apps/metacity/keybinding_commands/command_1 "scite" """