Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Pause/Resume your music player when locking/unlocking your Linux desktop.

License

NotificationsYou must be signed in to change notification settings

folixg/pause-on-lock

Repository files navigation

Notice: I did a rewrite in python which can handle more players (probably yourfavorite among them) by default and is also able to handle multiple playersrunning at the same time (like if you're watching a video in your browser andlistening to music on your spotify or whatever you do). It's still an earlyrelease and I'd be happy if you gave it a try and let me know if somethingdoesn't work for you.

You can visit thegithub pageor just install viapip install pauseonlock

logo

pause-on-lock

Automatically pause your music player when the screen gets locked and resumeplayback, once the screen is unlocked again.

Supported desktop environments

CurrentlyUnity,Cinnamon,GNOME,MATE,KDE,POP!_OS andXFCE are supported. The currently running desktop isdetected using$XDG_CURRENT_DESKTOP.

Installation

Download the executable for thelatestreleaseand run

sudo install pause-on-lock /usr/local/bin/

If you don't have sudo rights or don't want a system-wide installation, changethe install destination directory to e.g.$HOME/bin (and make sure that thatfolder is in your$PATH).

Usage

Rhythmbox and Spotify

By default pause-on-lock supportsRhythmbox andSpotify. If you use no otherplayers, no further configuration is needed, you can simply runpause-on-lock.

User defined player

With the--player or-p flag you can provide the name of one additionalplayer that pause-on-lock will then handle. The player needs to provide aMPRIS D-Businterface (which is the case for most common media players) and the name youprovide needs to match the name used for the D-Bus interface. For examplevlc provides a D-Bus interface atorg.mpris.MediaPlayer2.vlc so all you need to do is callpause-on-lock -p vlc and pause-on-lock will pause any running vlc instance when you lock yourscreen.

tl;drpause-on-lock --player NAME should work in most cases.

Playerctl

If you want support for many different players and you haveplayerctl installed, you can use the--playerctl or-c flag to enable playerctl support in pause-on-lock. Thenall players that playerctl can handle are supported, without the need forfurther configuration.

Autostart

I strongly recommend to add the pause-on-lock executable toStartupApplications(or the equivalent for your desktop environment), so it is run every time youlog in.


[8]ページ先頭

©2009-2025 Movatter.jp