Is there a way to send CTRL+ALT+Backspace to Linux hosts?

Forum / NoMachine for Linux / Is there a way to send CTRL+ALT+Backspace to Linux hosts?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23674
    linxpatrick
    Participant

    I have a Linux host that sometimes doesn’t show the desktop after logging in. I’m trying to see if there is a way to send CTRL+ALT+Backspace in order to restart the X server/Desktop when this happens. If there isn’t a way to do that, can it be added in the same place where CTRL+ALT+Delete is sent to Windows hosts?

    #23685
    Tor
    Participant

    Hi. The Ctrl + Alt + Backspace is a quite “destructive” command, so I think we could find a way to solve your problem without adding the shortcut to the UI. 😀
    I’d propose to remap the standard shortcut with something different, like Ctrl + Alt + End, which can be used on client without risking to kill the wrong X server.
    You would need a procedure like this:

    – Create the folder where to store a new XKB map entry:

    mkdir -p ~/.xkb/symbols/

    – In that directory create a file called local and edit it by adding the following configuration:

    default partial modifier_keys
    xkb_symbols "ctrl_alt_end" {
        key <END> {
            type="CTRL+ALT",
            symbols[Group1] = [ NoSymbol, NoSymbol, NoSymbol, NoSymbol, Terminate_Server ]
        };
    };

    – Run the following command:

    setxkbmap -print | sed -e '/xkb_symbols/s/"[[:space:]]/+local(ctrl_alt_end)&/' | xkbcomp -I${HOME}/.xkb - $DISPLAY

    – Press Ctrl + Alt + End to kill your X server 🙂

    You can add the setxkbmap command to a script, and execute it automatically when the session starts, for example through a .desktop file in ~/.config/autostart.

Viewing 2 posts - 1 through 2 (of 2 total)

This topic was marked as closed, you can't post.