Hi 
On below present one patch which make posible to set first args on pm-powersave 
allways true 
pm-powersave true-excl will be placed on /etc/rc.local .
--- a/src/pm-powersave.in
+++ b/src/pm-powersave.in
@@ -25,7 +25,7 @@
 #
 
 export STASHNAME=pm-powersave
-. "@PM-UTILS-LIBDIR@/pm-functions"
+. @PM-UTILS-LIBDIR@/pm-functions
 
 remove_powersave_lock() {
     release_lock "${STASHNAME}.lock"
@@ -66,18 +66,24 @@
 }
 
 _on_ac_power() {
+    if [ "$1" = "true-excl" ]; then
+	touch "${STORAGEDIR}/rtue-excl"
+	return 0
+    else
     on_ac_power
     case $? in
         # If on_ac_power can't determine AC power state (255), assume it's a desktop.
         0|255) return 0 ;;
         1) return 1 ;;
     esac
+    fi
 }
 
 case $1 in
     true|battery) lock_and_load && run_hooks power true;;
     false|ac) lock_and_load && run_hooks power false;;
     --help) help && run_hooks power help;;
+    true-excl) lock_and_load && _on_ac_power true-excl && run_hooks power false;;
     '') lock_and_load; _on_ac_power && run_hooks power false || run_hooks power true;;
     *) help && exit 1;;
 esac
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -245,8 +245,13 @@
 		elif [ -f "$phooks/$base" ]; then
 			hook="$phooks/$base"
 		fi
+		if [ -f "${STORAGEDIR}/true-excl" ]; then
+		run_hook "$hook" "true"
+		IFS="${nifs}"
+		else
 		run_hook "$hook" $2
 		IFS="${nifs}"
+		fi
 	done
 	IFS="${oifs}"
 	# return value is 1 if something was inhibited, 0 otherwise.

Reply via email to