Skip to content

Instantly share code, notes, and snippets.

Last active Sep 13, 2016
What would you like to do?
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/

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/

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