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.

36 lines
1.2 KiB

#!/bin/sh
executeDbusSendForLollypop() {
case "$1" in
play-pause )
func=PlayPause
;;
next )
func=Next
;;
previous )
func=Previous
;;
* )
exit 3
esac
dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.Lollypop /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.$func
}
if [[ $(ps ax | grep "/usr/bin/lollypop") =~ "python3" ]]; then
executeDbusSendForLollypop "$1"
else
# just start lollypop if not already running
lollypop &
fi
#currentLollypopMetadata=$(qdbus org.mpris.MediaPlayer2.Lollypop /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata)
#albumImage=$(sed '1q;d' <<< $currentLollypopMetadata) # first line of output
#albumImage=${albumImage#*//} # remove part before //
#albumName=$(sed '4q;d' <<< $currentLollypopMetadata) # fourth line of output
#albumName=${albumName#*: } # remove part before ": "
#artist=$(sed '6q;d' <<< $currentLollypopMetadata) # fourth line of output
#artist=${artist#*: } # remove part before ": "
#title=$(sed '8q;d' <<< $currentLollypopMetadata) # fourth line of output
#title=${title#*: } # remove part before ": "
#notify-send "$title" "$artist - $albumName" -i "$albumImage"