Doing remote support tasks, many times I need to change power settings for users as workaround for some known bugs.
I think that is more practical, instead to use the ui, copy-paste the new settings in the command line or using the options in a script.
I'm interested in working in this feature, or at least try it, but also want some comments/guidance before starting.
CLI
For the CLI options, I think that a command style is a good start.
Due to the large number of options it seems better to group them using the same groups that the UI uses in tabs.
Also, only one group of options are set by invocation.
The groups of options (names and values) were taken from the UI
(glade-previewer --filename data/gpm-prefs.ui) and an execution of mate-power-preferences.
The show command is added to list all the settings for mate-power-manager.
Without doubt the names/options are not the best but I think a starting point; maybe someone can suggest better names or ideas for they.
If an option does not apply, eg on-battery-power in a desktop PC, the behavior can be:
a. Ignore the setting doing nothing.
b. Set the setting, expecting that others MATE components ignores the setting if it does not apply.
Code
Some of the code to save the preferences is inside the UI code. Here two options:
a. Refactor the code to common functions, maybe a new module, for use in the UI and the CLI.
b. Duplicate the code (Copy/Paste) in a new CLI module.
I think that refactor is the best and elegant option, but maybe for a new contribution (and contributor) b. is a better approach. If the feature is finished and works, is feasible in a next step refactoring the common code.
Doing remote support tasks, many times I need to change power settings for users as workaround for some known bugs.
I think that is more practical, instead to use the ui, copy-paste the new settings in the command line or using the options in a script.
I'm interested in working in this feature, or at least try it, but also want some comments/guidance before starting.
CLI
For the CLI options, I think that a command style is a good start. Due to the large number of options it seems better to group them using the same groups that the UI uses in tabs. Also, only one group of options are set by invocation.
Here the command line options:
The groups of options (names and values) were taken from the UI (
glade-previewer --filename data/gpm-prefs.ui
) and an execution ofmate-power-preferences
.The
show
command is added to list all the settings for mate-power-manager.Without doubt the names/options are not the best but I think a starting point; maybe someone can suggest better names or ideas for they.
If an option does not apply, eg
on-battery-power
in a desktop PC, the behavior can be:a. Ignore the setting doing nothing. b. Set the setting, expecting that others MATE components ignores the setting if it does not apply.
Code
Some of the code to save the preferences is inside the UI code. Here two options:
a. Refactor the code to common functions, maybe a new module, for use in the UI and the CLI.
b. Duplicate the code (Copy/Paste) in a new CLI module.
I think that refactor is the best and elegant option, but maybe for a new contribution (and contributor) b. is a better approach. If the feature is finished and works, is feasible in a next step refactoring the common code.