mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-22 18:14:16 +00:00
replace inotify with sleep
inotify is unreliable on /sys, so just loop forever and periodically check the state of things.
This commit is contained in:
parent
ea622e65c1
commit
cde30883b9
2 changed files with 2 additions and 10 deletions
|
|
@ -16,7 +16,7 @@ LOW_BAT_PROFILE="laptop-battery-powersave"
|
|||
[[ -z $STARTUP_WAIT ]] || sleep "$STARTUP_WAIT"
|
||||
|
||||
# start the monitor loop
|
||||
prev=0
|
||||
prev=$(tuned-adm active | tr -s ' ' | cut -d' ' -f4)
|
||||
|
||||
while true; do
|
||||
# read the current state
|
||||
|
|
@ -39,6 +39,5 @@ while true; do
|
|||
|
||||
prev=$profile
|
||||
|
||||
# wait for the next power change event
|
||||
inotifywait -qq "$AC_STATUS" "$BAT_CAP"
|
||||
sleep 10s
|
||||
done
|
||||
|
|
|
|||
|
|
@ -14,13 +14,6 @@
|
|||
tags:
|
||||
- tuned
|
||||
|
||||
- name: Install inotify-tools
|
||||
pacman:
|
||||
name: inotify-tools
|
||||
state: present
|
||||
tags:
|
||||
- tuned
|
||||
|
||||
- name: Install power monitor script
|
||||
copy:
|
||||
src: power_monitor.sh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue