Skip to content

Instantly share code, notes, and snippets.

@fzero
Last active September 13, 2016 17:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fzero/5182483 to your computer and use it in GitHub Desktop.
Save fzero/5182483 to your computer and use it in GitHub Desktop.
Detaching/reattaching Mac media keys to iTunes

You've been there...

Maybe you're listening to your favourite song on Rdio, or maybe checking your Soundcloud stream. You reach for the play/pause key on your keyboard and BAM, motherfucking iTunes comes up. Don't you hate that? I do.

Luckily, there's a way to fix it. Open your terminal and type:

launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist

Voilà, iTunes no longer responds to the media keys. The only downside is that now iTunes doesn't respond to the media keys at all. I couldn't care less, but if you're a crazy person who actually likes iTunes (poor you!), you can reattach the keys at any time with:

launchctl load -w /System/Library/LaunchAgents/com.apple.rcd.plist

One could conceivably run the detach script at login and write a small AppleScript launcher to reattach the keys and then launch iTunes. I'll leave this as an exercise to the reader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment