#!/bin/bash dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver',member='ActiveChanged'" | \ ( while true; do read X echo $X if echo $X | grep "boolean true" &> /dev/null; then dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause elif echo $X | grep "boolean false" &> /dev/null; then dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause fi done )
Lately this blog is about my technical musings. Mostly it is a reminder for my future self, but I also hope it is useful for others. I recently added ads to cover the domain cost.
Tuesday, July 18, 2017
A script that pause/plays on lock/unlock Spotify
A script that pause/plays on lock/unlock
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment