Skip to content

Instantly share code, notes, and snippets.

Avatar

Vladimir Iakovlev nvbn

View GitHub Profile
@exic
exic / player-control
Created Dec 2, 2014
Control a player implementing MPRIS D-Bus Specification v2.2
View player-control
#!/bin/sh
name="$1"
shift
PATHS="org.mpris.MediaPlayer2.$name /org/mpris/MediaPlayer2"
DBUS_SEND="dbus-send --type=method_call --dest=$PATHS"
RC="$DBUS_SEND org.mpris.MediaPlayer2.Player"
if [ "$@" = "prev" ]; then
$RC.Previous
elif [ "$@" = "stop" ]; then
$RC.Pause