Skip to content

CLI GUI compatibility#166

Merged
actuallymentor merged 2 commits intoactuallymentor:mainfrom
olivierbnt:CLI-GUI-compatibility
Aug 20, 2023
Merged

CLI GUI compatibility#166
actuallymentor merged 2 commits intoactuallymentor:mainfrom
olivierbnt:CLI-GUI-compatibility

Conversation

@olivierbnt
Copy link
Copy Markdown
Contributor

@olivierbnt olivierbnt commented Aug 16, 2023

Fix for issue #149 and #128: The percentage set in the CLI is not persistent upon GUI reboot, and reset to 80%.

Problem: On launch of the GUI, the maintain.percentage file is deleted, causing the GUI to recreate the file with default value of 80.
this is caused by the call "battery maintain stop" which deletes the maintain.percentage file.

This issue is easily reproduced by changing the battery maintain 70 via CLI, and then launching the GUI.

Solution: Remove the deletion of file maintain.percentage in "battery maintain stop" to keep persistence of any previous setting.
-> I have added the deletion of all config files upon uninstall so default settings are back if the user reinstalls battery.

Test: The solution was tested by changing the value through the CLI, and rebooting the GUI multiple times. + Uninstalling the CLI removes the .battery file.

Closes #149, Closes #128

… reboot.

-
Problem: On launch of GUI, the maintain.percentage file is deleted, causing the GUI to recreate the file with default value of 80.
-
Solution: In battery.sh, if "$setting" == "stop", file maintain.percentage should not be deleted to keep persistence of any previous setting.
@olivierbnt olivierbnt changed the title Cli g UI compatibility CLI GUI compatibility Aug 16, 2023
@actuallymentor actuallymentor merged commit 4865437 into actuallymentor:main Aug 20, 2023
@actuallymentor
Copy link
Copy Markdown
Owner

Thanks for the addition @olivierbnt!

panoskava pushed a commit to panoskava/battery that referenced this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Starting the battery indicator resets the limit to 80%/ignores user settings battery maintain level not persistent across reboots

2 participants