Fix battery name add logging and uninstall#5
Open
earthPerson-001 wants to merge 6 commits intolhl:mainfrom
Open
Fix battery name add logging and uninstall#5earthPerson-001 wants to merge 6 commits intolhl:mainfrom
earthPerson-001 wants to merge 6 commits intolhl:mainfrom
Conversation
earthPerson-001
commented
Aug 19, 2023
- Fix the battery name by using the output of glob instead of hardcoding to BAT1 in /sys/class/power_supply/BAT1/charge_full. (Determined by BAT0 begin the default name in my case)
- Copying the contents of the local repository instead of moving it. This makes it easier for development as we don't have to clone the repo again after installation.
- Renaming the file in /usr/lib/systemd/system-sleep to batterylog.sleep to follow the convention present in files there.
- Added a few log messages on the system-sleep script to help in debugging if the scripts are running properly.
- Added UNINSTALL.sh script for easier development ( requires some correction while running directly from /opt/batterylog).
…he name. Previously, the battery name was hard-coded to BAT1 which mightn't be the battery designation for every device, so using the battery name generated from glob pattern while opening the file charge_full. Additionally, it can be further improved to collect separate data for each batteries in case of multiple batteries (if required).
- For development purposes, it mightn't be feasible to get root access to edit the files inside of /opt/batterylog which is the folder of installation to which every file got moved prior to this. So, instead of moving the whole repository keeping a local copy as to make it easier for development. - Also adding log messages for installation as to debug installation errors (if any). - Adding .sleep to the extension of batterylog script used pior to suspend and after resuming to keep it consistent with other files in /usr/lib/systemd/system-sleep/.
…ng properly. - Use string 'pre' and 'post' for comparison to remove ambiguity in the comparison.
Prior to this, user wouldn't totally know the location of added files as separate files are added to different locations, so to make it easier to properly remove the added files and restore the system to prior state, adding UNINSTALL.sh script.
Owner
|
Hey thanks for the PR, been traveling but I'll take a look at it this week. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.