mathz.nu Asterisk Blacklist Hobby webbhotell

2016/02/23

Control screen from CLI (crontab)

Filed under: Ubuntu — Mathz @ 16:05


#!/bin/bash
export DISPLAY=:0.0

if [ $# -eq 0 ]; then
echo usage: $(basename $0) “on|off|status”
exit 1
fi

if [ $1 = “off” ]; then
echo -en “Turning monitor off…”
xset dpms force off
echo -en “done.\nCheck:”
xset -q|grep “Monitor is”
elif [ $1 = “on” ]; then
echo -en “Turning monitor on…”
xset dpms force on
echo -en “done.\nCheck:”
xset -q|grep “Monitor is”
elif [ $1 = “status” ]; then
xset -q|sed -ne ‘s/^[ ]*Monitor is //p’
else
echo usage: $(basename $0) “on|off|status”
fi

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress