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.
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.
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
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"
Navigate to System | Preferences | Hardware | Keyboard from the menu, which by default is on top of the screen.
Keyboard Preferences dialog appears.
Select the Layouts tab.
Click the +Add... button
Choose a layout dialog appears
In the Layouts dropdown, choose USA
In the Variants dropdown, choose Programmer Dvorak
Click the Add button
You are now returned to the Keyboard Preferences dialog
Select USA Programmer Dvorak from the list
Mark the Default radio button
Click the Layout Option... button
Keyboard Layout Options dialog appear
Expand Compose key position by clicking on the text
Select the Less-than/greater-than is Compose checkbox
Expand Numeric keyboard layout selection by clicking on the text
Select the ATM/phone keypad radio-button
Return to Keyboard Preferences
Remove other keyboard layouts by selecting their item in the list and then clicking on the -Remove button
Click the Close button
Select the system logo (for instance SuSE | Favorites | Configure Desktop | Personal Settings from the menu
Personal Settings dialog appear
Select Regional & Accessibility on the list menu at the left side
Select Keyboard Layout on the next level that appears of the list menu
Select the Layout tab
Mark the Enable keyboard layouts checkbox
Select U.S. English in the Available layouts list
Press the Add>> button
Push the arrow up button to move it to the top
Select U.S. English in the Active layouts list
Choose dvp in the Layout variant dropdown
Select other layouts and press the <<Remove button as applicable
Press the Apply button
Select the Xkb Option tab
Mark the Enable Xkb options checkbox
Under Compose Key Position heading select the Less-than/greater-than is Compose checkbox
Click the Apply button
Close the window
Choose Applications | Settings | Settings Manager from the system menu, which by default is at the top of the screen
Xfce Settings Manager window appear
Select the Keyboard caplet
Keyboard Preferences dialog appears
Select the Layouts tab
Unmark the Use X configuration checkbox
Press the +Add button
Add layout dialog appear
Click on the triangle left of USA to expand it
Choose Programmer Dvorak
Press the OK button (in the Add layout dialog)
Keyboard Preferences reappears
Select other layouts from the Keyboard layouts list and then click the Delete button as applicable
Press the Close button
Press the Close button
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.
Extract the files to a temporary directory and change to it:
wget http://www.kaufmann.no/downloads/linux/kbddvp-1_2_1-src-linux.tgz
DVP_DIR=$(mktemp -t -d kbddvp.XXXXXX)
cat kbddvp-1_2_1-src-linux.tgz | gzip -d | tar xf - -C $DVP_DIR
pushd $DVP_DIR/kbddvp-1.2
Run the maintainer scripts to register the layout on the system:
sudo ./dvp.install.sh && sudo ./dvp.postinst.sh
OR
If administrative access is not available (for instance if you have an account on a shared system) you can install the layout privately under your home directory using the maintainer script:
./home.install.sh
Note that this command should not be run with sudo
. Also, the layout will not be visible in the graphical user interface and you'll have to enable it through the configuration file instead of selecting it interactively.
[ $? -eq 0 ] && echo Yay! || echo Bummer...
Cleanup temporary files:
popd
rm -rf $DVP_DIR
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 -
Reverse the procedure above:
Unregister the layout from the system and remove the files that were installed with the command:
sudo ./dvp.prerm.sh && sudo ./dvp.remove.sh
OR
If you used the script to install to your home directory, you should also use the corresponding uninstaller:
./home.remove.sh
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)).