Created
March 24, 2019 20:42
-
-
Save michelesr/9b064cbd6ed109140ba4ee43687e1cb1 to your computer and use it in GitHub Desktop.
Script to inhibit xscreensaver when VLC is playing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SLEEP_TIME=${1:-4m} | |
while true; do | |
if [[ $(qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlaybackStatus) == 'Playing' ]]; then | |
# tell xscreensaver to pretend there has been user activity | |
xscreensaver-command -deactivate | |
fi | |
sleep ${SLEEP_TIME} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment