[arch-general] 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
#!/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.
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
participants (2)
-
Lukas Grässlin
-
Nicolas Bigaouette