36

Keypresses in X have 8 modifier bits: Shift Lock Control Mod1 Mod2 Mod3 Mod4 Mod5 Any key can be bound to any of these modifiers, but (as you might imagine) typically the left/right Shift keys are bound to Shift, Caps Lock is bound to Lock, and left/right Ctrl are bound to Control. Conspicuously missing from the list is Alt, which is usually bound to Mod1. ...


33

Take a look at localectl, especially following options: localectl list-x11-keymap-layouts - gives you layouts localectl list-x11-keymap-variants de gives you variants for this layout (or all variants if no layout specified) localectl list-x11-keymap-options | grep grp: - gives you all layout switching options


32

Okay, got it: this line in my /etc/default/keyboard XKBOPTIONS="grp:alt_shift_toggle,grp_led:scroll" .. should not contain grp:alt_shift_toggle, which is the relevant xkb option according to this post. In addition, Gnome overrides xkb options according to this other post. As a consequence, this output: $ dconf read /org/gnome/desktop/input-sources/xkb-...


28

xmodmap is obsolete; so indeed it should be done with the xkb tools. The swap you want seems not to be included by default wth X11 files; so you have to write it yourself. The page http://madduck.net/docs/extending-xkb/ helped me to understand and find a way to do it. Create a file ~/.xkb/keymap/mykbd where you put the output of setxkbmap, it will be your ...


25

If you're wanting to do this on an Apple keyboard, try this out: echo 1|sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd To get this to work for a lower version of Linux you can try this out: http://blog.chaselambda.com/2014/10/09/apple-keyboard-on-linux-3.8.html


21

Yes, Wayland uses XKB for keyboard layouts. But it's not quite the right question, because things work different than in X. Remember that Wayland is only a protocol (plus a wrapper library). At the protocol level, wayland has a wl_keyboard.keymap event. This event contains a file descriptor to the keymap and a format classifier. Right now, only one format ...


20

One way to achieve that is via xmodmap. You can run xev to get key events. On running xev a box should appear and you can focus it and press the keys you want to swap. It should output details similar to for the Alt key: KeyPress event, serial 28, synthetic NO, window 0x8800001, root 0x25, subw 0x0, time 2213877115, (126,91), root:(1639,475), state 0x0, ...


20

I often switch between English and Greek layouts and this has been a minor annoyance for a while. Your question pushed me to solve it, so thanks! I found a program that can do this: xbindkeys. The proceedure I followed (adapted from here) was: Install xbindkeys. On my Debian this is done with sudo apt-get install xbindkeys You should also be able to ...


20

You need to add 0 or 2 into /sys/module/hid_apple/parameters/fnmode. i.e.: echo 2 > /sys/module/hid_apple/parameters/fnmode There seems to be some confusion regarding what the difference between the two values might be. Quoting the Ubuntu documentation: 0 = disabled : Disable the 'fn' key. Pressing 'fn'+'F8' will behave like you only press 'F8' ...


18

An easy way would be to add the command to your $HOME/.profile file (you can create it if it doesn't exist): setxkbmap se That should make it run every time you log in. Note that you should use $HOME/.profile rather than $HOME/.bash_profile, $HOME/.bashrc or some other similar file. This is because this setting should be read by your login manager.


17

You could set the corresponding xkb option via dconf-editor. Navigate to org > gnome > desktop > input-sources and add grp:caps_toggle to your xkb-options: Note each option is enclosed in single quotes, options are separated by comma+space. On older gnome3 releases you could do that also via System Settings > Keyboard (or gnome-control-center keyboard in ...


16

Use the following command: setxkbmap -option caps:shiftlock


16

If you're looking for a way to visually edit configuration as in other answer, there's dconf-editor supplied with dconf-tools: sudo aptitude install dconf-tools If you fancy batch editing needed value, here's how you can read it: dconf read /org/gnome/desktop/input-sources/xkb-options And here's how to update it: dconf write /org/gnome/desktop/input-...


14

If you only want to swap left alt and super key execute the command in your terminal: setxkbmap -option altwin:swap_alt_win To restore the default behavior just use: setxkbmap -option Note: This is temporary. If you want the effects permanently add it to your startup file.


13

Try looking in /usr/share/X11/xkb/symbols as described on the setxkbmap man page. The options can be found in various files, try doing a grep -rinH alts_toggle /usr/share/X11/xkb. /usr/share/X11/xkb/rules/xorg.xml looks like a good choice.


13

At least for Arch, you have two types of configuration: via console and Xorg. The easiest way without configuring Xorg: $ sudo setxkbmap -layout us You can see the current configuration with this: $ setxkbmap -print -verbose 10 $ localectl status To list all the available key maps or layouts: $ localectl list-keymaps


13

You could use xkb-switch (-n switches to next layout): xkb-switch -n or xkblayout-state (with set +1 to wrap around, in your case) : xkblayout-state set +1 or xte from xautomation to simulate Control_L+Shift_L key press/release: xte 'keydown Control_L' 'keydown Shift_L' 'keyup Shift_L' 'keyup Control_L'


13

Create a file containing your keycode changes, and save it as (for example) ~/.xkb/keycodes/local. (The keycodes directory is hard-coded; the base directory can be something else, and the filename too.) This will contain in your case xkb_keycodes { <PGUP> = 110; <PGDN> = 112; <DELE> = 115; <INS> = 117; <HOME> = 118; ...


12

You're almost there: the file is indeed ~/.XCompose. You can specify an alternate location with the XCOMPOSEFILE environment variable. See the Compose manual page. The missing piece of the puzzle is that the file is read by each application when it starts. The Compose key is not handled by the X11 server, but by the X11 library. In theory, an application ...


12

Grub uses Emacs-like key bindings: Ctrl+B = Left, Ctrl+F = Right (mnemonic: backward/forward) Ctrl+P = Up, Ctrl+N = Down (mnemonic: up/down) Ctrl+A = Home, Ctrl+E = End (mnemonic: A=beginning/end) See the manual for other key bindings. You can also define your own key layout and load it with the keymap command. This is not documented in the manual; the ...


12

Most laptops require pressing Fn to get the SysRq key. Pressing Fn usually doesn't affect the Alt key (at least the left one) but may affect the letter that you press after SysRq. Fortunately, you don't need to press SysRq and the third key together, it's enough to hold Alt down. The following sequence works on all the laptops I've seen: Press and hold Alt. ...


12

as others remark, there are no standard compose rules in X for π, so if you want to use compose to make the π symbol (as I just did), you could: install uim create ~/.XCompose put there the rules you need do not forget to start the file with include "%L" mine looks like this: include "%L" <Multi_key> <l> <l> : "ℓ" ...


11

Try: # loadkeys US From a terminal, it does not make sense to run this over ssh as the keyboard you use over ssh is the local one and the ssh client sends the keys after they have already been interpreted according to your local keymap. And it won't even work if you try. You can find all the available console keymaps in /usr/share/kbd/keymaps.


11

The following commands should work: xmodmap -e 'keycode 0x42 = Caps_Lock' or setxkbmap -option The commands above work just fine to restore the default behaviour, which I hardly ever need, luckily. I normally remap the capslock to Control (luckily VI/VIM supports CTRL-C instead of ESC) with the following command: setxkbmap -option ctrl:nocaps -layout ...


11

This seems to accomplish what you're looking for. partial modifier_keys xkb_symbols "compose" { key <CAPS> { type[Group1] = "TWO_LEVEL", symbols[Group1] = [ Multi_key, Caps_Lock ], actions[Group1] = [ NoAction(), LockMods(modifiers=Lock) ] }; }; The following resources are invaluable when dealing with XKB (I've linked ...


10

On newer Debian and Ubuntu systems, your keyboard settings are put in /etc/default/keyboard and shared between X and the console. Just run sudo dpkg-reconfigure keyboard-configuration and select Compose key: Right Alt (AltGr) on the appropriate screen. You could also put XKBOPTIONS=compose:ralt in /etc/default/keyboard and run sudo dpkg-reconfigure ...


10

First, find the keysym which corresponds to Insert $ xmodmap -pke | grep -i insert This is probably key 118. To disable it globally run $ xmodmap -e "keycode 118 =" which causes that key to map to nothing at all. Running this command every time your Xserver starts is very dependent upon which distribution and session manager you are using.


10

To get system where your locale is en_US.UTF-8 (assuming you want utf-8, which is recommended) and keyboard layout in both X.Org and virtual consoles is de-latin1-nodeadkeys, do these steps: uncomment line "en_US.UTF-8" from /etc/locale.gen (e.g. sed -i 's/#en_US.UTF-8/en-US.UTF-8/' /etc/locale.gen) locale-gen echo LANG=en_US.UTF-8 > /etc/locale.conf ...


10

There are a methods to do this. After installing the keyboard configuration package: $ sudo yum install system-config-keyboard ... Installed: system-config-keyboard.x86_64 0:1.3.1-14.fc19 Dependency Installed: system-config-keyboard-base.x86_64 0:1.3.1-14.fc19 2 packages will get installed. Method #1 From here you can then invoke system-config-...


10

X11 (classic) Run the program xev from a terminal to see the keycode sent by the CapsLock key. That's the number just after keycode on the third line from the KeyPress event line corresponding to pressing the key. On a PC, the keycode is 66. Create a file called .Xmodmap in your home directory and add the line keycode 66 = Mode_switch clear Lock ...


Only top voted, non community-wiki answers of a minimum length are eligible