Simple script that pauses your music player, when the screen gets locked and resumes playback once the screen is unlocked again.
Currently Unity,
Cinnamon,
GNOME and MATE are
supported. The currently running desktop is detected using
$XDG_CURRENT_DESKTOP
.
By default pause-on-lock supports Rhythmbox and Spotify. If you want support for more players, you can install playerctl. If playerctl is installed pause-on-lock supports all players that playerctl can handle.
Simply download the executable for the latest
release and put it
in a directory of your choosing (e.g. $HOME/bin
). If you don't want to use
the absolute path to run pause-on-lock, make sure that the folder is in your
$PATH
. You might need to set the executable bit with chmod +x pause-on-lock
.
Simply run pause-on-lock
, there is no further configuration needed.
I strongly recommend to add the pause-on-lock executable to Startup Applications,
so it is run every time you log in.
Should run with all Ubuntu releases >= 16.04