Created
January 6, 2012 18:07
-
-
Save tremby/1571699 to your computer and use it in GitHub Desktop.
screens -- switch screens on or off
This file contains hidden or 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 | |
function usage { | |
echo "Usage: $(basename $0) {off|on}" | |
exit 1 | |
} | |
if [ ! $DISPLAY ]; then | |
echo "DISPLAY is not set" >&2 | |
exit 1 | |
fi | |
if [ $# -ne 1 ]; then | |
usage | |
fi | |
case "$1" in | |
on) | |
xset dpms force on | |
;; | |
off) | |
sleep 0.3 | |
xset dpms force off | |
;; | |
*) | |
usage | |
;; | |
esac | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment