One thing that immediately annoyed me about the Mac was that the shortcut to close the application is Command + Q. This is just way too close to Command + W, the shortcut to close a tab/window. Being fast with the fingers I will tend to press Command + Q at times closing the entire program together with the documents I’m working on / tabs I’m browsing / IMs chats I’m having. Now for some applications there are work arounds, e.g. for Cocoa based applications (e.g. Safari, Mail) you can assign another shortcut to the menu item in the Keyboard Shortcuts tab in the Keyboard & Mouse preference pane
- Click on the “+” button
- Select the application (e.g. Mail.app)
- Type in the quit menu item text in the “Menu Title” field (e.g. for Mail.app it would be “Quit Mail”)
- Enter your keyboard shortcut
Now this would be nice to have for all applications but due to the fact that for each application the menu item to close the application is based on the application itself (e.g. Mail = “Quit Mail”, Safari = “Quit Safari”), it is plain to see there is no easy way to cover all applications. Also, as mentioned, it works only for Cocoa applications, so this wont work in applications like Firefox. Also some applications like NeoOffice will still respond to Command + W. So had to search for other alternatives.
For Firefox you can configure Firefox to prompt to confirm closing if there are multiple tabs open and there are probably extension that may help prevent the closing of the browser, but I wanted to find a complete solution. So after much Googling I finally found this blog post on disabling Command + Q with Quicksilver by using triggers.
In Quicksilver’s Triggers page:
- Add a trigger by pressing the “+ button” then selecting “Hotkey” (a new row should be created)
- Click the empty space under the “Command” column of the newly created row
- In the “Select an item” field, press . to enter text mode and clear any text that appears
- In the “Action” field, enter “Large Type”
- Leave the “Target” field blank and click save
- Now to create the keyboard shortcut by click the “None” field under the “Trigger” column
- A drawer will pop out and in the “Settings” Tab, press the “Edit” button in the “Hot Key” field and press Command + Q
- In the “Scope” Tab, ensure it is “Enabled in all applications” (any other option does not seem to work even though I specify the correct applications. possibly a bug)
- So now the Command + Q shortcut is disabled as long as this trigger is enabled
So now when you press Command + Q the application no longer closes and gives you an little beep indicating no action is assigned to the shortcut. What if you still want a shortcut to close it? Just add another trigger!
- Add new Hotkey trigger
- Select an Item: Current Application
- Action: Quit
- Select your appropriate shortcut and be happy =)
So go download Quicksilver. It can do a heck of a lot more than just this with the great plugins it has: resize images, open bookmarks, move files and add. Check out the Lifehackers’ top 10 Quicksilver plugins or the tutorials and start delving into the world of Quicksilver