Bash Script to fix not resuming from Stand By on Ubuntu?

1

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:

#!/bin/sh

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

Which I placed in a folder called: /etc/acpi/local/ and titled the script lid.sh.pre, 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.

Kredns

Posted 2009-10-19T23:05:00.623

Reputation: 2 857

have you tried moving the script to /etc/acpi/resume.d/50-turn-on-backlight.sh as Ryan suggested in his edit? – quack quixote – 2009-12-05T19:05:47.507

Yes and it still didn't work. – Kredns – 2009-12-11T17:19:03.330

Made sure the script is executable? (chmod +x) – Ryan C. Thompson – 2009-12-14T23:00:42.843

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 C. Thompson – 2009-12-14T23:01:26.303

@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? – Kredns – 2009-12-16T01:06:45.363

Answers

3

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

http://ubuntuforums.org/showthread.php?t=358432

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/lid.sh.pre, you should put it in /etc/acpi/resume.d/50-turn-on-backlight.sh 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.)

Ryan C. Thompson

Posted 2009-10-19T23:05:00.623

Reputation: 10 085

I've tried what the post says, but it's not working. Read my updated question. – Kredns – 2009-10-20T16:23:49.940

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 C. Thompson – 2009-10-21T05:34:28.103

I tried what your update says and it is still not working. – Kredns – 2009-12-11T17:19:44.453