Simple script that pauses your music player, when the screen gets locked and resumes playback once the screen is unlocked again.
Currently Unity, Cinnamon
and GNOME 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.
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 /usr/bin/
.
If you don't want to use the packaged version, donwload the sources and put the
executable in a directory of your choosing.
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.
Tested with Ubuntu 16.04, 17.04, 17.10 and 18.04.