From dc290f7159c0f31c4f392af8889a50b02549d9da Mon Sep 17 00:00:00 2001 From: Peter John Hartman Date: Thu, 23 Feb 2023 11:13:06 -0600 Subject: [PATCH] add debug watch option to wakelock --- scripts/core/sxmo_wakelock.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/core/sxmo_wakelock.sh b/scripts/core/sxmo_wakelock.sh index b2f3b3b..5cd25c4 100644 --- a/scripts/core/sxmo_wakelock.sh +++ b/scripts/core/sxmo_wakelock.sh @@ -78,8 +78,12 @@ unlock() { } debug() { - tr " " "\n" < /sys/power/wake_lock | grep . - tail -f "$XDG_STATE_HOME"/sxmo.log | grep "${0##*/}" + if [ "$1" = "watch" ]; then + watch -n1 cat /sys/power/wake_lock + else + tr " " "\n" < /sys/power/wake_lock | grep . + tail -f "$XDG_STATE_HOME"/sxmo.log | grep "${0##*/}" + fi } cmd="$1"