Discussion:
how to wake up sleeping monitor using batch script/command
Antonio Olivares
2010-12-25 22:37:51 UTC
Permalink
Dear folks,

I have a Flat Panel Monitor with built in speakers. If the monitor is on(not sleeping), the speakers work. When the Monitor goes to sleep, the speakers no longer work :(, I have a cron job that plays music in the morning, but since the monitor is sleeping the music does not play :(

I tried adding a command to wake up the monitor like
48 04 * * 1-5 sleep 2; xset dpms force on > /dev/null 2&>1

but the monitor does not wake up :(, I tried using variations like
xset -dpms

and

xset +dpms

and force on, force off to no avail. I sent a message to list, on how the crontab job was set and the script itself, but it has not made it to list, or was deleted? If you get a double post, please accept my apologies in advance, don't know how to blame, users* list or yahoo mail^{1}.

Regards,


Antonio

{1} yes poc and others, yahoo mail sucks, but being on it for a great while makes it hard to be apart from it :(, I go back to classic profile when using linux, since on windblows, the new yahoo mail does not do a good job of quoting and throws message replies to /dev/null in many cases, and threading sucks like Rahul says :)
Ed Greshko
2010-12-25 23:51:42 UTC
Permalink
Post by Antonio Olivares
I have a Flat Panel Monitor with built in speakers. If the monitor is on(not sleeping), the speakers work. When the Monitor goes to sleep, the speakers no longer work :(, I have a cron job that plays music in the morning, but since the monitor is sleeping the music does not play :(
I tried adding a command to wake up the monitor like
48 04 * * 1-5 sleep 2; xset dpms force on > /dev/null 2&>1
but the monitor does not wake up :(, I tried using variations like
xset -dpms
and
xset +dpms
and force on, force off to no avail. I sent a message to list, on how the crontab job was set and the script itself, but it has not made it to list, or was deleted? If you get a double post, please accept my apologies in advance, don't know how to blame, users* list or yahoo mail^{1}.
Install the xdotool package (available on F11...not sure if F14 has it)
and then use one of the commands to move the mouse.
--
"You boys lookin' for trouble?" "Sure. Whaddya got?" -- Marlon Brando,
"The Wild Ones" ??? ??? / ????????

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20101226/87264cd8/attachment.bin
JB
2010-12-26 00:24:33 UTC
Permalink
...
Would that do the trick ?

man xrandr
Per-output options

xrandr --output ... --auto

JB
Ed Greshko
2010-12-26 00:34:39 UTC
Permalink
Post by JB
Would that do the trick ?
man xrandr
Per-output options
xrandr --output ... --auto
FWIW....

xset dpms force off ; sleep 20 ; xrandr --output ... --auto

fails to turn on my screen. When you test it in your environment, it works?
--
We are currently trying a new concept of using a live mouse.
Unfortuantely, one has yet to survive being hooked up to the
computer.....please bear with us. ??? ??? / ????????

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20101226/c51c56d9/attachment.bin
JB
2010-12-26 01:13:36 UTC
Permalink
Post by Ed Greshko
...
xset dpms force off ; sleep 20 ; xrandr --output ... --auto
fails to turn on my screen. When you test it in your environment, it works?
On my notebook it works, but it takes 1 min plus.

JB
Antonio Olivares
2010-12-26 00:57:41 UTC
Permalink
From: Ed Greshko <Ed.Greshko at greshko.com>
Subject: Re: how to wake up sleeping monitor using batch script/command
To: users at lists.fedoraproject.org
Date: Saturday, December 25, 2010, 4:34 PM
Post by JB
Would that do the trick ?
man xrandr
Per-output options
xrandr --output ... --auto
FWIW....
xset dpms force off ; sleep 20 ; xrandr --output ...
--auto
fails to turn on my screen.? When you test it in your
environment, it works?
--
sleep 20; xset dpms force off ;

turns the monitor off, maybe turn on? I will try it and report back.
Thanks for helping Ed & JB.

Regards,

Antonio
JB
2010-12-26 02:00:04 UTC
Permalink
Post by Antonio Olivares
...
I tried adding a command to wake up the monitor like
48 04 * * 1-5 sleep 2; xset dpms force on > /dev/null 2&>1
...
Some observations when done on a command line.
- the screen does not come up when
$ xset dpms force off ; sleep 10 ; xset dpms force on > /dev/null 2&>1
- the screen DOES come up after 10s when
$ xset dpms force off ; sleep 10 ; xset dpms force on

JB
Ed Greshko
2010-12-26 02:05:17 UTC
Permalink
Post by JB
Some observations when done on a command line.
- the screen does not come up when
$ xset dpms force off ; sleep 10 ; xset dpms force on > /dev/null 2&>1
- the screen DOES come up after 10s when
$ xset dpms force off ; sleep 10 ; xset dpms force on
Neither of these incantations will turn my screen on....

xset dpms force off ; sleep 10 ; xdotool mousemove_relative 1 1

works fine...
--
No group of professionals meets except to conspire against the public at
large. -- Mark Twain ??? ??? / ????????

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20101226/6ac12ed4/attachment.bin
JB
2010-12-26 02:12:34 UTC
Permalink
Post by Ed Greshko
Neither of these incantations will turn my screen on....
xset dpms force off ; sleep 10 ; xdotool mousemove_relative 1 1
works fine...
There is a possibility that BIOS / monitor / APM settings make a difference.

JB
Ed Greshko
2010-12-26 02:21:13 UTC
Permalink
Post by JB
There is a possibility that BIOS / monitor / APM settings make a difference.
Which would not be a problem with xdotool and which is why I feel that
would be the preferred "universal" solution.
--
The only certainty is that nothing is certain. -- Pliny the Elder ???
??? / ????????
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20101226/9dfe2e5e/attachment.bin
James McKenzie
2010-12-26 02:07:09 UTC
Permalink
Post by JB
Post by Antonio Olivares
...
I tried adding a command to wake up the monitor like
48 04 * * 1-5 sleep 2; xset dpms force on> /dev/null 2&>1
...
Some observations when done on a command line.
- the screen does not come up when
$ xset dpms force off ; sleep 10 ; xset dpms force on> /dev/null 2&>1
- the screen DOES come up after 10s when
$ xset dpms force off ; sleep 10 ; xset dpms force on
You know I say "Doc it hurts when I do this."
My doctor says "Don't do that."

It looks like the redirects are causing the command to not work
properly, so don't use them.

James McKenzie
JB
2010-12-26 02:35:15 UTC
Permalink
Post by James McKenzie
...
You know I say "Doc it hurts when I do this."
My doctor says "Don't do that."
It looks like the redirects are causing the command to not work
properly, so don't use them.
James McKenzie
Now the hard part may be to send Antonio to that doctor :-)

JB
James McKenzie
2010-12-26 03:26:48 UTC
Permalink
Post by JB
Post by James McKenzie
...
You know I say "Doc it hurts when I do this."
My doctor says "Don't do that."
It looks like the redirects are causing the command to not work
properly, so don't use them.
James McKenzie
Now the hard part may be to send Antonio to that doctor :-)
Nah, just send the monitor.

BTW, it is quite interesting what does work and what does not. Should
prove interesting once I get Linux installing on that creaking ancient
machine.

James McKenzie
Antonio Olivares
2010-12-26 03:24:07 UTC
Permalink
From: Ed Greshko <Ed.Greshko at greshko.com>
Subject: Re: how to wake up sleeping monitor using batch script/command
To: "Community support for Fedora users" <users at lists.fedoraproject.org>
Date: Saturday, December 25, 2010, 6:05 PM
Post by JB
Some observations when done on a command line.
- the screen does not come up when
???$ xset dpms force off ; sleep 10 ;
xset dpms force on > /dev/null 2&>1
Post by JB
- the screen DOES come up after 10s when
???$ xset dpms force off ; sleep 10 ;
xset dpms force on
Neither of these incantations will turn my screen on....
xset dpms force off ; sleep 10 ; xdotool mousemove_relative
1 1
works fine...
--
$ xset dpms force off ; sleep 10 ; xset dpms force on

works from cli, but does not when called from the script :(,

@James & JB
the redirection > /dev/null 2>&1

is to avoid having shitloads of mail by th mailer :)
Will report back if I can get it to work, otherwise I will have to get Ed's solution.

Thanks for helping out.

Regards,

Antonio
Ed Greshko
2010-12-26 03:27:12 UTC
Permalink
Post by Antonio Olivares
Will report back if I can get it to work, otherwise I will have to get Ed's solution.
I did finally fire up my F14 system and verified that xdotool is
available with F14.
--
The truth is what is; what should be is a dirty lie. -- Lenny Bruce ??
? ??? / ????????
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20101226/fb60538d/attachment.bin
James McKenzie
2010-12-26 03:42:43 UTC
Permalink
Post by JB
From: Ed Greshko<Ed.Greshko at greshko.com>
Subject: Re: how to wake up sleeping monitor using batch script/command
To: "Community support for Fedora users"<users at lists.fedoraproject.org>
Date: Saturday, December 25, 2010, 6:05 PM
Post by JB
Some observations when done on a command line.
- the screen does not come up when
$ xset dpms force off ; sleep 10 ;
xset dpms force on> /dev/null 2&>1
Post by JB
- the screen DOES come up after 10s when
$ xset dpms force off ; sleep 10 ;
xset dpms force on
Neither of these incantations will turn my screen on....
xset dpms force off ; sleep 10 ; xdotool mousemove_relative
1 1
works fine...
--
$ xset dpms force off ; sleep 10 ; xset dpms force on
works from cli, but does not when called from the script :(,
@James& JB
the redirection> /dev/null 2>&1
is to avoid having shitloads of mail by th mailer :)
Yep. However, does this work on the command line as well? It looked
like it did not on JBs machine.

James McKenzie
Ed Greshko
2010-12-26 03:45:35 UTC
Permalink
Post by Antonio Olivares
Will report back if I can get it to work, otherwise I will have to get Ed's solution.
Another FYI....

If you run this from a cron job you'll need to add "export DISPLAY=:0".
--
QOTD: "She's about as smart as bait." ??? ??? / ????????
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20101226/40e605f1/attachment.bin
Antonio Olivares
2010-12-26 04:06:53 UTC
Permalink
From: Ed Greshko <Ed.Greshko at greshko.com>
Subject: Re: how to wake up sleeping monitor using batch script/command
To: "Community support for Fedora users" <users at lists.fedoraproject.org>
Date: Saturday, December 25, 2010, 7:45 PM
On 12/26/2010 11:24 AM, Antonio
Post by Antonio Olivares
Will report back if I can get it to work, otherwise I
will have to get Ed's solution.
Another FYI....
If you run this from a cron job you'll need to add "export
DISPLAY=:0".
--
Will try to put into script. Do I put it before xset dpms force on; command or after? in case it is important.

Regards

Antonio
Ed Greshko
2010-12-26 04:40:57 UTC
Permalink
Post by Antonio Olivares
Will try to put into script. Do I put it before xset dpms force on; command or after? in case it is important.
needs to go before all other display related commands as it sets the
environment variable needed by all the commands related to the DISPLAY.

Yes, it is case sensitive.

Ed
--
Hedonist for hire... no job too easy! ??? ??? / ????????

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20101226/d1f94b6a/attachment.bin
Antonio Olivares
2010-12-26 05:03:54 UTC
Permalink
From: Ed Greshko <Ed.Greshko at greshko.com>
Subject: Re: how to wake up sleeping monitor using batch script/command
To: "Community support for Fedora users" <users at lists.fedoraproject.org>
Date: Saturday, December 25, 2010, 7:45 PM
On 12/26/2010 11:24 AM, Antonio
Post by Antonio Olivares
Will report back if I can get it to work, otherwise I
will have to get Ed's solution.
Another FYI....
If you run this from a cron job you'll need to add "export
DISPLAY=:0".
--
Awesome!!!

with export DISPLAY=:0, the screen wakes up & plays the music :)

#!/bin/sh

export DISPLAY=:0
/usr/bin/xset dpms force on;
/usr/bin/xterm -display :0 -bg white \
-e /usr/bin/mplayer --really-quiet -shuffle -playlist ~/.playlist -stop-xscreensaver & PID=$! > /dev/null 2>&1
sleep 1800
kill $PID
/usr/bin/xset +dpms

Thanks, Ed, JB, & James, could not have done it without your help!
Happy Holidays to all;

Regards,

Antonio
Suvayu Ali
2010-12-26 10:36:14 UTC
Permalink
Post by Antonio Olivares
/usr/bin/xterm -display :0 -bg white \
-e /usr/bin/mplayer --really-quiet -shuffle -playlist ~/.playlist -stop-xscreensaver& PID=$!> /dev/null 2>&1
This is rather strange and unnecessary. mplayer is perfectly capable of
playing audio without an xterm. You can replace all the xterm stuff by just,

/usr/bin/mplayer --really-quiet -shuffle -playlist ~/.playlist
-stop-xscreensaver
--
Suvayu

Open source is the future. It sets us free.
Ed Greshko
2010-12-26 12:18:58 UTC
Permalink
Post by Suvayu Ali
This is rather strange and unnecessary. mplayer is perfectly capable of
playing audio without an xterm. You can replace all the xterm stuff by just,
Go back and read the OP's email. His speakers are built in to his flat
panel display. What is happening is the speakers are being powered off
when the display is powered off by DPMS (Energy Star). Hence the need
to "wake it up".
--
Real computer scientists like having a computer on their desk, else how
could they read their mail? ??? ??? / ????????

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20101226/600058e4/attachment.bin
Antonio Olivares
2010-12-26 13:11:53 UTC
Permalink
From: Suvayu Ali <fatkasuvayu+linux at gmail.com>
Subject: Re: how to wake up sleeping monitor using batch script/command
To: users at lists.fedoraproject.org
Date: Sunday, December 26, 2010, 2:36 AM
On Saturday 25 December 2010 09:03
Post by Antonio Olivares
/usr/bin/xterm -display :0 -bg white \
-e /usr/bin/mplayer --really-quiet -shuffle -playlist
~/.playlist -stop-xscreensaver&? PID=$!>?
/dev/null 2>&1
This is rather strange and unnecessary. mplayer is
perfectly capable of
playing audio without an xterm. You can replace all the
xterm stuff by just,
/usr/bin/mplayer --really-quiet -shuffle -playlist
~/.playlist
-stop-xscreensaver
--
Yes, that was not the problem :(, the problem was for the monitor to wake up and play the music (monitor with built in speakers); still I like to have xterm to change songs, or o q(quit) faster :)

Regards,

Antonio
Suvayu Ali
2010-12-26 17:17:36 UTC
Permalink
Yes, that was not the problem:(, the problem was for the monitor to wake up and play the music (monitor with built in speakers); still I like to have xterm to change songs, or o q(quit) faster:)
Ah ok! Its a matter of convenience for you. :)
--
Suvayu

Open source is the future. It sets us free.
Loading...