hazica
November 10th, 2007, 01:32 AM
Hello.
I configured my infra-red remote control to power off my monitor using this little script I found somewhere
#!/bin/bash
STATUS=`xset -q | grep "Monitor is" | awk '{print $3}'`
if [ "${STATUS}" = "On" ]
then
xset dpms force off
else
xset dpms force on
fi
exit 0
It works just swell if I want to turn the monitor off . If I press the power button on my remote again, the monitor turns on (it returns from sleep mode) but remains blank. In order to see my desktop again, I have to either move the mouse or press a key on the keyboard.
So I was thinking of writing a script that automatically moves the mouse just a tiny little bit and running this script right after xset dpms force on, in the else branch. The problem is that I am clueless when it comes to writing scripts that simulate mouse movements.
Bottom line: I'm either looking for a script that can move the mouse or some alternative(less goofy) solution to my problem.
I'd appreciate your help.
Thanks.
I configured my infra-red remote control to power off my monitor using this little script I found somewhere
#!/bin/bash
STATUS=`xset -q | grep "Monitor is" | awk '{print $3}'`
if [ "${STATUS}" = "On" ]
then
xset dpms force off
else
xset dpms force on
fi
exit 0
It works just swell if I want to turn the monitor off . If I press the power button on my remote again, the monitor turns on (it returns from sleep mode) but remains blank. In order to see my desktop again, I have to either move the mouse or press a key on the keyboard.
So I was thinking of writing a script that automatically moves the mouse just a tiny little bit and running this script right after xset dpms force on, in the else branch. The problem is that I am clueless when it comes to writing scripts that simulate mouse movements.
Bottom line: I'm either looking for a script that can move the mouse or some alternative(less goofy) solution to my problem.
I'd appreciate your help.
Thanks.