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.
You can download the latest release
as source tarball.
Simply extract the sources to a directory of your choosing
(e.g. /opt/pause-on-lock
). If you don't want to use the absolute path to run
pause-on-lock, make sure to create a symlink to the executable in a folder
that is in your $PATH
(e.g. ln -s /opt/pause-on-lock/pause-on-lock $HOME/bin
).
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