9

I would like to disable the Ctrl-Alt-Backspace combination using a command line tool, without root priviliges.

I know I can use setxkbmap to enable “zapping” with the option terminate:ctrl_alt_bksp. Further, setxkbmap -option [naming no option] removes all options. Is there a way to unset only one option?

  • Maybe this will help. – MatthewRock Sep 14 '15 at 10:47
  • 1
    setxkbmap -option -option $(setxkbmap -query | sed -n '/options:\s*\|terminate:[^,]*/s///gp') – Costas Sep 14 '15 at 11:15
  • 1
    @don_crissti I hope that there is more correct decision than my crutch… – Costas Sep 14 '15 at 13:59
  • 2
    @Costas - alas, there is no straightforward way, setxkbmap -option -option new:options is the easiest way. – don_crissti Sep 14 '15 at 14:04
6

A little bit crutched: remove all options using -option with an empty argument first, then set same options with terminate excluded from the list:

setxkbmap -option -option $(setxkbmap -query |
    sed -n 's/options:\s*\(terminate:[^:]*,\)\?\|,terminate:[^,]*//gp')
  • To be clear, I was looking for something more straightforward — like you said yourself. It really seems there should be an option to do that, but if there isn't, this is The Answer. – xebtl Sep 15 '15 at 7:03
  • 1
    The command is missing a closing '. I'd edit it, but apparently it's not a substantive enough edit to make it through. :) – Ian Hunter Dec 19 '17 at 20:46
1

From my experience (limited) what worked best was using:

setxkbmap -query

And that prints out your current settings ( setxkbmap -print is another alternative to show your current keyboard settings) Then delete all the options by using the -option without any arguments:

setxkbmap -option

Then reintroduce the new options one at time:

setxkbmap -option key:key_replacement

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.