Re: [wlug] How to Kill the Caps Lock on your Linux Desktop

A while ago I switched to the Colemak keyboard layout which replaces the Caps Lock key with an additional backspace. Most of the time not having Caps Lock was fine but occasionally I find myself having to write whole words in capitals (esp. when programming) which was a pain. If you're using the Gnome desktop environment (or if you load gnome-settings in the background for those using a tiling window manager) you can set the Caps Lock to be toggled by pressing both Shift keys simultaneously. For me this was a huge productivity booster. To do this via Gnome: open the system settings -> Keyboard -> Layout Settings -> Options -> Miscellaneous compatibility options and tick "Both Shift-Keys together toggle Caps Lock" If anyone knows how to achieve this via command line, without gnome-settings, please share.

On Wed, Jan 29, 2014 at 01:23:41PM +1300, Mark H. Jones wrote:
To do this via Gnome: open the system settings -> Keyboard -> Layout Settings -> Options -> Miscellaneous compatibility options and tick "Both Shift-Keys together toggle Caps Lock"
If anyone knows how to achieve this via command line, without gnome-settings, please share.
I don't know about this particular Gnome feature, however the readership might be interested to know that on a Debian system (and presumably its derivatives) the re-mapping of the meta-keys can be placed in the file /etc/default/keyboard and you get the re-mappings not only in the X desktop but also on the virtual consoles. I had in mine the following: XKBOPTIONS="ctrl:swapcaps" to get the control key returned to its original place (i.e. before IBM confused us old-fellows by shifting it to a new place on the AT keyboard). But after the posting by Lawrence I am now going to try: XKBOPTIONS="ctrl:swapcaps caps:shift_nocancel compose:rctrl" so that the control key appears in its correct position left of the A key, The left control is now a caps-lock that actually works as a caps-lock and not as a "shift-invert" that most OSes seem to implement nowadays, and right-ctrl should give me the compose key. Cheers Michael

"A while ago I switched to the Colemak keyboard layout which replaces the Caps Lock key with an additional backspace." Thanks for the mentions of the Colemak keyboard. I'd heard of Dvorak but the Colemak and transitional layouts seem quite intriguing. Cheers, Chris

On Wed, Jan 29, 2014 at 01:23:41PM +1300, Mark H. Jones wrote:
To do this via Gnome: open the system settings -> Keyboard -> Layout Settings -> Options -> Miscellaneous compatibility options and tick "Both Shift-Keys together toggle Caps Lock"
If anyone knows how to achieve this via command line, without gnome-settings, please share.
Actually, it is documented in xkeyboard-config(7). The following should work: setxkbmap -options shift:both_capslock The Colemak layout can be obtained with: setxkbmap -layout 'us(colemak)' I would put the above into /etc/default/keyboard (if on a Debian like system) as XKBLAYOUT="us" XKBVARIANT="colemak" XKBOPTIONS="shift:both_capslock" (untested but that is what I gather from the man file). Cheers Michael.
participants (3)
-
chris
-
Mark H. Jones
-
Michael Cree