You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
742 B
38 lines
742 B
2 years ago
|
#!/bin/sh
|
||
|
|
||
|
case "$1" in
|
||
|
play-pause )
|
||
|
func=PlayPause
|
||
|
;;
|
||
|
next )
|
||
|
func=Next
|
||
|
;;
|
||
|
previous )
|
||
|
func=Previous
|
||
|
;;
|
||
|
play )
|
||
|
func=Play
|
||
|
;;
|
||
|
pause )
|
||
|
func=Pause
|
||
|
;;
|
||
|
stop )
|
||
|
func=Stop
|
||
|
;;
|
||
|
* )
|
||
|
exit 3
|
||
|
esac
|
||
|
|
||
|
# get first mpris interface
|
||
|
bus=$(dbus-send --session \
|
||
|
--dest=org.freedesktop.DBus \
|
||
|
--type=method_call \
|
||
|
--print-reply=literal \
|
||
|
/org/freedesktop/DBus \
|
||
|
org.freedesktop.DBus.ListNames |
|
||
|
tr ' ' '\n' |
|
||
|
grep 'org.mpris.MediaPlayer2' |
|
||
|
head -n 1)
|
||
|
|
||
|
dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.Lollypop /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.$func
|
||
|
#echo dbus-send --type=method_call --dest=$bus /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.$func
|