Standy by mode
This tip will show you how to go to stand by and resume screen using a command line :
Allow access for X session
From the manual or automatic X session, run the following command:
xhost +
This command disables all access controls
Specifying the display manager
Your console is not attached to the X session, it must be state the display to act on:
export DISPLAY =: 0
xset dpms standby force / / passing the monitor in standby
Stand by mode
xset dpms standby force // put le monitor on standby mode
Activation
xset dpms force on // wake up screen
xset s reset // Resume screen
Case Study
In this tips, we will show how to set the standby mode/resume in a specific time.
# cat manageDisplay0.sh
#!/bin/sh
export DISPLAY=:0
case "$1" in
stop)
xset dpms force standby
;;
start)
xset dpms force on
xset s reset
;;
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
# crontab -l
00 21 * * 1-5 /root/scripts/manageDisplay0.sh stop >/dev/null 2>&1
00 07 * * 1-5 /root/scripts/manageDisplay0.sh start >/dev/null 2>&1