Use multimedia keys with gmusicbrowser
gmusicbrowser is the default music player for Xubuntu 11.10. Among its main features are the support for large libraries, customizable window layouts, a powerful browser which doesn't interfere with the playlist and a tray icon with player controls.
There is a plugin called "Gnome mmkeys" that allows to control playback with keyboard's multimedia keys, albeit not compatible with Xfce4. If you try to enable the plugin, the message below will be shown:
Error: org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SettingsDaemon was not provided by any .service files
So I created a little bash script to control the gmusicbrowser playback and another one for assigning each function with the correspondent multimedia key.
Install
Open a terminal window and run (it'll need admin permissions for installing gmusicbrowser-mmkeys.sh to /usr/local/bin/):
wget -q -O /tmp/gmb.sh https://goo.gl/18uaAO && bash /tmp/gmb.sh install
The multimedia keys should now be working. Enjoy.
Uninstall
Open a terminal window and run (it'll ask for admin permissions for removing the gmusicbrowser-mmkeys.sh script):
gmusicbrowser-mmkeys.sh uninstall
Note: The installer has been updated to install gmusicbrowser-mmkeys.sh in /usr/local/bin. If you install it elsewhere, please remove manually.
References
gmusicbrowser man page (oneiric)Xfce Settings (xfconf-query reference)
I prefer to use exaile. It is far more practical and beautiful.
ReplyDeleteActually exaile is my second favorite player. Now I'm using clementine (http://goo.gl/jOSiJ) a fork of the good old Amarok 1.4.
DeleteNice hack, Wilson, this was ever so useful! :-)
ReplyDeleteMuchas gracias!!!
ReplyDeleteThat is perfect. Nice and clean :-)
ReplyDeleteYou are all very welcome :)
DeleteHello! How do i remove it?
ReplyDeleteI updated the article to include a section explaining how to uninstall the script. If you mean remove gmusicbrowser, run this:
Deletesudo apt-get remove gmusicbrowser -y
If you're looking for a new music player, you could take a look at Clementine: http://goo.gl/0HOxU. Now it's my first choice.
I removed gmusicbrowser-mmkeys.sh and change keys to default. Im now using clementine as you suggested and it's a great player. The only problem i found so far is that it cannot load audio cd. If you know how to fix it i will really apreciate it. Im now a follower of your blog! I also installed synapse.
ReplyDeleteI tried a lot of gnome 3 distros/forks and i gave up. I was about to try MATE when i came across your blog and decided to install xubuntu. So far it works flawless!
Thanks very much and i look forward to read more news!
(if i sound a little weird is because im from Argentina and spanish is my first language).
Hi, I'm glad you found this blog useful. Some time ago I was also unsatisfied with the other options (Unity, Gnome 3, KDE 4, ...), until I tried Xubuntu.
DeleteThe PC I'm using doesn't have a CD player, so I'll take a look at your problem later.
Don't worry worry about your English, I understood it just fine. And English isn't my mother tongue either, I'm Portuguese.
Finally I got a chance of trying to play a CD with Clementine (Music > Open audio CD). I didn't experience any problems. I'm using version 1.0.1 installed from the 12.10 repositories.
Deleteawesome, thanks
ReplyDeleteYou're welcome.
DeleteThanks man, its Work Perfectly!
ReplyDeleteYou're welcome.
Delete¡Thank you! =)
ReplyDeleteYou're welcome!
Deletenicely done... keys working again! thanks!
ReplyDeleteIn Xubuntu 13.04 I was able to control both Spotify and gmusicbrowser separately (fn play/pause keys would only play/pause gmusicbrowser when it is open and not autostart it if it wasn't open by the user via the keyboard shortcuts method described above) by using the Gnome mmkeys plugin. If you go to "Session and Startup" -> "Application Autostart" and check the box next to "Gnome Settins Daemon" and then log in and log out, you should be able to use the mmkeys plugin. This frees up the shortcut keys so that they can be used for other applications and not only gmusicbrowser. Thanks OP for your original quick and easy solution which helped me think of mine. If anyone is looking to control other applications as well, I can vouch that at least Spotify and gmusicbrowser work together.
ReplyDeleteRegards,
-M
Also OP, please feel free to include my findings in your post if you feel it will be helpful to future visitors.
Delete-M
Can you make something like this for clementine also?
ReplyDeleteClementine has built-in support for multimedia keys. However the default system package doesn't work very well. Try to install the development version as described on this post: http://goo.gl/FDisvK
DeleteThanks! great hack
ReplyDeleteThanks so much, man..
ReplyDeleteWorked on Debian Wheezy 7.7!
Nice man, you saved my day...
ReplyDeleteJust re-uploaded the script and updated the install instructions.
ReplyDelete