📜 ⬆️ ⬇️

Easy Control Music Player Daemon on the Gnome Panel

Disclaimer: this article is for dummies like me.



I use MPD as a media player, which is very convenient: the daemon is very small and economical, but it works very reliably and quickly.

In order not to spoil these qualities, I wanted to be able to manage it from Gnome just as easily, simply and without overhead. The repository has a special applet, the Gnome Music-applet Panel, but it draws a lot of dependencies with it, is not very convenient, and in general I have no relationship with it. In the end, I settled on the most straightforward solution.
')

Need MPC



MPC (Music Player Command) is a tiny utility for managing MPD from the command line. If you are already tensed, you can exhale, we will not issue commands for control manually.

So, put the MPC:

sudo aptitude install mpc


Create panel buttons


You need to add a few buttons to taste, for example, as in picture 1 above.

In my configuration there is one nuance. I use a vertical bar, because on a wide screen, it allows you to use screen space more efficiently. But by default, the launch buttons are scaled to fit the width of the panel, which is absolutely unnecessary what we wanted.

I installed a very convenient Launchers List panel applet that allows you to stack labels along and across in the required quantities:

sudo aptitude install quick-lounge-applet

After that, right-click on the free space on the panel and select Add to Panel .... Then right-click on the “handle” of the newly added applet and Preferences :



So, the recommended commands are:

You can learn about all the features of mpc in the usual way:

man mpc

As icons for buttons, I used standard icons, for example, from the /usr/share/icons/Humanity/actions/16/ directory.

We promote


For greater beauty, you can use the standard Ubuntu notifications, so that after pressing a button for a while, it looks like this:



To do this, we will use the well-known utility notify-send , which is part of the libnotify-bin package:

sudo aptitude install libnotify-bin

as well as a small script that needs to be saved (say, under the name mpd-control ) somewhere (for example, in ~ / bin), give the right to execute:

chmod +x mpd-control

and then run it instead of mpc. It also supports the 5 commands mentioned above (prev, next, toggle, random and update).

Update: for the most severe - the idea was developed and made an HTTP server in Python for more advanced display of prompts.

Once to see?



Sometimes it is interesting what exactly is playing. Personally, I use ordinary conky , which has in its extensive arsenal of sensors and data on the state of MPD, to satisfy curiosity. It looks something like the one in Figure 2 on the right.

Finishing touches



Sometimes you also want to control the reproduction without a mouse and from any application. If you want this and you have Compiz installed, you can assign the appropriate commands in CompizConfig Settings Manager ( sudo aptitude install compizconfig-settings-manager ), including the multimedia buttons on the keyboard:


Perhaps that's all.

Source: https://habr.com/ru/post/87316/


All Articles