mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Automatically switch power profile when plugged in (balanced) and unplugged (power saver) (#4375)
* Set Power Profiles Rules when plugged in (balanced) and unplugged (power-saver)" * Check for battery presence before installing power profile rules * Add battery presence check script and update powerprofilesctl rules * fix indentation * Simplify power profile rule creation logic
This commit is contained in:
committed by
GitHub
parent
ec305459f8
commit
f78f5b2c2c
10
bin/omarchy-battery-present
Executable file
10
bin/omarchy-battery-present
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
for bat in /sys/class/power_supply/BAT*; do
|
||||
[[ -r "$bat/present" ]] &&
|
||||
[[ "$(cat "$bat/present")" == "1" ]] &&
|
||||
[[ "$(cat "$bat/type")" == "Battery" ]] &&
|
||||
exit 0
|
||||
done
|
||||
|
||||
exit 1
|
||||
Reference in New Issue
Block a user