Fix sxmo auto suspend when mpv is playing

A mpv instance is a inhibit idle for the WM. It means that we
should not rely on sxmo_idle.sh to start and stop the periodic wake lock
checker.

Instead we should just periodically run them.
This commit is contained in:
Willow Barraco
2023-03-30 17:17:10 +02:00
parent c888c90301
commit 75e7c33209
3 changed files with 3 additions and 7 deletions

View File

@@ -24,6 +24,7 @@ sxmo_wm.sh dpms off
sxmo_wm.sh inputevent touchscreen off
sxmo_daemons.sh stop periodic_blink
sxmo_daemons.sh stop periodic_wakelock_check
# Go to screenoff after 8 seconds of inactivity
if ! [ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ]; then

View File

@@ -31,13 +31,7 @@ case "$SXMO_WM" in
;;
esac
sxmo_hook_wakelocks.sh
# Start a periodic daemon (10s) to check wakelocks and go to suspend
# Start a periodic daemon (2s) to blink leds
sxmo_daemons.sh start idle_locker sxmo_idle.sh -w \
timeout 10 'sxmo_daemons.sh start periodic_wakelock_check sxmo_run_periodically.sh 10 sxmo_hook_wakelocks.sh' \
resume 'sxmo_daemons.sh stop periodic_wakelock_check'
sxmo_daemons.sh start periodic_wakelock_check sxmo_run_periodically.sh 10 sxmo_hook_wakelocks.sh
wait

View File

@@ -23,6 +23,7 @@ sxmo_wm.sh dpms off
sxmo_wm.sh inputevent touchscreen on
sxmo_daemons.sh stop periodic_blink
sxmo_daemons.sh stop periodic_wakelock_check
# see https://todo.sr.ht/~mil/sxmo-tickets/150
# We set the scan interval threshold here to