[gpm] LED blinking hooks



Two small scripts are attached to this message. I place these in the "/etc/pm/hooks" directory on my ThinkPad X40. They cause my laptop's crescent moon LED status light to blink during preparation for suspend and recovery after waking back up again. I like them as a nice indicator that things are in progress.

Gripe: the unfortunate names are necessary because pm-utils already installs hook scripts named "00NetworkManager" and "99clock". This makes it difficult to have other scripts that go before the former (or after the later) while still using only two leading digits. IMHO, pm-utils should use less extremal numbers for these two scripts.

Caveat: LED 7 is the sleep (crescent moon) LED on my ThinkPad X40. It may not be the same LED on your laptop, especially if you are not using a ThinkPad X40. I doubt that there's any risk of *damaging* your laptop by asking it to blink LED 7, but laptops are fickle creatures.
#!/bin/sh

exec >/dev/null 2>&1

case "$1" in
  suspend) echo 7 blink >/proc/acpi/ibm/led ;;
  resume)  echo 7 off   >/proc/acpi/ibm/led ;;
esac

exit 0
#!/bin/sh

exec >/dev/null 2>&1

case "$1" in
  suspend) : ;;
  resume)  echo 7 blink >/proc/acpi/ibm/led ;;
esac

exit 0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]