Google-Play-Music-Desktop-Player-UNOFFICIAL- icon indicating copy to clipboard operation
Google-Play-Music-Desktop-Player-UNOFFICIAL- copied to clipboard

Global hotkeys doesnt work, Linux Mint 19

Open Pepslee opened this issue 4 years ago • 19 comments

Hotkeys work only inside the app, but not global

Pepslee avatar Jan 29 '20 15:01 Pepslee

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of duplicate issues on this repo, so please double check now that your issue has not already been solved or doesn't have an open issue already.

To help make it easier for us to investigate your issue, please follow the contributing guidelines and ensure the issue template was filled out.

welcome[bot] avatar Jan 29 '20 15:01 welcome[bot]

Same issue for me on windows 10

PhilipFlood avatar Jan 30 '20 11:01 PhilipFlood

and on MacOS

dvirtz avatar Feb 05 '20 14:02 dvirtz

Not working for me anywhere on Kubuntu 19.10 with a MS Natural 4000 keyboard.

Additionally, when I go to the settings page it looks like so: image and I'm unable to modify any values.

Version is 4.7.1

OOPMan avatar Feb 05 '20 19:02 OOPMan

I also have the same issue. Hotkeys on keyboard worked prior to 4.7.1, but now do not work at all, not even inside the app. I'm on Red Hat Enterprise Linux 8.1.

smstewa4 avatar Feb 10 '20 00:02 smstewa4

Same Issue on Ubuntu 18.04.4 LTS. And I could not set Custom Hot Keys too.

dcbasso avatar Feb 18 '20 12:02 dcbasso

The issues is from mprisService taking over the media keys. Not sure why BOTH are implemented at the same time..

I've commented out to mprisService and it's working flawlessly.

midN avatar Mar 04 '20 18:03 midN

I propose we either remove mprisService since we use built-in D-BUS or change the internal D-BUS to use the new service in Gnome - @MarshallOfSound

Not sure if mprisService is used right now, i removed it in my local build, this has solved the issue of hotkeys not working in Debian

midN avatar Mar 04 '20 20:03 midN

@midN Not everyone uses Gnome tho?

OOPMan avatar Mar 04 '20 20:03 OOPMan

Phew, that actually wasn't the issue. Worked only until reboot, must've done something else in between :man_shrugging: The issue is DBus not listening on Media anymore due to Gnome trying to remap/rename the keys.

Not sure what the workaround in the code would be.


Workaround is to:

  1. Install dconf-tools
  2. Open it, go to org/gnome/settings-daemon/plugins/media-keys and set value to [''] on all related to media play/pause/next/prev
  3. Reboot
  4. Open Hotkeys Gnome menu, add new Hotkeys and map media buttons to run Command dbus-send --print-reply --dest=org.mpris.MediaPlayer2.google_play_music_desktop_player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause ( Replace PlayPause with Next and Previous for other 2 )

midN avatar Mar 05 '20 19:03 midN

I found that on my system (Ubuntu eoan 19.10) the problem was Chrome using media keys. To disable Chrome media keys handling change the following setting chrome://flags/#hardware-media-key-handling to disabled and restart Chrome.

This worked for me, not sure if there is a better solution... Solution described in https://github.com/MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-/issues/3788#issuecomment-595397077 is fairly cumbersome but might be better? It would prevent other programs from hijacking media keys, not only Chrome...

zasran avatar Mar 26 '20 02:03 zasran

I found that on my system (Ubuntu eoan 19.10) the problem was Chrome using media keys. To disable Chrome media keys handling change the following setting chrome://flags/#hardware-media-key-handling to disabled and restart Chrome.

This worked for me, not sure if there is a better solution... Solution described in #3788 (comment) is fairly cumbersome but might be better? It would prevent other programs from hijacking media keys, not only Chrome...

Worked for me. Thanks (Ubuntu 18.04)

darkporpoise avatar Mar 26 '20 07:03 darkporpoise

@zasran you saved my day bro

mossad-zika avatar May 07 '20 11:05 mossad-zika

Still having this issue on Windows 10. Even tried disabling media keys in Chrome. No change.

charleskaucher avatar May 07 '20 21:05 charleskaucher

On Ubuntu 20.04, I did not have success with disabling the Chrome flag as described here.

However, the workaround described in #3788 (comment) did work after a system reboot, with a minor change: since dconf-tools isn't available, use dconf-editor (GUI) instead. It should be available in the Software Center. I also did not have to remap any keyboard shortcuts for GPMDP specifically.

To clarify, for others with this issue on 20.04:

  1. Install dconf-editor. Click I'll Be Careful when prompted with the warning.
  2. Navigate through the folders to org/gnome/settings-daemon/plugins/media-keys.
  3. Make sure the value for each of the following keys is ['']. Note: If needed, change these by setting Use default value to Off`, and then editing the Custom value field. Click the check-mark button to apply each change.
play
play-static
pause
pause-static
stop
stop-static
previous
previous-static
next
next-static
  1. Reboot
  2. Open GNOME's Keyboard Shortcuts settings. Make sure all of the existing media key shortcuts are set to Disabled

Media keys should now work with most applications, including GPMDP. If not, set custom commands for each media key as described below.

  1. Under Custom Shortcuts at the bottom, click the + (plus) button to add replacement shortcut mappings which run DBus commands -- one for each button -- listed below.
Stop: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.google_play_music_desktop_player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
Play/Pause: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.google_play_music_desktop_player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
Previous: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.google_play_music_desktop_player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
Next: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.google_play_music_desktop_player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

Note: As stated above, I did not have to add these as Keyboard Shortcuts. However, I did verify these commands using the terminal. They may also be useful in shell scripts or similar.

Hope this helps! :)

andrewjmetzger avatar Jul 21 '20 19:07 andrewjmetzger

I have Linux Mint 19.

How do you even view settings??

I'm seeing YouTube Music now, and the interface is all YouTube stuff, there seems to be nothing specific to this app.

image_2020-11-13_091352

Not working for me anywhere on Kubuntu 19.10 with a MS Natural 4000 keyboard.

Additionally, when I go to the settings page it looks like so: image and I'm unable to modify any values.

Version is 4.7.1

imkane avatar Nov 13 '20 16:11 imkane

AFAIK the Settings pane mostly affected the (now dead) Google Play Music features. I suspect that the values cannot be changed because you're in YT Music mode, but GPM doesn't exist anymore, so you can't switch to that, change the hotkeys and use them in YT Music.

It may be worth digging around in the GPMDP config to see if the settings can be edited manually.

andrewjmetzger avatar Nov 13 '20 19:11 andrewjmetzger

@andrewjmetzger this app works perfectly: https://ytmdesktop.app/

:1st_place_medal:

I can see Settings, and keyboard shortcuts to pause/play etc work out-of-the-box w/ Linux Mint 19.

imkane avatar Nov 13 '20 19:11 imkane

@imkane Thanks for the award! :smiley:

I think the maintainers of GPMDP are internally debating about whether they should carry on here with the re-branding and overhaul, or if they should just suggest we all transition to YTM Desktop, since it has support for many of the features that made GPMDP so awesome in the past. See https://github.com/MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-/issues/3841 for some background, if desired.

Personally, I run the development branch of YTM Desktop, since master is woefully outdated. Other than having two windows open constantly (YTM and terminal), or the occasional performance issues, it's pretty alright. I love GPMDP for sure--if the features were equal, I'd never have switched--but unless and until GPMDP makes YouTube Music a "first-class citizen", so-to-speak, YTM Desktop is good enough for me.

Potentially relevant for the Linux crowd are https://github.com/ytmdesktop/ytmdesktop/issues/367, https://github.com/ytmdesktop/ytmdesktop/issues/260, and https://github.com/ytmdesktop/ytmdesktop/issues/376, among others. You can also see every *nix issue, too.

andrewjmetzger avatar Nov 13 '20 20:11 andrewjmetzger