Differences

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

Link to this comparison view

Both sides previous revision Previous revision
computer:hallway_display_renderer [2016/08/28 02:48]
tdobes
computer:hallway_display_renderer [2016/08/28 02:57] (current)
tdobes
Line 250: Line 250:
 </​code>​ </​code>​
  
 +on 205.215.88.172
  
-on 205.215.88.169+ 
 +power control ideas: 
 + 
 +<​code>​ 
 +new: 
 +/​usr/​local/​bin/​handle_display_power.sh: 
 +#!/bin/sh 
 + 
 +power=`cat ~display/​power.txt` 
 + 
 +case "​$power"​ in 
 +  "​on"​) 
 +    xset dpms force on && echo turned display on 
 +    ;; 
 +  "​off"​) 
 +    xset dpms force off && echo turned display off 
 +    ;; 
 +  *) 
 +    echo invalid power state specified 
 +    exit 1 
 +esac 
 + 
 + 
 +(then add systemd path unit to trigger this to run when file is changed, plus run manually when starting X) 
 + 
 + 
 + 
 +old 
 +/​usr/​local/​bin/​display-state.sh: 
 +#!/bin/sh 
 + 
 +[ "​display"​ != "​$USER"​ ] && exec sudo -u display $0 "​$@"​ 
 + 
 +STATE=`DISPLAY=:​0 xset q | grep '​Monitor is' | sed 's/.*Monitor is //g' | tr '​[A-Z]'​ '​[a-z]'​` 
 +REQUEST=`echo $1 | tr '​[A-Z]'​ '​[a-z]'​` 
 + 
 +if [ "​$#"​ -ne 1 ] 
 +then 
 +  echo $STATE 
 +elif [ "​$STATE"​ != "​$REQUEST"​ ] 
 +then 
 +  DISPLAY=:0 xset dpms force $REQUEST 
 +fi 
 + 
 + 
 +(also reads back display state, which is handy) 
 +</​code>​
computer/hallway_display_renderer.txt · Last modified: 2016/08/28 02:57 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS