hal: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Mon Dec 4 17:46:37 PST 2006
doc/spec/hal-spec-properties.xml | 10 ++++++++++
fdi/policy/10osvendor/10-power-mgmt-policy.fdi | 3 +++
tools/freebsd/hal-system-power-set-power-save-freebsd | 3 ++-
tools/hal-system-power-set-power-save | 8 +++++++-
tools/linux/hal-system-power-set-power-save-linux | 3 ++-
5 files changed, 24 insertions(+), 3 deletions(-)
New commits:
diff-tree d17ef57074fa9585456dc62da9aef983df84af60 (from 1ec650992778070c7724d14fa83a7f95450e9e0d)
Author: Kevin Ottens <ervin at kde.org>
Date: Mon Dec 4 20:46:32 2006 -0500
add property for power save state
Find attached a patch introducing a property to know if we're currently saving
power or not. We used to have only SetPowerSave method, now we can query HAL
to know if it was already set.
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 4ebe9fd..29c2aeb 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -5761,6 +5761,16 @@
should be used in its place. This key will be removed, but not before May 1st 2007.
</entry>
</row>
+ <row>
+ <entry>
+ <literal>power_management.is_powersave_set</literal> (bool)
+ </entry>
+ <entry/>
+ <entry>Yes</entry>
+ <entry>
+ Is the last value passed to the SetPowerSave method.
+ </entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
diff --git a/fdi/policy/10osvendor/10-power-mgmt-policy.fdi b/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
index 2c2705a..cd16cee 100644
--- a/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
+++ b/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
@@ -50,6 +50,9 @@
<append key="org.freedesktop.Hal.Device.SystemPowerManagement.method_signatures" type="strlist">b</append>
<append key="org.freedesktop.Hal.Device.SystemPowerManagement.method_argnames" type="strlist">enable_power_save</append>
<append key="org.freedesktop.Hal.Device.SystemPowerManagement.method_execpaths" type="strlist">hal-system-power-set-power-save</append>
+
+ <!-- Consider that we're not saving power at startup -->
+ <append key="power_management.is_powersave_set" type="boolean">false</append>
</match>
</device>
diff --git a/tools/freebsd/hal-system-power-set-power-save-freebsd b/tools/freebsd/hal-system-power-set-power-save-freebsd
index afcc312..6258f02 100755
--- a/tools/freebsd/hal-system-power-set-power-save-freebsd
+++ b/tools/freebsd/hal-system-power-set-power-save-freebsd
@@ -1,5 +1,6 @@
#!/bin/sh
-read value
+
+value=$1
unsupported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
diff --git a/tools/hal-system-power-set-power-save b/tools/hal-system-power-set-power-save
index 298f7aa..c933d77 100755
--- a/tools/hal-system-power-set-power-save
+++ b/tools/hal-system-power-set-power-save
@@ -1,7 +1,13 @@
#!/bin/sh
+read value
+
if [ -n "$HALD_UNAME_S" -a -x ./$HALD_UNAME_S/hal-system-power-set-power-save-$HALD_UNAME_S ]; then
- exec ./$HALD_UNAME_S/hal-system-power-set-power-save-$HALD_UNAME_S $@
+ ./$HALD_UNAME_S/hal-system-power-set-power-save-$HALD_UNAME_S $value
+ if [ "x$?" == "x0" ]; then
+ hal-set-property --udi $HAL_PROP_INFO_UDI \
+ --key "power_management.is_powersave_set" --bool "$value"
+ fi
else
echo "org.freedesktop.Hal.Device.UnknownError" >&2
echo "No back-end for your operating system" >&2
diff --git a/tools/linux/hal-system-power-set-power-save-linux b/tools/linux/hal-system-power-set-power-save-linux
index 303eaf2..6a29344 100755
--- a/tools/linux/hal-system-power-set-power-save-linux
+++ b/tools/linux/hal-system-power-set-power-save-linux
@@ -1,5 +1,6 @@
#!/bin/sh
-read value
+
+value=$1
unsupported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
More information about the hal-commit
mailing list