Then I got creative and wrote a quick script to run under cron (every 5 minutes) to detect when the TV is powered on and to restart lightdm.
#!/bin/bashTVON="HDMI status: Pin=3 Presence_Detect=1 ELD_Valid=1"for i in $(find /var/log/ -maxdepth 1 -name syslog -mmin -5)do{TEST=$(grep "$TVON" "$i" | tail -n 1)if [ "$TEST" != "" ] ; then{# Is this a new one?TIMESTAMP=$(echo "$TEST" | awk '{print $6}' | sed 's/\[//g' | sed 's/\]//g')OLD_TIMESTAMP=$(cat /tmp/old_timestamp.txt)if [ "${TIMESTAMP}" != "${OLD_TIMESTAMP}" ] ; then{# we need to restart lightdmservice lighdm restartecho ${TIMESTAMP} | sed 's/\[//g' | sed 's/\]//g' > /tmp/old_timestamp.txt}fi}fi}done
Not elegant, but currently functional (No idea if restarting XBMC this way could be the cause of my previous post?).
Cursor no more..... :-)
No comments:
Post a Comment