Blocking Apple Music from highjacking media keys.
Regaining control of my media keys on MacOS by halting Apple Music's intrusive auto-launch behavior.
Posted on February 7, 2024.
The problem.
Music fundamentally enriches my daily routine, serving as an essential backdrop to my work and enhancing every aspect of my day. For a long while, Apple Music was my go-to, despite its clumsy integration across iOS/iPadOS and MacOS. These days, my allegiance has shifted to Spotify.
Yet, a persistent annoyance has emerged: Apple Music's unwelcome habit of automatically launching whenever I tap the media play key on my keyboard.
This unwelcome behaviour interrupts my flow, requiring me to exit the app each time is presumptuously opens. When Spotify is active, the media keys function flawlessly. With Spotify closed, Apple Music assumes control.
The remedy, though very straightforward, highlights a dissapointing lack of control - a reliance on a third party application called noTunes. This app underscores Apple's obstinance in refusing to let users command their own devices.
The solution.
In an ideal world, noTunes would be unnecessary, Apple would allow users to choose their preferred music app. Alas, that is not the case. However, noTunes blocks Apple Music from launching via media keys and can be set to open Spotify instead.
This is how I integrated it into my system:
Following installation, I added it to my login items:
System Settings > General > Login Items
Preferring to not be constantly reminded of this workaround, I chose to hide its menu bar icon.
Additionally, I configured it to launch Spotify in response to media key presses:
The reason these quirks irk me so deeply is somewhat of a conundrum. They likely aren't intentional, but their persistent presence in recent MacOS versions is particularly frustrating.
Yet, here I am, adapting as needed.