#!/bin/bash
TIMEOUT_STANDBY=60
TIMEOUT_SUSPEND=900
TIMEOUT_OFF=0
xset -dpms -display ":0.0"
while :
do
DPMS_STATUS=$(xset q | grep 'DPMS is' | awk '{print $3}')
VLC_PID=$(pgrep vlc)
if [ "$VLC_PID" == "" ]
then
if [ "$DPMS_STATUS" == "Disabled" ]
then
xset +dpms -display ":0.0" dpms $TIMEOUT_STANDBY $TIMEOUT_SUSPEND $TIMEOUT_OFF
fi
else
if [ "$DPMS_STATUS" == "Enabled" ]
then
xset -dpms -display ":0.0"
fi
fi
sleep 1
done