using_a_samsung_tv_as_computer_screen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
using_a_samsung_tv_as_computer_screen [25.01.2017 00:13] Pascal Suterusing_a_samsung_tv_as_computer_screen [25.01.2017 09:34] (current) Pascal Suter
Line 22: Line 22:
 #!/bin/bash #!/bin/bash
 while true; do while true; do
- xset -q | grep "Monitor is in Suspend+ xset -q | grep "Monitor is On
- if [ $? -eq ]; then+ if [ $? -eq ]; then
  if [ "`cat /tmp/displaystate`" != "off" ]; then   if [ "`cat /tmp/displaystate`" != "off" ]; then 
- ssh pi@192.168.168.169 'echo 'standby 0' | cec-client -s RPI'+ ssh pi@192.168.168.63 'echo 'standby 0' | cec-client -s RPI'
  echo "off" > /tmp/displaystate  echo "off" > /tmp/displaystate
  fi  fi
Line 31: Line 31:
  else   else 
  if [ "`cat /tmp/displaystate`" != "on" ]; then   if [ "`cat /tmp/displaystate`" != "on" ]; then 
-                 ssh pi@192.168.168.169 'echo 'on 0' | cec-client -s RPI'+                 ssh pi@192.168.168.63 'echo 'on 0' | cec-client -s RPI'
                  echo "on" > /tmp/displaystate                  echo "on" > /tmp/displaystate
          fi          fi
Line 38: Line 38:
 done done
 </code> </code>
-  - now make sure this script is started as background process on boot. in ubuntu you can simply add this line to your ''/etc/rc.local'' and make /etc/rc.local executable if it isn't already: <code>/opt/checkScreen.sh > /dev/null 2>&1 & +  - now make sure this script is started as background process on boot. simply added it to the autostart list of applicatoins in gnomeHere is the command I autostart: <code>/opt/checkScreen.sh > /dev/null 2>&1 & 
-</code> **note** make sure you add this line **before exit 0** :)+</code> 
 +  - in order to test if everything is working, you can force your screen to standby by running this command in a terminal <code>xset dpms force suspend</code>. your tv should switch off in no more then 10 seconds and it should swick back on in about 1 second after moving the mouse
  
  
  • using_a_samsung_tv_as_computer_screen.1485299582.txt.gz
  • Last modified: 25.01.2017 00:13
  • by Pascal Suter