Skip to content

Instantly share code, notes, and snippets.

@tremby
Created January 6, 2012 18:07
Show Gist options
  • Save tremby/1571699 to your computer and use it in GitHub Desktop.
Save tremby/1571699 to your computer and use it in GitHub Desktop.
screens -- switch screens on or off
#!/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