Code Monkey home page Code Monkey logo

empress's Introduction

empress: MPRIS media controls made simple

This tool functions as a simple command-line abstraction over the D-Bus MPRIS specification which allows for querying and controlling media players. It functions similarly to playerctl, but features more basic controls and a more complex method of tracking which player you want to control. empress uses its own D-Bus daemon to keep track of which players are currently playing (and which players have been updated the most recently), and uses this information to determine you wanted to pause Spotify rather than playing a minimized YouTube video.

Installation

To install empress, simply use Cargo:

$ cargo install empress

(or, if you use Arch, I maintain this package in the AUR:)

$ yay -S empress

Then launch the daemon process in order to use it โ€” you will probably want to put this in an rcfile (or see below for setting up a service):

$ empress server

The server will gracefully shut down if interrupted or signaled with SIGTERM.

Usage

Once you have the daemon set up, you can communicate with it using one of several subcommands, e.g.:

$ empress play-pause

Empress has commands for basic player operations (e.g. now-playing, play/pause/play-pause/stop, next/previous/seek, volume), as well as several utility subcommands for more advanced operation (such as list-players and switch-current). To see the list of commands at any time or get help for a particular command simply run empress help.

Installing empress as a Service

empress can be installed as a service to allow autostarting and lifecycle management using D-Bus and systemd. To do this, run the following:

$ scripts/install-services.sh -l <path to empress binary>

This will install the D-Bus and systemd service files into ~/.local/share. If you installed empress with cargo install, the path to the binary will probably look something like /home/<user>/.cargo/bin/empress.

If you want to make a system-wide installation, simply omit the -l flag. This will install the session service files into /usr instead (but note that empress never runs as a D-Bus system bus).

Once empress has been installed as a service, running any of the empress client commands listed above will autostart the daemon.

Uninstalling

To remove installed service definitions, simply run:

$ scripts/install-services.sh -rl

Like with above, remove the -l to uninstall the service files from the system folders.

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.