#! /bin/sh # Jason Anderson - December 1, 2014 # Check to see if qdbus is installed. This will have to be updated # to check the search PATH. if [ ! -x /usr/bin/qdbus ] then echo "Please install qdbus and try this script again." exit 0 fi # We need to use dbus-send so as to pause all of the media players that are listening via MPRIS. case "${1}" in hibernate) for i in $(qdbus org.mpris.MediaPlayer2.*); do dbus-send --print-reply --dest=$i /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause done ;; resume|thaw) # Nothing to see here ;; esac