I run X windows without a display manager under NixOS-20.03, using startx. I want to enable the ability to Ctrl-Alt-Backpsace to kill the X server as I am having trouble with system hangs (I suspect google-chrome is the culprit), which otherwise result in me having to hit the power switch (luckily ZFS has so far survived this bad treatment).
The relevant part of my configuration.nix looks like:
services.xserver = {
enable = true;
layout = "gb";
wacom.enable = true;
displayManager.startx.enable = true;
windowManager.wmii.enable = true;
displayManager.defaultSession = "none+wmii";
xkbOptions = "terminate:ctrl_alt_bksp";
};
Running setxkbmap -print -verbose 10
I get…
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /nix/store/ja2jzn4gz5wvg50wm3g5cxywpril72cz-setxkbmap-1.3.2/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules: evdev
model: pc104
layout: gb
options: terminate:ctrl_alt_bksp
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+gb+inet(evdev)+terminate(ctrl_alt_bksp)
geometry: pc(pc104)
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+gb+inet(evdev)+terminate(ctrl_alt_bksp)" };
xkb_geometry { include "pc(pc104)" };
};
confirming that the settings are taking effect.
Using xev -event keyboard
I can confirm that my Ctrl key comes up as Control_L
, my Alt key comes up as Alt_L
and my Backspace key comes up as BackSpace
.
I can also confirm that /nix/store/bkbmqadynbfh10q1drl9fcndxfhqzg89-xkeyboard-config-2.27/share/X11/xkb/symbols/terminate
contains
default partial modifier_keys
xkb_symbols "ctrl_alt_bksp" {
key <BKSP> {
type="CTRL+ALT",
symbols[Group1] = [ NoSymbol, NoSymbol, NoSymbol, NoSymbol, Terminate_Server ]
};
};
so that Ctrl+Alt+Backspace should result in Terminate_Server
being executed.
But despite all this Ctrl-Alt-Backspace has no effect on my system, and is in fact passed through to underlying applications (e.g. in xterm it results in printing ÿ
).
What am I missing?? I am almost at the point of giving up and trying to set up actkbd
to allow Ctrl-Alt-Del to trigger a system reboot even from within a graphical session as an alternative escape hatch when things hang (although perhaps that too won’t work…).
All help greatly appreciated!