I run ubuntu mate 24.04 on my machine, and I notice that now my media key on my logitech keyboard that usually only control strawberry music player, now will also control other media players that are open beside strawberry (like smplayer and youtube in this case).
Right now if I have both strawberry and smplayer up running, media key shortcut will only bind to smplayer, even if my mouse pointer is on-focus the strawberry music player.
Previously on ubuntu mate 22.04, media key (play/pause, stop, next, back) will only control exclusively music player. I like this old consistency behavior better than current one.
Question is how can i revert media key behavior back to the old behavior to 22.04?
I tried to replicate that:
I discovered that on 22.04 it controls a number of mediaplayers, at least Audacius , MPV and VLC on my rig.
It only controls one player at a time
It always controls the most recent opened and running player only. If that most recent opened player is closed, it switches to the next most recent opened player.
On 24.04 audacious and smplayer are both recognized.
MPV is not recognized unless mpv-mpris is installed.
Also here:
It only controls one player at a time
It always controls the most recent opened and running player only. If that most recent opened player is closed, it switches to the next most recent opened player.
Check the soundindicator to see which apps registered for mediakeys.
I haven't found a way yet to let the controls switch applications on the fly like you can on the 'sway' desktop.
If you want a certain player NOT to register to the mediakeys you have to disable either its dbus or mpris interface.
Unfortunately you can not blacklist them.
You can use dconf-editor to check which players have registered:
playername
the name of the player to control
like mpv or rhythmbox or audacious or vlc
action
one of the following words (case sensitive!!)
Play
Pause
PlayPause
Next
Previous
Stop
This will enable you to define which player gets the mediakeys.
example:
mpris audacious Stop
mpris audacious Next
mpris mpv Play
mpris smplayer Previous
etc.
Assign these commands to your mediakeys by using mate-control-center -> shortcut-keys
The following workaround is less work and makes use of the command playerctl
examples:
playerctl --player=audacious stop
playerctl --player=mpv pause
playerctl --player=smplayer play