[mythtv-users] Shell script to turn monitor off that almost works

leifer @dslextreme.com leifer at dslextreme.com
Mon Jan 17 15:30:31 UTC 2011


On Mon, Jan 17, 2011 at 7:00 AM, Dave M G <martin at autotelic.com> wrote:

> MythTV users,
>
>
> It works... almost. What it does is turn of the screen, and then a few
> seconds later, the screen comes on again. Then I hit the green power
> button again, and this time the screen goes off and stays off.
>
> Try adding a sleep for 1 or 2 seconds before the standby.  See below.


> If the screen is off and I want to turn it on, that works fine. No need
> to press it twice. The problem only occurs when trying to turn the
> screen off.
>
> Actually, you may not need to press _that_ button.  Any keyboard or mouse
press will take the monitor out of standby (but not restore the volume
unfortunately).

>
> #!/bin/bash
>
> VOLUME=$(aumix -vq | awk '{ print $3 }' )
> MONITOR=$( xset -q | grep Monitor | awk ' { print $3 $4 } ' )
>
> case "$MONITOR" in
> "On")
>
   sleep 2

> xset dpms force standby
> if [ "$VOLUME" != "0" ] ; then
> mute
> fi
> ;;
> *)
> xset dpms force on
> if [ "$VOLUME" == "0" ] ; then
> mute # unmute actually, but it is the same script.
> fi
> ;;
> esac


Be patient for the one or two seconds.

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20110117/8152afa6/attachment.htm>


More information about the mythtv-users mailing list