Repository navigation
Hibernate laptops on critical battery once hibernation is set up #13540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stevederico
wants to merge
11
commits into
omacom:quattro
Choose a base branch
from
stevederico:fix/critical-battery-hibernate
base: quattro
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4a27d44
Hibernate laptops on critical battery once hibernation is set up
stevederico 590911d
Give laptops set up before the critical battery hibernate
stevederico a4349b7
Say how to pick another critical battery level
stevederico fe5be00
Hibernate on critical battery only once resume works
stevederico ffb9d06
Date the critical battery migration after the ones quattro has run
stevederico 723f379
Keep the critical battery test off the host's resume rebuild marker
stevederico a44094c
Keep the critical battery test off the host's sleep setting
stevederico 27b25b3
Drop the critical battery migration test
stevederico 084db2f
Stub the Apple Silicon check in the critical battery test
stevederico 081623e
Fold the critical battery checks into the hibernation setup test
stevederico 443b663
Restart UPower if setup stops after installing the drop-in
stevederico File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Installed by omarchy-hibernation-setup on laptops. UPower's Auto action is | ||
| # logind's Sleep(), which is suspend-then-hibernate: at the last few percent the | ||
| # suspend can drain the battery before the hibernate ever runs. Hibernate | ||
| # directly, early enough for the image to be written on battery. | ||
| # | ||
| # To pick another level, put PercentageAction under [UPower] in a later drop-in, | ||
| # such as /etc/UPower/UPower.conf.d/99-local.conf, and keep it below | ||
| # PercentageCritical. Setup leaves that file alone. | ||
| [UPower] | ||
| CriticalPowerAction=Hibernate | ||
| PercentageCritical=8.0 | ||
| PercentageAction=5.0 |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| echo "Hibernate on critical battery on laptops that already set up hibernation" | ||
|
|
||
| # omarchy-hibernation-setup now installs a UPower drop-in that hibernates on | ||
| # critical battery, but only when it runs. A laptop set up before keeps UPower's | ||
| # Auto action, which suspends into a dying battery (#13256). On a machine that | ||
| # already has hibernation, setup skips the swap and boot steps and only adds | ||
| # what is missing, and it leaves an installed drop-in alone. | ||
| resume_conf="${OMARCHY_RESUME_CONF:-/etc/mkinitcpio.conf.d/omarchy_resume.conf}" | ||
|
|
||
| if [[ -f $resume_conf ]] && grep -q "^HOOKS+=(resume)$" "$resume_conf" && omarchy-battery-present; then | ||
| omarchy-hibernation-setup | ||
| fi |
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
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.
Uh oh!
There was an error while loading. Please reload this page.