thebitguru / play-button-itunes-patch

Play Button iTunes Patch
http://www.thebitguru.com/projects/iTunesPatch
Other
644 stars 19 forks source link

Play Button iTunes Patch not working on MacBook Pro Touch Bar w/ Mojave #46

Open kenmhaggerty opened 5 years ago

kenmhaggerty commented 5 years ago

I will have to double-check if the patch is working on my 2012 MacBook Pro running Mojave, but on my 2018 MacBook Pro running Mojave, the Touch Bar's play button still launches iTunes even after going through the regular setup process w/o error. (Disable SIP → Run patch → Re-enable SIP)

Please let me know what info I can provide to help debug.

petersg83 commented 5 years ago

Same here :)

thebitguru commented 5 years ago

Sorry, things seem to have changed recently and I haven't had time to find a workaround. I did notice that Apple has lately released an API to properly handle the keys without launching iTunes, thus mostly eliminating the need for this patch. Is the app that you are using not handling media keys properly? If so, can you share which app this is?

kenmhaggerty commented 5 years ago

I checked on my iMac with a Bluetooth keyboard and can confirm that the play button doesn't launch iTunes, but my MacBook Pro's touch bar will launch iTunes via the play button even from Finder.

thebitguru commented 5 years ago

Which media player are you using that doesn't respond to the key in the first place?

kenmhaggerty commented 5 years ago

I'm a little confused? My understanding is that this patch simply stops iTunes from launching when the play button is pressed and iTunes is not open. I am not using a media player when this happens.

thebitguru commented 5 years ago

Oh, I see the confusion. In previous macOS versions, Apple would launch iTunes when you used the media keys even if you had a different media player (e.g. Nightingale) running. That was my intented use case for creating this patch.

In your case it sounds like you don't want iTunes to start in any scenario...?

kenmhaggerty commented 5 years ago

Yes! Sometimes I accidentally tap the play button, and it shouldn't do anything if there's no media player launched. I think that should be the default macOS behavior... but in the absence of that I've been relying on this patch to do that!

thebitguru commented 5 years ago

Ah, OK. I was thinking of archiving this project now that macOS supports originally intended use case out of the box, but I will take another look hopefully soon and report back here.

petersg83 commented 5 years ago

Hi, I found the patch for the same reason as kenmhaggerty's. I have to add that I use Spotify and if I haven't done anything with Spotify for a while (while it is open somewhere in my spaces) and I press play to play the music on spotify, many times it launches iTunes. Even though Spotify is open! I don't know if the patch you created fixes this behavior but I'm interested if it does. Also, I would love to never launch iTunes with the play button, and if it's possible, to even choose what to launch with it (Spotify for example). If you know something that does that, I would be really interested too. In any case, thanks for your work :)

thebitguru commented 5 years ago

I am debating creating a simple replacement menu bar app that can monitor the media keys and either ignore them (so iTunes doesn't launch) or letting another app handle it. This would also eliminate the need for patching an OS released file like this project does. But, it would add another app that would have to run all the time. Would such an app be of interest?

petersg83 commented 5 years ago

For my use it would be perfect, just an icon in the top bar wouldn't bother me :)

thebitguru commented 5 years ago

OK, I will do some research and see if that can be a replacement app. No commitments though :)

petersg83 commented 5 years ago

Awesome thanks :)

benlk commented 5 years ago

I did notice that Apple has lately released an API to properly handle the keys without launching iTunes,

Are there any links for this new API? I've searched Apple's documentation, but couldn't find anything more recent than Snow Leopard. https://developer.apple.com/library/archive/technotes/tn2450/_index.html

thebitguru commented 5 years ago

MPRemoteCommandCenter is what I had in mind.

thebitguru commented 5 years ago

FYI, BeardedSpice is an option for ignoring media keys. I created a simple "strategy" script for it that can accomplish this. Given BeardedSpice's original use case, the interface isn't ideal (shows the title of the first tab), but it's a proof of concept. This is the strategy gist.

pleasejust commented 5 years ago

Yes, please, if you have time, create something, anything that'll prevent iTunes from launching when you press the play button, even when there's no other media player open. Of course when iTunes or other media players are open the keys should work. I'm holding off upgrading to Mojave because of this. Thanks a lot.

kaiserkiwi commented 5 years ago

I have the exact same issue as petersg83 and hoped to find any solution here. Are there any news on this?

pickanothername commented 5 years ago

I also have the same issue as those above me.

m1guelpf commented 5 years ago

Any update on this?

yougotwill commented 2 years ago

Not a perfect solution but recently discovered https://github.com/tombonez/noTunes.

AlecRust commented 2 years ago

There's also https://github.com/beardedspice/beardedspice