Swedish dvorak setup under Linux

Here are some additional tips on how to set up Thomas Lundqvist’s Swedish dvorak layout under Debian 9 Stretch.

As Thomas states on his drivers page download the layout file se_sv_dvorak.xorg to /usr/share/X11/xkb/symbols/se_sv_dvorak. Then load it with the command setxkbmap se_sv_dvorak.

Setting/switching layout in X

If you need to use different layouts and switch between them, use the following command:

setxkbmap -layout se_sv_dvorak,se -option grp:alt_shift_toggle

It will let you switch between Swedish dvorak and Swedish qwerty by pressing ALT and SHIFT simultaneously.

Here’s a variant of the above command with some more options. ctrl:nocaps assigns CTRL to the CAPSLOCK key. While -variant ,,dvorak adds traditional Swedish dvorak (a.k.a. svorak) to the list of layouts you can switch between.

setxkbmap -layout se_sv_dvorak,se,se -variant ,,dvorak \
-option ctrl:nocaps -option grp:alt_shift_toggle

Desktop environment integration

If you open your desktop environment’s keyboard settings dialog, for example LXQt’s “Keyboard and mouse” settings, you’ll notice that the our layout does not have a name, there is a blank entry in the keyboard layout list:

Screenshot

It’s also impossible to select our layout when adding a new layout.

To remedy this, add the following to the file /usr/share/X11/xkb/rules/base.lst in the section ! layout:

  se_sv_dvorak    Swedish/US mixed Dvorak

Note that this file might be overritten when upgrading your system, so be prepared to edit the file again.

System wide keyboard layout

To set up this layout for the entire system, not only X, but also in the console, edit the XKB options in the file /etc/default/keyboard to look like:

XKBMODEL="pc105"
XKBLAYOUT="se_sv_dvorak"
XKBVARIANT=""
XKBOPTIONS=""

You can also add additional layouts that you can switch between, as described in the setxkbmap section above. The syntax is also similar.

This is the setup I use on my laptop which has a built-in qwerty-keyboard which I seldom use except when typing in the boot password, and an external dvorak keyboard:

XKBMODEL="pc105"
XKBLAYOUT="se,se_sv_dvorak"
XKBVARIANT=""
XKBOPTIONS="ctrl:nocaps,grp_led:scroll,grp:alt_shift_toggle"

ALT and SHIFT switches between layouts. grp_led:scroll makes the scroll-lock LED indicate which layout is used.

You might have to reboot afther changing this file to enable the layout.