summaryrefslogtreecommitdiff
path: root/pm/sleep.d/55battery
blob: 680cee48cf9fdc64c1d7e634a7f1b63856565eee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

. /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