Please, resume only when I want...

I have a laptop (a Toshiba one, a 13″ nice thing) which is running more or less happily with Ubuntu Karmic. Lot of good things but some very annoying behaviour sometime. One of them is the fact that it resumes automatically when opening the lid and the AC plug is in.

I don’t like it. A lot of time I open the lid, and push the power button, because in that moment I do not know if the laptop is on battery or not, with not-so-nice results. So… how to disable it?

Easy, but not so easy to dig out how. Firstly I got lost in the acpi/boot/event script tangle. Try to do a cd /etc/event.d and to disentangle it. There is an “ac” event that calls someway (not sure how) /etc/acpi/power.sh that call a pm-powersave script that has arguments no-idea-from where….

To make a long story short, I think that thanks  this thread on ubuntuforums I found the solution. I put this incantation:

grep 'LID.*enabled' < /proc/acpi/wakeup >/dev/null && echo " LID" > /proc/acpi/wakeup

in /etc/rc.local, and it seems to do the job. The idea is that I disable the LID wakeup event if it’s enabled.

Although I still do not know from where the different behavior in battery or AC mode come from. Tangled.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  


*