Skip to content
Pause/Resume your music player when locking/unlocking Ubuntu
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Create LICENSE Mar 28, 2017 Include Cinnamon in README. Dec 3, 2018
pause-on-lock Added support for Cinnamon desktop. Nov 30, 2018


Simple script that pauses your music player, when the screen gets locked and resumes playback once the screen is unlocked again.

Supported desktop environments

Currently Unity, Cinnamon and GNOME are supported. The currently running desktop is detected using $XDG_CURRENT_DESKTOP.

Supported players

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 and 17.10.

You can’t perform that action at this time.