summaryrefslogtreecommitdiff
path: root/pm/sleep.d/55battery
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2008-01-26 18:06:26 +0000
committerRichard Hughes <richard@hughsie.com>2008-01-26 18:06:26 +0000
commitde1ace906a3c99b01996b7a0e8dfabcabf0262c9 (patch)
tree505d9702a4f38c0dafced0157307ae67b0e7f736 /pm/sleep.d/55battery
parent67645abd5351105a1d18f8615e789c4234e0d480 (diff)
rename hooks into sleep.d -- this is something we have wanted to
do for a long time, but CVS made it hard
Diffstat (limited to 'pm/sleep.d/55battery')
-rwxr-xr-xpm/sleep.d/55battery22
1 files changed, 22 insertions, 0 deletions
diff --git a/pm/sleep.d/55battery b/pm/sleep.d/55battery
new file mode 100755
index 0000000..1d07559
--- /dev/null
+++ b/pm/sleep.d/55battery
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+. /usr/lib/pm-utils/functions
+
+resume_batteries()
+{
+ for x in $(hal-find-by-capability --capability battery 2>/dev/null); do
+# hal-set-property --udi "$x" --key battery.present --bool false
+# dbus-send --print-reply --system --reply-timeout=2000 \
+# --dest=org.freedesktop.Hal $x \
+# org.freedesktop.Hal.Device.Reprobe string:$x
+ dbus-send --print-reply --system --reply-timeout=2000 \
+ --dest=org.freedesktop.Hal $x \
+ org.freedesktop.Hal.Device.Rescan string:$x
+ done
+}
+
+case "$1" in
+ resume|thaw)
+ resume_batteries
+ ;;
+esac