Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Ubuntu 9.04 on a Compaq Presario V5000 (piece of crap) and when I try to resume from standby, it's forgetting to turn my screen back on. I found a bash script somewhere a long time ago that actually fixed this problem, but I can't remember where.

So I was wondering if you guys could point me in the right direction or maybe show me how to write a quick bash script to do this.

Update: I have tried the following script:


grep -q open /proc/acpi/button/lid/*/state
if [ $? = 0 ]
    # lid is open; turn on the screen
    radeontool light on

Which I placed in a folder called: /etc/acpi/local/ and titled the script, but it doesn't seem to get called after standby. If I just type:

lucas@ubuntu:~$ radeontool light off
lucas@ubuntu:~$ radeontool light on

It will turn my screen off, then back on. So I'm thinking that maybe my script isn't getting called.

share|improve this question
have you tried moving the script to /etc/acpi/resume.d/ as Ryan suggested in his edit? – quack quixote Dec 5 '09 at 19:05
Yes and it still didn't work. – Lucas McCoy Dec 11 '09 at 17:19
Made sure the script is executable? (chmod +x) – Ryan Thompson Dec 14 '09 at 23:00
Also, are you sure the computer is successfully resuming at all? Maybe the screen fails to come on because the computer isn't even resuming correctly. – Ryan Thompson Dec 14 '09 at 23:01
@Ryan: I made sure it was executable. Your second comment may actually be the problem. It doesn't look like the hard disk are spinning or anything. Do you know any remedies? – Lucas McCoy Dec 16 '09 at 1:06

Could you possibly be looking for this thread of mine from several years ago?

If not, a minor modification of that script will probably suffice. If you can't figure out the necessary adjustments, I'll edit my answer with more details.

EDIT: Ok, so you have a slightly different problem. You need this script to run on resume, not when the lid opens. To do that, instead of putting the script in /etc/acpi/, you should put it in /etc/acpi/resume.d/ and make sure it's executable. If you ever need a script to run on resume, put it in there and prefix it with a number, as shown. (The number simply determines the order in which the scripts are executed. That doesn't matter here, so we choose the default of 50.)

share|improve this answer
+1 good post, ryan – quack quixote Oct 20 '09 at 5:01
I've tried what the post says, but it's not working. Read my updated question. – Lucas McCoy Oct 20 '09 at 16:23
I've updated. You want the script to run when the computer resumes, not when the lid opens, so it goes in a different place. – Ryan Thompson Oct 21 '09 at 5:34
I tried what your update says and it is still not working. – Lucas McCoy Dec 11 '09 at 17:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .