I would like to create a script similar to what is suggested in this thread.
Does anyone know what it should look like, and where I should put it?
To address excessive load cycling I followed the guide on the Ubuntu Wiki.
I would like to create a script similar to what is suggested in this thread.
Does anyone know what it should look like, and where I should put it?
To address excessive load cycling I followed the guide on the Ubuntu Wiki.
Last edited by AbtZ; August 11th, 2008 at 07:02 AM. Reason: created proper thread title
Well, that's what you get for posting when you really should be sleeping. The thread title is stupid and totally misleading; the "doesnt" shouldn't be in it.
In any case, I managed to solve the problem myself. I created a scriptwith the codeCode:sudo gedit /etc/pm/sleep.d/10laptopmoderestart
Then I made it executable withCode:#!/bin/bash case $1 in hibernate) /etc/init.d/laptop-mode stop ;; suspend) /etc/init.d/laptop-mode stop ;; thaw) /etc/init.d/laptop-mode start ;; resume) /etc/init.d/laptop-mode start ;; *) echo Something is not right. ;; esac
Done! laptop mode works as intended, and restarts after resuming from suspend/hibernateCode:sudo chmod +x /etc/pm/sleep.d/10laptopmoderestart![]()
Hi!
I don't know much about writing scripts. Could someone explain what is the purpose of "case $1" and "esac" in this script?
Kaur
It is a way to avoid nested "if" statements. "case" is the beginning of such a switch, "esac" signifies its end.
For more info: http://tldp.org/LDP/Bash-Beginners-G...ect_07_03.html
Hi!
Ok, thanks for the information.
K
Nope. Thanks for the tip, but on my HP laptop, this does not work...
I did this on Hardy. Maybe it works differently in Intrepid?
shouldn't there be a - in the filename? Like this 10-laptopmoderestart.
Don't think it matters. The numbers in the names are just to make the scripts execute in a certain order.
I know, but I thought that maybe the system gets confused if the number isn't separated in any way. You're probably right though, that it doesn't matter.Originally Posted by AbtZ
Bookmarks