abba23 / spotify-adblock

Adblocker for Spotify
https://github.com/abba23/spotify-adblock
1.83k stars 89 forks source link

Media Keys not working. #47

Open JoshCodeStuff opened 2 years ago

JoshCodeStuff commented 2 years ago

Found an issue, could just be how I started it but who knows. I have a Corsair K55 RGB and the play/skip buttons do not work (they work with just regular spotify though). I am running the latest version of Manjaro Cinnamon on Kernel 5.14.7-2. Let me know if you need any other data.

spotify.desktop:

[Desktop Entry]
Type=Application
Name=Spotify
GenericName=Music Player
Icon=spotify-client
TryExec=spotify
Exec=kdocker -q -o -l -i /usr/share/icons/Papirus/64x64/apps/spotify.svg env LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify %U
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;Player;AudioVideo;
StartupWMClass=spotify

The media keys also do not work when this is run from command line:

LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify

gooosz commented 2 years ago

Same issue for me, using the same Keyboard and running Arch 5.14.14-arch1-1 + KDE plasma

nenoro commented 2 years ago

try to install playerctl

JoshCodeStuff commented 2 years ago

try to install playerctl

I gave this a try. nothing happened. I tried the blocker on MXLinux (XFCE) and it works flawlessly. Must be an arch/manjaro thing or maybe cinnamon?

xenanthropy commented 2 years ago

(Using Arch and Cinnamon, same issue) I found a workaround on the spotify forums, someone tried using dbus instead of the "media keys" for their song controls. My keyboard had dedicated media keys (and were bound appropriately in keyboard shortcuts) so I unbound them and used these commands instead:

https://community.spotify.com/t5/Desktop-Linux/Basic-controls-via-command-line/td-p/4295625

hope that helps!

atatdotdot commented 2 years ago

This might not be your problem, but whenever I've had a problem with media keys not working in Spotify on Ubuntu, I've tracked it down to Google Chrome eating the media keys. The default behaviour in Chrome was changed some time back to enable this. Turn if off here: chrome://flags/#hardware-media-key-handling

realnc commented 1 year ago

I use Firefox and had the same problem. I had to toggle media.hardwaremediakeys.enabled from true to false in about:config.