Skip to content

Instantly share code, notes, and snippets.

@hh
Created June 9, 2011 02:10
Show Gist options
  • Save hh/1015898 to your computer and use it in GitHub Desktop.
Save hh/1015898 to your computer and use it in GitHub Desktop.
My Desktop GConf settings
# "apt-get install libgconf2-ruby" on debian/ubuntu
require 'gconf2'
@gconf = GConf::Client.default
def ensure_plugin (my_plugin)
plugins = @gconf.get "/apps/compiz-1/general/screen0/options/active_plugins"
if not plugins.include? my_plugin
plugins << my_plugin
@gconf["/apps/compiz-1/general/screen0/options/active_plugins"]=plugins
end
end
def add_command_binding(binding, command)
@command_num ||= 1 # start out and command_1
@gconf["/apps/metacity/global_keybindings/run_command_#{@command_num}"]=binding
@gconf["/apps/metacity/keybinding_commands/command_#{@command_num}"]=command
@command_num += 1 # increment for each command
end
ensure_plugin 'dbus' # http://wiki.compiz.org/Plugins/Dbus
ensure_plugin 'commands'
add_command_binding 'XF86LaunchA', 'auto-disper -c' # Dashboard key (on Mac) https://github.com/wertarbyte/autorandr
ensure_plugin 'grid'
@gconf["/apps/compiz-1/plugins/grid/screen0/options/put_left_key"] = '<Shift><Alt>Left' # take up left half
@gconf["/apps/compiz-1/plugins/grid/screen0/options/put_right_key"] = '<Shift><Alt>Right' # take up right half
ensure_plugin 'put'
@gconf["/apps/compiz-1/plugins/put/screen0/options/put_next_output_key"] = '<Control>Prior' # to next Monitor
#nicer if this would make fullscreen, left half, or right half depending prior state
# I go betwen the physical laptop keyboard and a usb Kinesis which has hardware dvorak support
# I need 'us' layout when using the Kinesis and 'dvorak' when using the physical laptop keyboard
# See https://gist.github.com/1015902 for why I use one layout at a time instead of two
@gconf["/desktop/gnome/peripherals/keyboard/kbd/layouts"]=["us",] # us
@gconf["/desktop/gnome/peripherals/keyboard/kbd/layouts"]=["us\tdvorak",] # dvorak
@gconf["/desktop/gnome/peripherals/keyboard/kbd/options"]=["ctrl\tctrl:nocaps",] # nocaps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment