9

I use cmd+tab, cmd+W, cmd+A a lot and I don't remember how many times I hit cmd+Q accidentally.

Is it possible to change the shortcut for quitting applications from cmd+Q to something else (not to disallow using keyboard to quit applications), ideally for applications all at once (not to do it for individual application one by one)?

  • I thought changing it in the Keyboard section of System Preferences, under Keyboard Shortcuts might work, but it didn't here. Unless I need to reboot to see the change. – George C Nov 7 '12 at 6:18
3

This should change the shortcut to ⇧⌘Q for most currently installed applications:

defaults write -g NSUserKeyEquivalents -dict-add $(mdfind kMDItemContentType==com.apple.application-bundle | grep -v { | sed 's/.*\//Quit /g;s/\.app$//g;'"s/'/\\''\\'/g;s/^/'/g;s/$/' '\$@q'/g" | uniq | tr '\n' ' ')

You could also use KeyRemap4MacBook to change ⌘Q to some other key combination or require holding or pressing it twice to quit an application.

  • Is there a way to edit this database visually? That's a crazy command line ninja move you've got there! ;) – Hari Karam Singh Aug 28 '17 at 11:28
  • 2
    Or can you teach me your ways? – Hari Karam Singh Aug 28 '17 at 11:43
1

Howtogeek devoted a whole article about this subject and they provided an excellent tutorial on how to do this. Basically it comes down to override the default function.

enter image description here

BUT there is a (huge) disadvantage, if you do it that way, you'll have to do this for EVERY application you use, which might work a bit confusing...
So they provide a work-around rather then a solid solution.

  • 3
    My question mentions that "for applications all at once (not to do it for individual application one by one)". – powerboy Nov 8 '12 at 4:19

You must log in to answer this question.

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