diff options
author | Victor Lowther <victor.lowther@gmail.com> | 2009-11-30 22:42:39 -0600 |
---|---|---|
committer | Victor Lowther <victor.lowther@gmail.com> | 2009-11-30 22:42:39 -0600 |
commit | 557b67691b14c580e57cdefbf9faf2852c1e6c77 (patch) | |
tree | 44a7e7e7b4bc74c79c3d24021d89845ebbf523b3 | |
parent | 8b08ffdb3cf8ecce10309d7149474797832631d2 (diff) | |
parent | f323e2cf2eddd683721be4eadbdc82f0454e7190 (diff) |
Merge branch 'master' into native-quirk-db
Conflicts:
pm/sleep.d/98smart-kernel-video
98smart-kernel-video no longer exists, but we want the other fixups in the
master branch.
-rw-r--r-- | man/pm-action.xml | 4 | ||||
-rw-r--r-- | man/pm-is-supported.xml | 7 | ||||
-rw-r--r-- | pm/pm-functions.in | 6 | ||||
-rwxr-xr-x | src/on_ac_power | 9 |
4 files changed, 17 insertions, 9 deletions
diff --git a/man/pm-action.xml b/man/pm-action.xml index cf03d38..2bde946 100644 --- a/man/pm-action.xml +++ b/man/pm-action.xml @@ -110,8 +110,8 @@ For some options external programs are needed. </para> <para> - These commands will usually be called by - <command>hald</command> when triggered to do so by a program + These commands will usually be called by <command>DeviceKit-power</command> + or <command>hald</command> when triggered to do so by a program in a desktop session such as <command>gnome-power-manager</command>. Calling them from the command line is also possible, but it is not guaranteed that all programs in your desktop session keep working diff --git a/man/pm-is-supported.xml b/man/pm-is-supported.xml index 2e1ee7e..1d52524 100644 --- a/man/pm-is-supported.xml +++ b/man/pm-is-supported.xml @@ -89,7 +89,8 @@ <para> The intended purpose of <command>&dhpackage;</command> is to find out which power management modes are supported by the - system. hald(8) will call it to do just that. + system. hald(8) will call it to do just that. (Note that DeviceKit-power + does not use this.) </para> </refsect1> @@ -160,6 +161,10 @@ <!-- In alpabetical order. --> <para> <citerefentry> + <refentrytitle>DeviceKit-power</refentrytitle> + <manvolnum>7</manvolnum> + </citerefentry>, + <citerefentry> <refentrytitle>hald</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>, diff --git a/pm/pm-functions.in b/pm/pm-functions.in index 3320f0d..36f9e34 100644 --- a/pm/pm-functions.in +++ b/pm/pm-functions.in @@ -81,12 +81,6 @@ done . "${PM_FUNCTIONS}" -if command_exists hal-get-property; then - export CHASSIS_TYPE="$(hal-get-property --udi /org/freedesktop/Hal/devices/computer --key system.chassis.type 2>/dev/null || echo Unknown)" -else - export CHASSIS_TYPE=Unknown -fi - # Simple little logging function. # We do it this way because 'echo -n' is not posix. log() diff --git a/src/on_ac_power b/src/on_ac_power index edddf72..3a77734 100755 --- a/src/on_ac_power +++ b/src/on_ac_power @@ -30,6 +30,15 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# prefer DeviceKit-power if available +if s=`dbus-send --system --print-reply --dest=org.freedesktop.DeviceKit.Power /org/freedesktop/DeviceKit/Power org.freedesktop.DBus.Properties.Get string:org.freedesktop.DeviceKit.Power string:OnBattery`; then + if echo "$s" | grep -q 'boolean false'; then + exit 0 + else + exit 1 + fi +fi + # Check for AC/DC/etc adapters ac_adapters="$(hal-find-by-capability --capability ac_adapter)" |