john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Turn off the display from the command line

!/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


  • « Squid proxy parent proxy specific filter domain direct access
  • read write file »

Published

Nov 1, 2011

Category

linux

~75 words

Tags

  • command 29
  • display 7
  • from 24
  • line 31
  • linux 249
  • off 1
  • the 3
  • turn 1