summaryrefslogtreecommitdiff
path: root/pm/sleep.d/55battery
blob: 1d075591fa4c9da370354808fe7c663f11a07e70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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