Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a little shell script that I run automatically when I log on to my Ubuntu machine; it will set the parameters of my touchpad the way I like it. However, when Ubuntu wakes up after being hibernated or suspended, my touchpad reverts to its default state and I have to run my little script again.

Is there some way I can automate this process thus that the script will be magically called when the machine wakes up again?

share|improve this question

1 Answer 1

up vote 13 down vote accepted

First of all, you have found a bug. The user is not supposed to bother with the touchpad configuration being lost after resume. You go to Launchpad and report this bug, so that it can be properly identified and fixed.

Then, after that, go to /etc/pm/sleep.d/ and add a script that will be executed before and after suspending or hibernating. The script receives a single command-line parameter "suspend", "resume", "hibernate" or "thaw", it should inspect this argument and take the appropriate action. There should be at least one other script in that directory (99laptop-mode) that you can use as a reference.

share|improve this answer
    
I did create the script and I made sure that it is being run. But it doesn't seem to have any effect. I guess this is due to that bug, though. –  innaM Oct 25 '09 at 20:59
3  
Perhaps, the touchpad is reinitialized after the resume scripts are run... losing its configuration. –  Juliano Oct 25 '09 at 21:59
    
Here's a complete example of the script: ubutnuforums. –  Adobe Jun 12 '12 at 12:39
    
I'd like to add that this facilities are documented in man pm-action which, btw, says that the user supplied scripts should be named 00 - 49. –  mnicky Nov 20 '13 at 16:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.