2

Running Ubuntu 22.04.
There are default key bindings to close window (Ctrl+W) and to quit application (Ctrl+Q). These are not changeable through settings -> keyboard. Seems like they are built into the system. I would like to change those to use Alt instead of Ctrl but can't find a way to do that.

1
  • Yea, I might have confused them unintentionally Commented Aug 29, 2022 at 13:25

1 Answer 1

5

Sometimes a disappointing answer is better than no answer.

Both these shortcut keys, Ctrl+Q and Ctrl+W, are defined at the level of the applications themselves. It would thus take reconfiguring each application that uses these keyboard shortcuts in order to change them.

Some applications, such as Libreoffice, provide an interface to customize keyboard shortcuts. Others do not, and the only way to change these may sometimes be to edit source code and recompile the program.

4
  • It's possible to set up "close window" shortcut through keyboard settings. But I couldn't find the one for quitting the application. I don't mind if both Ctrl and Alt work. Commented Aug 29, 2022 at 13:28
  • Indeed one could add a global shortcut for closing windows, but in your question title, you explicitly ask to change the key. My answer is to the question as asked. Please "accept" the question if it answers that question. Closing applications with a global key is not so simple. It could be done with a script that identifies the process of the current window then kills that process. And that would probably be a lot more difficult if at all possible on Wayland.
    – vanadium
    Commented Aug 29, 2022 at 14:29
  • It's weird there is a system shortcut for quitting an application yet no direct way to make a custom shortcut for the same action. Could you please expand your answer by including resolution of both comments? It's best to have a more descriptive answer that tackles the core issue rather than strictly answers the given question. Thanks =) Commented Aug 29, 2022 at 17:34
  • Correction: there is no system shortcut for quitting an application. There is a system shortcut to close a window. The question is: how to change program specific shortcuts, Ctrl+w and Ctrl+q. This is the answer: the application decides on these, so you need to change within the application if the application allows. Feel free to add another question with respect to reconfiguration the system wide shortcuts if you need to, or with respect perhaps to create a script to close the application owning the current window. These are different matters than what is asked in your current question.
    – vanadium
    Commented Aug 30, 2022 at 9:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .