FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 09-16-2010, 09:15 AM
Lukas Grässlin
 
Default There's no need for acpid

Hi there,

I discussed with someone else in an IRC channel that actually I have to
use acpid for laptop-mode-tools if I want to have settings changed when
I plug in AC.

Well, actually there is no need of acpid for this. A simply shell script
can do the same:

#!/bin/bash

while read event; do
case "$event" in
ac_adapter*)
/usr/sbin/laptop_mode auto > /dev/null 2>&1
;;
esac
done < /proc/acpi/event

So I put this script unter /usr/sbin (or something else, whatever) and
start it in laptop-mode-tools initscript. Works perfectly and so I don't
need acpid just for this little thing.

Anyway isn't acpid a bit much for such simple things? I thought maybe
somene else could find this useful, so I post this to you

Regards,
Lukas

--
Lukas Grässlin

Collax GmbH . Basler Str. 115a . 79115 Freiburg . Germany

p: +49 (0) 89-990 157-23

Collax - Flexible IT.

Geschäftsführer: Bernd Bönte, Boris Nalbach
Amtsgericht München, HRB 173695
USt-ID: DE270819312
 
Old 09-17-2010, 07:14 PM
Nicolas Bigaouette
 
Default There's no need for acpid

>
> #!/bin/bash
>
> while read event; do
> case "$event" in
> ac_adapter*)
> /usr/sbin/laptop_mode auto > /dev/null 2>&1
> ;;
> esac
> done < /proc/acpi/event
>
> Just a question, does the read event in the loop blocks? I guess so, right?
That's interesting.
 
Old 09-19-2010, 11:10 AM
Lukas Grässlin
 
Default There's no need for acpid

On Fri, Sep 17, 2010 at 03:14:33PM -0400, Nicolas Bigaouette wrote:
> >
> > #!/bin/bash
> >
> > while read event; do
> > case "$event" in
> > ac_adapter*)
> > /usr/sbin/laptop_mode auto > /dev/null 2>&1
> > ;;
> > esac
> > done < /proc/acpi/event
> >
> > Just a question, does the read event in the loop blocks? I guess so, right?
> That's interesting.

Yes it does. There's no waste of cpu or something else.

--
Lukas Grässlin
GnuPG-Key: http://lg.ath.cx/lukasgraesslin@gmx.de.asc
 

Thread Tools




All times are GMT. The time now is 07:58 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org