1

I know someone or the other has asked about disabling ⌘Q, but I like the shortcut, and I use it often. However, I use an email client called Airmail that unfortunately does not keep a service (for notifications) running in the background when it is quitted. However, if I press the close button a service runs in the background, allowing me to receive notifications.

But since I have a habit of pressing ⌘Q all the time to close apps, I was looking into a way I could disable it for only Airmail.

Anyone know of a what to do this?

3
  • 1
    You can do it in system prefs, keyboard- add a new, different, command to it, one you won't hit accidentally- or even assign cmd q to close window. On phone so will flesh out later
    – Tetsujin
    Commented Mar 2, 2015 at 15:01
  • I only want it to be disabled on airmail.
    – naiveai
    Commented Mar 2, 2015 at 16:25
  • As stated before, you can try System Preferences > Keyboard > Keyboard Shortcuts. There you can define whether the shortcut is valid for ONE application or all applications.
    – Phoenix
    Commented Mar 2, 2015 at 17:10

2 Answers 2

2

You can add a Key Command to any app [or all apps] from
System Prefs > Keyboard > Shortcuts > App Shortcuts
I don't have Airmail, but using Safari as an example

enter image description here

Hit the + button, select which app, type the menu name & your chosen key combo
For an app you don't want the original key combo to work for, replace it with something difficult to hit, or something you would never use, like
Cmd ⌘ / Opt ⌥ / Ctrl ⌃ / Shift ⇧ / F15 etc

Alternatively, if you want to replace Quit with Close Window, you add Cmd ⌘ Q to Close Window instead, [so long as that command appears in the menu somewhere] which will automatically remove Cmd ⌘ Q from the Quit item

enter image description here

4
  • Big Problem: Airmail does not have Close Window or anything similar in the menu bar. It only has Quit Airmail. The only way to close windows is to press the close button.
    – naiveai
    Commented Mar 3, 2015 at 10:52
  • Then you'd have to go with my first option, assign Quit something you'll never hit accidentally.
    – Tetsujin
    Commented Mar 3, 2015 at 10:53
  • Its not that I hit cmdQ accidentaly. I'm just used to it. If I replace it with something else, I will just get used to it again.
    – naiveai
    Commented Mar 3, 2015 at 10:55
  • 1
    The idea isn't to use the new combo, it's to stop you using it. I can't help if you are simply going to learn the new one & use that instead.
    – Tetsujin
    Commented Mar 3, 2015 at 11:01
0

just type this to a terminal to remove the shortcut from the menu item.

defaults write com.apple.Safari NSUserKeyEquivalents -dict-add "Quit Safari" nil

if you want to do this for another app and you don't know the id of that app just use this command.

osascript -e 'id of app "Calculator"'.   // com.apple.calculator
osascript -e 'id of app "Google Chrome"' // com.google.Chrome

then

defaults write com.apple.calculator NSUserKeyEquivalents -dict-add "Quit Calculator" nil
defaults write com.google.Chrome NSUserKeyEquivalents -dict-add "Quit Google Chrome" nil

You must log in to answer this question.

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