Skip to content

Instantly share code, notes, and snippets.

@hh
Created June 9, 2011 02:12
Show Gist options
  • Save hh/1015902 to your computer and use it in GitHub Desktop.
Save hh/1015902 to your computer and use it in GitHub Desktop.
Gnome Dvorak and Us keyboard layout switcher
require 'gconf2'
@gconf = GConf::Client.default
#these settings drive me nuts, if you want to 'switch' between them using something like shift and capskey
@gconf["/desktop/gnome/peripherals/keyboard/kbd/options"]=["grp\tgrp:shift_caps_toggle",]
# using this next line in dvorak layout, control-e sends control-d
@gconf["/desktop/gnome/peripherals/keyboard/kbd/layouts"]=["us","us\tdvorak",]
# using this next line in us layout, control-d sends control-e
@gconf["/desktop/gnome/peripherals/keyboard/kbd/layouts"]=["us\tdvorak","us"]
# which basically means any composed keys you want to use while runing a secondary layout, use the primary layout
# I think this is to help memory keybindings stay the same for someone who types in mulitple languages
# it's not designed for people who actually use multiple physically different keyboard layouts.
# The option that suits me best is to only have one layout active at all, and just switch
# 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
@gconf["/desktop/gnome/peripherals/keyboard/kbd/layouts"]=["us",] # us
@gconf["/desktop/gnome/peripherals/keyboard/kbd/layouts"]=["us\tdvorak",] # dvorak
# Excericise left to the user... make a keybinding to switch layouts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment