9

I want Ctrl+Alt+Bksp to restart X, so I created an xorg.conf rule:

/usr/share/X11/xorg.conf.d/53-zap.conf:

Section "ServerFlags"
    Option "DontZap" "false"
EndSection

Section "InputClass"
    Identifier      "Keyboard Defaults"
    MatchIsKeyboard "yes"
    Option          "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

And checking /var/log/Xorg.0.log:

[  1023.598] (II) XINPUT: Adding extended input device "Asus WMI hotkeys" (type: KEYBOARD, id 11)
[  1023.598] (**) Option "xkb_rules" "evdev"
[  1023.598] (**) Option "xkb_model" "pc105"
[  1023.598] (**) Option "xkb_layout" "us"
[  1023.598] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"
[  1023.598] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event3)
[  1023.598] (**) AT Translated Set 2 keyboard: Applying InputClass "evdev keyboard catchall"
[  1023.598] (**) AT Translated Set 2 keyboard: Applying InputClass "Keyboard Defaults"
[  1023.598] (II) Using input driver 'evdev' for 'AT Translated Set 2 keyboard'
[  1023.598] (**) AT Translated Set 2 keyboard: always reports core events
[  1023.598] (**) evdev: AT Translated Set 2 keyboard: Device: "/dev/input/event3"
[  1023.598] (--) evdev: AT Translated Set 2 keyboard: Vendor 0x1 Product 0x1
[  1023.598] (--) evdev: AT Translated Set 2 keyboard: Found keys
[  1023.598] (II) evdev: AT Translated Set 2 keyboard: Configuring as keyboard
[  1023.598] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio0/input/input3/event3"
[  1023.598] (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD, id
 12)
[  1023.598] (**) Option "xkb_rules" "evdev"
[  1023.598] (**) Option "xkb_model" "pc105"
[  1023.598] (**) Option "xkb_layout" "us"
[  1023.598] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"

The last line shows that it sees the directive.

And yet, when I open a terminal and type setxkbmap -print -verbose 10

Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+inet(evdev)
geometry:   pc(pc105)
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us+inet(evdev)" };
    xkb_geometry  { include "pc(pc105)" };
};

I can force the option, setxkbmap -option terminate:ctrl_alt_bksp, giving me:

...
model:      pc105
layout:     us
options:    terminate:ctrl_alt_bksp
Trying to build keymap using the following components:
...

And I test it and it restarts X correctly.

I don't understand. I had this working last week, but now it doesn't load the XkbOption from the xorg.conf file. Is there another layer that sets XKB settings that I don't know about?

I'm using Ubuntu 13.10, but with xmonad. I load some gnome utilities (gnome-panel, gnome-screensaver, gnome-keyring-demon), but not gnome-settings-daemon.

don_crissti
  • 82,805
reasgt
  • 793

2 Answers2

0

Launch dconf-editor and go to org.gnome.desktop.input-sources.xkb-options. It should be like this:

enter image description here

If you don't see 'terminate:ctrl_alt_bksp' you should add it there.

Danatela
  • 178
  • I'm not using GNOME settings daemon, so dconf-editor (or gsettings) shouldn't matter. Indeed, I find that in dconf-editor, terminate:ctrl_alt_bksp is in the xkb-options list, but the key combination has no effect and setxkbmap -print -verbose 10 shows that it is not enabled. – reasgt Mar 31 '14 at 17:54
  • Never mind the previous comment. I just realized that using authorization to kill X is ridiculous. – Danatela Apr 01 '14 at 02:07
0
# inxi -Sy
System:
  Host: fi965 Kernel: 5.4.0-26-generic x86_64 bits: 64
  Desktop: Trinity R14.0.9 Distro: Ubuntu 20.04 LTS (Focal Fossa)
# ls -l /etc/X11/xorg.conf.d/00-keyboard.conf
-rw-r--r-- 1 root root 286 May  6  2014 /etc/X11/xorg.conf.d/00-keyboard.conf
# cat /etc/X11/xorg.conf.d/00-keyboard.conf
# Read and parsed by systemd-localed. It's probably wise not to edit this file
# manually too freely.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection
#

Another file contains Option "DontZap" "off" and Option "ZapWarning" "off" in Section "ServerFlags".

This installation is an apt upgrade from 18.04, which is an apt upgrade from 16.04, which was an upgrade from 14.04, which is what the timestamp suggests the file was created for. It works as expected, presumably going back to 14.04 at least. I never use Gnome, so cannot say whether it could impact the behavior differently from TDE.

mrmazda
  • 61