Simple script that pauses your music player, when the screen gets locked and resumes playback once the screen is unlocked again.
Supported desktop environments
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.
You can download the latest release
either as deb-package or as source tarball.
In order to install the packages version run
sudo dpkg -i pause-on-lock_1.1-0ubuntu1.deb,
this will install the binary to
If you don't want to use the packaged version, donwload the sources and put the
executable in a directory of your choosing.
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.
Tested with Ubuntu 16.04, 17.04 and 17.10.