[Pm-utils] pm-utils' 55battery: WTF?

Stefan Seyfried seife at suse.de
Tue Mar 13 11:35:50 PDT 2007


Hi,

i just noticed that another strange hook has crept into pm-utils.

55battery:
-----------
#!/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
-----------

so what does this monster do? Why is this needed? It stealy me half a second
of resume time, so it'd better be worth it ;-)

If somebody can convince me that it is really needed, then it needs at least
a comment telling why this is the case.
-- 
Stefan Seyfried

"Any ideas, John?"
"Well, surrounding them's out." 


More information about the Pm-utils mailing list