-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: restore persistence functionality
This commit addresses an issue where the switch to using systemd templates and format specifiers introduced a regression, causing the persistence functionality to no longer work as expected. To resolve this issue, we have reverted to an earlier implementation that manually writes all the units and uses Go's exec.LookPath to resolve the shell path. Resolves: #65
- Loading branch information
1 parent
7f0908d
commit b126966
Showing
3 changed files
with
56 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Persist the battery charging threshold after {{.Event}} | ||
After={{.Event}}.target | ||
StartLimitBurst=0 | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart={{.Shell}} -c 'echo {{.Threshold}} > /sys/class/power_supply/BAT?/charge_control_end_threshold' | ||
Restart=on-failure | ||
RemainAfterExit=true | ||
|
||
[Install] | ||
WantedBy={{.Event}}.target |
This file was deleted.
Oops, something went wrong.
This file contains 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