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:
Pig Monkey 2025-01-15 18:05:58 -08:00
parent ea622e65c1
commit cde30883b9
2 changed files with 2 additions and 10 deletions

View file

@ -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

View file

@ -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