Can anyone advise of a way to set a universal quit-application shortcut?

Michael Stevenson

I'm moving across from Mac OSX and am quite used to using the Cmd-Q shortcut to quit apps. I appreciate that Linux is set up differently and that different apps have different shortcuts for quitting (e.g. some use Ctrl-Q while others might be Alt-Q, etc.). I'm currently using Ubuntu GNOME.

Would it be possible to create a standard keyboard shortcut for quitting all apps easily and safely in Ubuntu? I'm happy to use a third-party tool or do a bit of further digging.

M

Jacob Vlijm

Gracefully close a window

The simplest would be to add the following command to a shortcut key of your choice:

wmctrl -c :ACTIVE:

wmctrl is not installed by default:

sudo apt-get install wmctrl

from man wmctrl:

-c <WIN>
    Close the window <WIN> gracefully

Gracefully closing a window means that if you e.g. made changes to the currently opened file, you will be asked if you want to save the changes etc. This is similar to the Cmnd + Qyou are used to.

To add it to a shortcut key

Choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:

wmctrl -c :ACTIVE:

Or, if you are comfortable with Alt + F4

Even much simpler, as mentioned by @Takkat (thanks!), you can simply press Alt + F4

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Can anyone advise on the best way to integrate React Drag/Drop Lists with dynamic values from Redux?

Can anyone advise on how to apply custom ordering of a legend for pywaffle?

Can anyone advise the idea of solving such a task without going through all subsets?

Can i use nodejs to quit another application?

Is there a way to install an old version of a Windows (Universal) application?

Advise on search engine for Django application

Is there a way let the Spark Streaming Application quit when a Job aborted

is there a way to disable force quit while applescript application is still running?

Can't use JavaScriptSerializer in Windows Universal Application

How can I set an universal working directory?

Shortcut of universal app

Is there a Windows keyboard shortcut to quit Firefox?

QKeySequence::Quit shortcut not working in Windows

Set Application Size in Universal Windows Application for Windows Phone

Can't quit PyQt5 application with embedded iPython Qtconsole

Is there a way I can make shortcut for "2>&1 &"

Is there a way I can shortcut an SQL OR clause with a AND clause?

Can't set shortcut by operator & in qt designer

Is there a way to UnitTest a Class Library (Universal Windows) without testing a whole application?

Regex performance issue - can anyone explain way this regex is slow

PHP too slow, can anyone see a way to make it faster?

Is there a way to create a process which can be killed by anyone in Linux?

Can anyone hint at a way to recall my iterated labels in kivy?

Can anyone tell me what the key shortcut is in Ubuntu 14.04 to activate/use scale/expo?

Can anyone recommend me a good to-do application?

How to set a keyboard shortcut for toggling 'mouse keys' on/off in universal access, 18.04?

Android: What is the right and universal way to set the video size for recording?

Can anyone explain why set timeout print in last?

Can anyone explain how to simplify this set arithmetic issue?