Skip to content

Instantly share code, notes, and snippets.

View nico202's full-sized avatar

Nicolò Balzarotti nico202

View GitHub Profile
@nico202
nico202 / player-control
Last active August 1, 2016 10:04 — forked from exic/player-control
Control a player implementing MPRIS D-Bus Specification v2.2
#!/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.Prev
elif [ "$@" = "stop" ]; then
$RC.Stop