summaryrefslogtreecommitdiff
path: root/pm/sleep.d/55battery
blob: f41e4afdd66a84e8292f3e51ac9f578614c31b94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# Have HAL rescan batteries on resume.
# TODO: Merge this code back into HAL, it should not be in pm-utils.

. "${PM_FUNCTIONS}"

resume_batteries()
{
	for x in $(hal-find-by-capability --capability battery 2>/dev/null); do
		dbus_send --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