All Projects → mariusor → mpris-ctl

mariusor / mpris-ctl

Licence: MIT License
Basic mpris player control for linux command line

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to mpris-ctl

mpris-rs
Idiomatic MPRIS D-Bus interface library for Rust
Stars: ✭ 37 (+19.35%)
Mutual labels:  mpris, mpris-ctl
smu
Simple MarkUp - markdown/commonmark like syntax
Stars: ✭ 21 (-32.26%)
Mutual labels:  suckless
dwm-vanitygaps
My dwm vanitygaps build (incl. individual patches)
Stars: ✭ 26 (-16.13%)
Mutual labels:  suckless
st-history-vim
Development of the "vim patch" and a minimalist "history patch" for the suckless simple terminal (st).
Stars: ✭ 43 (+38.71%)
Mutual labels:  suckless
jj
An evolution of the suckless ii(1) file-based IRC client
Stars: ✭ 80 (+158.06%)
Mutual labels:  suckless
voidwm
voidwm • sanely patched dwm
Stars: ✭ 32 (+3.23%)
Mutual labels:  suckless
sent
a simple plaintext presentation tool
Stars: ✭ 22 (-29.03%)
Mutual labels:  suckless
dotfiles
dotfiles for my beautiful rices!
Stars: ✭ 440 (+1319.35%)
Mutual labels:  suckless
slock-flexipatch
An slock build with preprocessor directives to decide which patches to include during build time
Stars: ✭ 58 (+87.1%)
Mutual labels:  suckless
sfm
simple file manager
Stars: ✭ 163 (+425.81%)
Mutual labels:  suckless
CleanDmenu
🚀 Floating and enhanced dmenu build
Stars: ✭ 25 (-19.35%)
Mutual labels:  suckless
Goblocks
Status bar for dwm
Stars: ✭ 50 (+61.29%)
Mutual labels:  suckless
dotfiles
My configuration files for Linux and macOS
Stars: ✭ 20 (-35.48%)
Mutual labels:  suckless
rescrobbled
MPRIS music scrobbler daemon
Stars: ✭ 152 (+390.32%)
Mutual labels:  mpris
st
Repatch repository of developed 'Vim Browse' and 'Alpha Focus Highlight' patches for simple terminal (st).
Stars: ✭ 25 (-19.35%)
Mutual labels:  suckless
media-controls
A media indicator for the Gnome shell.
Stars: ✭ 104 (+235.48%)
Mutual labels:  mpris
patches
Collection of patches for dwm, st and dmenu
Stars: ✭ 202 (+551.61%)
Mutual labels:  suckless
cast control
📺 Control Chromecasts from Linux and D-Bus
Stars: ✭ 443 (+1329.03%)
Mutual labels:  mpris
chadwm
Making dwm as beautiful as possible!
Stars: ✭ 619 (+1896.77%)
Mutual labels:  suckless
suckless-101
Guide on how to patch, compile and install suckless software.
Stars: ✭ 33 (+6.45%)
Mutual labels:  suckless

mpris-ctl

MIT Licensed Build status AUR package Coverity Scan status Latest build

Is a minimalistic cli tool for controlling audio players exposing a MPRIS DBus interface, targeted at keyboard based WMs.

Its only build/run dependency is on the C dbus library.

Build

To build from source just clone the repository and run make. By default the binary is installed in /usr/local/bin, but you can provide your own DESTDIR and INSTALL_PREFIX.

$ git clone https://github.com/mariusor/mpris-ctl.git
$ cd mpris-ctl
$ make 
# make install

Usage

An example of configuration for i3/sway:

bindsym XF86AudioPlay exec "mpris-ctl pp"
bindsym XF86AudioStop exec "mpris-ctl --player active stop"
bindsym XF86AudioNext exec "mpris-ctl --player active next"
bindsym XF86AudioPrev exec "mpris-ctl --player active prev"

The --player flag supports passing multiple player names, or the values active or inactive. The active players are considered to be the ones which have the play_status be Playing, and the inactive ones are the ones with the play_status Stopped or Paused.

Eg:

mpris-ctl --player Rhythmbox play
mpris-ctl --player active pp
mpris-ctl --player inactive play

A more advanced example could be (this requires a notify daemon to be running):

set $mpris_notify notify-send "$(mpris-ctl info "%play_status")" \
    "$(mpris-ctl info "%artist_name: %track_name\nOn album '%album_name'")"
bindsym $mod+XF86AudioPlay exec $mpris_notify
# or even:
bindsym XF86AudioPlay exec mpris-ctl pp && $mpris_notify

Supported format specifiers for mpris-ctl info command:

Format specifiers:
    %player_name     prints the player name
    %track_name      prints the track name
    %track_number    prints the track number
    %track_length    prints the track length (seconds)
    %artist_name     prints the artist name
    %album_name      prints the album name
    %album_artist    prints the album artist
    %play_status     prints the playback status
    %shuffle         prints the shuffle mode
    %volume          prints the volume
    %loop_status     prints the loop status
    %position        prints the song position (seconds)
    %bitrate         prints the track's bitrate
    %comment         prints the track's comment
    %full            prints all available information

Example:

$ mpris-ctl info "%track_name"
Song 42
$ mpris-ctl info
Song 42 - Bloor - The Best of Bloor

Resources

For discussions related to the project without requiring a Github account please see our mailing list: https://lists.sr.ht/~mariusor/mpris-tools.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].