[Pm-utils] [Patch] get quirk info from hal, add option to show used quirks, minor improvements

Till Maas opensource at till.name
Thu Aug 30 12:11:10 PDT 2007


attached is a patch with the main purpose to add an option "--hal-quirks" to 
make pm-action get the quirk information via hal. Also it adds an 
option "--show-quirks" that shows the values of the quirk variables. The 
patch also moves the check whether root invokes pm-action to a point after 
processing the options, to make it possible for non root users to get the 
help or to get a list of the used quirks without accidently suspending the 
machine. Last but not least there are two changes to the help text, one 
substitutes pm-action with the actual name it was invoked and the other
-       echo "Possible actions are:"
+       echo "Possible options are:"

makes it a consistent with the first line:
+       echo "$(basename "$0") [options]"

The next improvement would be to remove the redundancy of the list of possible 
quirks, they are now hardcoded in the help text, twice in the option 
processing and once each in the hal-quirks and the show-quirks option 

The best way to change this would be imho to have an array with all possible 
quirks (dpms_on dpms_suspend radeon_off reset_brightness s3_bios s3_mode 
vbe_post vbemode_restore vbestate_restore vga_mode3) and a function that 
returns the resulting variable name and use these in pm-action. To make it 
easier to code, it would be nice when the syntax could be changed, so that 
options follow this pattern:

because currently only in the options the use "-" instead of "_".

I can provide a patch for this, too, but I want to start slowly with 
submitting patches.


Btw. In case it is neccessary: My contributions may be licensed with GPLv2 or 
any later version, if you want to change the license of pm-utils somewhere in 
the future.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pm-utils-pm_action-use-hal.patch
Type: text/x-diff
Size: 2389 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/pm-utils/attachments/20070830/79fb24c9/attachment.patch 

More information about the Pm-utils mailing list