title: Get the power status of a connected TV on linux
body: <p>I'm currently trying to turn my display off and on when I leave / enter the house.</p>
  
  <p>I'm running an Ubuntu HTPC which is connected to a Samsung TV by HDMI (Intel HD4600).
  Using 'xset dmesq ...' results in switching the HDMI output off/on and doesn't change the power status of the TV (it just looses the signal). Therefore I connected an IR transmitter which is able to turn the tv off or on -  sadly both commands are using the same IR code, resulting in the power status to tip over.</p>
  
  <p>The xset status also doesn't return the right status, it's always seen as "On", regardless of the power status:</p>
  
  <pre><code>&lt;hashworks:~&gt; DISPLAY=:0 xset q | grep 'Monitor is'
  Monitor is On
  </code></pre>
  
  <p>I could save the last display status, but this will result in wrong values when I turn the TV off using the remote etc. The IR transmitter isn't getting anything back as well.</p>
  
  <p>Is there any other way to check the current status?</p>