Skip to content

Instantly share code, notes, and snippets.

@michelesr
Created March 24, 2019 20:42
Show Gist options
  • Save michelesr/9b064cbd6ed109140ba4ee43687e1cb1 to your computer and use it in GitHub Desktop.
Save michelesr/9b064cbd6ed109140ba4ee43687e1cb1 to your computer and use it in GitHub Desktop.
Script to inhibit xscreensaver when VLC is playing
#!/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