I would like to acheive the following behaviour:
If a music player (Banshee in my case) is running, the Play/Pause media key on the keyboard causes the music player to play/pause the music. If the music player is not running, the Play/Pause media key launches the player.
The first case works out of the box since that is the standard behaviour. The second case does not work because the key is bound to the play/pause action which has nothing to do with launching any application. Is it possible to get the second case working?
I'm looking for an elegant solution using standard system features. I can always write a script that will (more or less) do that and bind the script to the play/pause key, but that is not the type of solution I look for.
I'm running Ubuntu GNOME 14.10 with GNOME Shell 3.12.2.