Installing the Programmer Dvorak Keyboard Layout on Linux

If your distribution does not use the X Keyboard Configuration Database and the Programmer Dvorak layout is not already in the list supplied keymaps, you'll need to follow the instructions in the install section first.

Setting up your account to use the Programmer Dvorak layout

If you run one of the desktop environments Gnome, KDE or Xfce, then use the GUI to change the keyboard layout. Otherwise, to install the layout on a permanent basis for the current user only put the following line in the file ~/.Xkbmap:

-layout us -variant dvp -option compose:102 -option numpad:shift3 -option kpdl:semi -option keypad:atm -option caps:shift

If you don't have the access to change the system setting, or you work on a shared computer, this may be the easiest way of configuring the keyboard.

Note that for security reasons only root can change the console keymap.

Debian/Ubuntu - System wide

Ubuntu compiles the console driver from the X.org layout files using ckbcomp. You can change the system wide setting for all users (who don't define their own settings) and the login screen. In the file /etc/default/console-setup put the lines:

XKBLAYOUT="us"
XKBVARIANT="dvp"
XKBOPTIONS="compose:102,numpad:shift3,kpdl:semi,keypad:atm,caps:shift"

The settings here will be picked up the next time you reboot. You can trigger an update without reboot manually with the command:

setupcon --save-only

You can also replace the keyboard layout used at boot-time by adding to /etc/initramfs-tools/initramfs.conf

KEYMAP=y
and then run:
update-initramfs -u

Console - Fedora/OpenSuSE/Gentoo

The ckbcomp command is only available in Debian's console-setup package. A version which is somewhat fixed to run on Fedora can be installed with the commands:

pushd /usr/local/bin
wget http://kaufmann.no/downloads/linux/ckbcomp.gz -O - |\
gunzip > ./ckbcomp
[ "$(md5sum ./ckbcomp | cut -f 1 -d" ")" = "5d53a6f9bd698781ac80b2e581854b89" ] &&\
chmod +x ./ckbcomp
popd

A keyboard layout using the default options may now be generated with the command:

sudo $SHELL -c 'ckbcomp -layout us -variant dvp \
-option compose:102 -option numpad:shift3 -option kpdl:semi -option keypad:atm -option altwin:meta_win |\
sed "s/U+00/0x/g" |\
gzip > /lib/kbd/keymaps/i386/dvorak/dvp.map.gz'

Note the post-processing of the keymap to get around a bug in Fedora's loadkeys), and that the outermost quotes make all four lines the same command. On SuSE, Gentoo and Debian, put files under /usr/share instead of /lib/kbd.

You can test the console driver temporarily with the command (note that you'll have to be root):

loadkeys dvp

If you want the right Alt key to serve as a third-level modifier, issue this command:

echo 'keycode 100 = AltGr' | loadkeys

The file /etc/sysconfig/keyboard should contain the following line:

KEYTABLE="dvp"

Gnome - Per User

  1. Navigate to System | Preferences | Hardware | Keyboard from the menu, which by default is on top of the screen.

  2. Keyboard Preferences dialog appears.

  3. Select the Layouts tab.

  4. Click the +Add... button

  5. Choose a layout dialog appears

  6. In the Layouts dropdown, choose USA

  7. In the Variants dropdown, choose Programmer Dvorak

  8. Click the Add button

  9. You are now returned to the Keyboard Preferences dialog

  10. Select USA Programmer Dvorak from the list

  11. Mark the Default radio button

  12. Click the Layout Option... button

  13. Keyboard Layout Options dialog appear

  14. Expand Compose key position by clicking on the text

  15. Select the Less-than/greater-than is Compose checkbox

  16. Expand Numeric keyboard layout selection by clicking on the text

  17. Select the ATM/phone keypad radio-button

  18. Return to Keyboard Preferences

  19. Remove other keyboard layouts by selecting their item in the list and then clicking on the -Remove button

  20. Click the Close button

KDE - Per User

  1. Select the system logo (for instance SuSE | Favorites | Configure Desktop | Personal Settings from the menu

    Personal Settings dialog appear

  2. Select Regional & Accessibility on the list menu at the left side

  3. Select Keyboard Layout on the next level that appears of the list menu

  4. Select the Layout tab

  5. Mark the Enable keyboard layouts checkbox

  6. Select U.S. English in the Available layouts list

  7. Press the Add>> button

  8. Push the arrow up button to move it to the top

  9. Select U.S. English in the Active layouts list

  10. Choose dvp in the Layout variant dropdown

  11. Select other layouts and press the <<Remove button as applicable

  12. Press the Apply button

  13. Select the Xkb Option tab

  14. Mark the Enable Xkb options checkbox

  15. Under Compose Key Position heading select the Less-than/greater-than is Compose checkbox

  16. Click the Apply button

  17. Close the window

XFCE - Per User

  1. Choose Applications | Settings | Settings Manager from the system menu, which by default is at the top of the screen

  2. Xfce Settings Manager window appear

  3. Select the Keyboard caplet

  4. Keyboard Preferences dialog appears

  5. Select the Layouts tab

  6. Unmark the Use X configuration checkbox

  7. Press the +Add button

  8. Add layout dialog appear

  9. Click on the triangle left of USA to expand it

  10. Choose Programmer Dvorak

  11. Press the OK button (in the Add layout dialog)

  12. Keyboard Preferences reappears

  13. Select other layouts from the Keyboard layouts list and then click the Delete button as applicable

  14. Press the Close button

  15. Press the Close button

Adding Programmer Dvorak to your system

Perform these steps only if the layout does not already exist on your system. The scripts assumes that the XKB base directory is at the path /usr/share/X11/xkb. If this is not the case, then the alternate path may be passed as a command line argument to the installer. The installation procedure has been tested on Ubuntu 8.04, Fedora 9 and OpenSuSE 11. Note that you should download the source package for an X.org installation.

Troubleshooting

Test the setup non-persistently in the current session with the following command line:

setxkbmap -layout us -variant dvp -option compose:102 -option keypad:atm -option numpad:shift3 -option kpdl:semi

If you get the (dreaded) error message "Error loading new keyboard description" you can troubleshoot it by adding the -print option to the setxkbmap command and then send the output to the keyboard layout compiler:

setxkbmap ... -print | xkbcomp -

Removing Programmer Dvorak from your system

Reverse the procedure above:

Enabling custom compose sequences

You can put custom compose sequences in the ~/.XCompose file if you enable the XIM input method:

sudo im-switch -z all_ALL -s default-xim

(The location of the system compose table can be found through /usr/share/X11/locale/compose.dir; the second column of this file is the locale identifier ($LANG) and the first is the compose file (relative to the /usr/share/X11/locale directory)).