Coder Social home page Coder Social logo

pause-on-lock's Introduction

logo

pause-on-lock

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

Supported desktop environments

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

Installation

Download the executable for the latest release and run

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

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

Usage

Rhythmbox and Spotify

By default pause-on-lock supports Rhythmbox and Spotify. If you use no other players, no further configuration is needed, you can simply run pause-on-lock.

User defined player

With the --player or -p flag you can provide the name of one additional player that pause-on-lock will then handle. The player needs to provide a MPRIS D-Bus interface (which is the case for most common media players) and the name you provide needs to match the name used for the D-Bus interface. For example vlc provides a D-Bus interface at org.mpris.MediaPlayer2.vlc so all you need to do is call pause-on-lock -p vlc and pause-on-lock will pause any running vlc instance when you lock your screen.

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

Playerctl

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

Autostart

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

pause-on-lock's People

Contributors

folixg avatar adrianvg avatar j-bro avatar hoeze avatar stlhrt avatar bhedavivek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.