-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpithos-control
More file actions
executable file
·42 lines (36 loc) · 893 Bytes
/
pithos-control
File metadata and controls
executable file
·42 lines (36 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
#
# A script to control Pithos. This is simply a wrapper around dbus-send.
#
# Copyright 2018 Mark Lodato <lodato@google.com>
# Released under the MIT license; see LICENSE for details.
usage() {
cat >&2 <<EOF
USAGE: $0 <command>
Control Pithos via D-Bus.
Available Commands:
Control:
play
pause
play/pause
skip
EOF
exit 1
}
send_command() {
dbus-send \
--print-reply \
--dest=org.mpris.MediaPlayer2.pithos \
/org/mpris/MediaPlayer2 \
org.mpris.MediaPlayer2.Player."$1" \
|| exit $?
}
test $# -eq 1 || usage
case "$1" in
play) send_command Play ;;
pause) send_command Pause ;;
play/pause) send_command PlayPause ;;
skip) send_command Next ;;
# See https://github.com/pithos/pithos/wiki/DBus-Interfaces for more.
*) usage ;;
esac