title: How to turn off screen using xset?
body: <p>Hi i am trying to run this script that turn off the screen when i call the script. </p>
  
  <p>Script code:</p>
  
  <pre><code>#!/bin/sh
  STATUS=`xset -q | grep "Monitor is" | awk '{print $3}'`
  if [ "${STATUS}" = "On" ]
  then
  xset dpms force off
  else
  xset dpms force on
  fi
  exit 0
  </code></pre>
  
  <p>But when i call the script, i am getting this error  </p>
  
  <pre><code>X Error of failed request:  BadMatch (invalid parameter attributes)
    Major opcode of failed request:  142 (DPMS)
    Minor opcode of failed request:  6 (DPMSForceLevel)
    Serial number of failed request:  10
    Current serial number in output stream:  12
  </code></pre>