Keypresses in X have 8 modifier bits:
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. ...
Take a look at localectl, especially following options:
localectl list-x11-keymap-layouts - gives you layouts (~100 on modern systems)
localectl list-x11-keymap-variants de gives you variants for this layout (or all variants if no layout specified, ~300 on modern systems)
localectl list-x11-keymap-options | grep grp: - gives you all layout switching options
You need to add 0 or 2 into /sys/module/hid_apple/parameters/fnmode.
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'
1 = ...
Okay, got it: this line in my /etc/default/keyboard
.. 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-...
xmodmap is obsolete; so indeed it should be done with the xkb tools.
The swap you want seems not to be included by default with X11 files; so you have to write it yourself.
The page https://web.archive.org/web/20170825051821/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 ...
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:
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:
Note: This is temporary. If you want the effects permanently add it to your startup file.
An easy way would be to add the command to your $HOME/.profile file (you can create it if it doesn't exist):
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.
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 ...
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, ...
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 ...
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 ...
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-...
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
<PGUP> = 110;
<PGDN> = 112;
<DELE> = 115;
<INS> = 117;
<HOME> = 118;
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.
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
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.
Yes, there is a way, and this is indeed how Debian's console-setup package does it.
Keyboard layouts are specified in XKB terms (model, layout, variant, and options) by the administrator in a file named keyboard, usually /etc/default/keyboard. This is the single source. It can be edited with a text editor.
The setxkbmap program is given these same XKB ...
You can't do it with just a setkxbmap option, as no default option does what you want.
But you can do it by defining key behaviour at a lower level.
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 base keyboard ...
You could use xkb-switch (-n switches to next layout):
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'
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:
put there the rules you need
do not forget to start the file with include "%L"
mine looks like this:
<Multi_key> <l> <l> : "ℓ" ...
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 ...
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 ...
Since gnome-shell exposes a JS eval interface on DBus which has access to all variables, the feat is possible with the following command:
gdbus call --session --dest org.gnome.Shell \
--object-path /org/gnome/Shell \
--method org.gnome.Shell.Eval \
Which will activate ...
You could retrieve the list in that file /usr/share/X11/xkb/rules/evdev.lst
Example to retrieve variants with sed to find only Danish variant
sed '/! variant/,/^$/!d;/Danish/!d' < /usr/share/X11/xkb/rules/evdev.lst
nodeadkeys dk: Danish (eliminate dead keys)
winkeys dk: Danish (Winkeys)
mac dk: Danish (Macintosh)
Don't use showkey or xev -- use udev and evtest instead.
Look at the output of evtest
No device specified, trying to scan all of /dev/input/event*
/dev/input/event0: Logitech Logitech USB Keyboard
/dev/input/event1: Logitech Logitech USB Keyboard
/dev/input/event2: Power Button
/dev/input/event3: Power Button
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