Adventures in Ubuntu Land: Turn off the laptop monitor
One thing that really bothered me from day one with Odin was that the monitor refused to turn off all the way, the screensaver and/ or the X server did blanked the screen after a period on inactivity, but never did actually turned off the backlight.
For what I have Googled, it is a known and very, very frustrating thing to happen, because, obviously, it lessens the useful life of the laptop's LCD.
Some of the links I found on Google, while researching this problem:
- Force Monitor Turn On When You Open the Lid
- A Primer on Screen Blanking Under Xorg
- DPMS using vbetool
Unfortunately, none of the solutions I found (not only on the links above) worked fine, they did turned off the monitor, but I wasn't able to turn it on again. The only way to get the laptop useful once again was doing a hard reboot.
Besides, most of the references I found, where related to having problems with the monitor not turning off when the lid was closed, and I wasn't looking for a solution to that problem, what I wanted was to be able to leave all the programs running, and simply turn off the monitor, closing the lid scares me because of the heat, if I closed the lid on any laptop, it is because it will be hibernated in a few seconds.
On many of the links, they mention the script 'sleep.sh'. which is located on '/etc/acpi/sleep.sh', decided to take a look at it, that script, invokes (among many other things) another set of interesting scripts, located on the '/etc/acpi/suspend.d/' directory; in there, there was one that caught my attention: '80-video-vesa-state.sh'.
On it, I saw that there is a way of saving the video status to a file, and then re-read that status file, when the vbetool is executed again to "wake up" the monitor.
Here is the script I wrote, in case someone finds this useful:
#!/bin/sh
VBE="/usr/sbin/vbetool"
STATUS_FILE="/tmp/vbetool.tmp"
## Bring the monitor down
${VBE} vbestate save > ${STATUS_FILE}
${VBE} dpms off
## ------ BEGIN Loop ------ ##
while true;
do
sleep 1;
done
## ------- END Loop ------- ##
## Bring the monitor up
${VBE} post
${VBE} vbestate restore < ${STATUS_FILE}
${VBE} dpms on
# EoF #
This script will keep running, with the monitor turned off, until you type Ctrl + C to interrupt it; it is convenient to execute this script not from a Terminal running X Window, but to switch to a virtual console, login, and issue it there.
For what I have Googled, it is a known and very, very frustrating thing to happen, because, obviously, it lessens the useful life of the laptop's LCD.
Some of the links I found on Google, while researching this problem:
- Force Monitor Turn On When You Open the Lid
- A Primer on Screen Blanking Under Xorg
- DPMS using vbetool
Unfortunately, none of the solutions I found (not only on the links above) worked fine, they did turned off the monitor, but I wasn't able to turn it on again. The only way to get the laptop useful once again was doing a hard reboot.
Besides, most of the references I found, where related to having problems with the monitor not turning off when the lid was closed, and I wasn't looking for a solution to that problem, what I wanted was to be able to leave all the programs running, and simply turn off the monitor, closing the lid scares me because of the heat, if I closed the lid on any laptop, it is because it will be hibernated in a few seconds.
On many of the links, they mention the script 'sleep.sh'. which is located on '/etc/acpi/sleep.sh', decided to take a look at it, that script, invokes (among many other things) another set of interesting scripts, located on the '/etc/acpi/suspend.d/' directory; in there, there was one that caught my attention: '80-video-vesa-state.sh'.
On it, I saw that there is a way of saving the video status to a file, and then re-read that status file, when the vbetool is executed again to "wake up" the monitor.
Here is the script I wrote, in case someone finds this useful:
#!/bin/sh
VBE="/usr/sbin/vbetool"
STATUS_FILE="/tmp/vbetool.tmp"
## Bring the monitor down
${VBE} vbestate save > ${STATUS_FILE}
${VBE} dpms off
## ------ BEGIN Loop ------ ##
while true;
do
sleep 1;
done
## ------- END Loop ------- ##
## Bring the monitor up
${VBE} post
${VBE} vbestate restore < ${STATUS_FILE}
${VBE} dpms on
# EoF #
This script will keep running, with the monitor turned off, until you type Ctrl + C to interrupt it; it is convenient to execute this script not from a Terminal running X Window, but to switch to a virtual console, login, and issue it there.
Labels: Compaq Presario 1200, Scripts, Ubuntu
6 Comments:
Hey - thanks for posting this. I issued it from a virtual terminal and I couldn't cancel it with Control-C, but switching back to X windows (Control-F7) brought my screen back on. I've got an Acer laptop, running Hardy.
hey, don't mention it.
I'm glad it was useful to someone.
I find it strange that you couldn't stop it, tho.
hey thanks a lot. exactly what i was looking for.
Don't mention it, Yugan.
I'm glad it is useful to someone.
If I might ask, on what type of hardware are you running Linux (Ubuntu?) that you need to use this?
Reason I'm asking is because ever since I moved my Ubuntu to the Compaq F700 I did not had to use this script anymore.
Thanks!
hello
sorry but how does one use the script?
Copy the script, paste it to a text editor, and save it as a text file.
Then execute:
chmod +x script_file
Where 'script_file' is the name that you gave it.
Then you simply execute like this:
./script_file ENTER
From a Terminal.
If I might ask, what type of hardware and what version of Ubuntu are you running? I haven't had to use this solution in a loonnng time with Ubuntu.
Post a Comment
<< Home