diff --git a/packages/omamobile-shell/bin/omamobile-sleepd b/packages/omamobile-shell/bin/omamobile-sleepd index 41b29831d..491f476c9 100755 --- a/packages/omamobile-shell/bin/omamobile-sleepd +++ b/packages/omamobile-shell/bin/omamobile-sleepd @@ -156,7 +156,9 @@ watch() { # session is frozen while the kernel takes it. Light the PIN pad here, # as that press would have (omamobile-keys ignores the press itself if # it does arrive, so the screen doesn't go straight back off). - if [[ $woke == *KEY_POWER* ]] && command -v omamobile-keys >/dev/null; then + # The key's gpio-keys label names the line: KEY_POWER on the Pixel 7 + # Pro's device tree, "Power" on the Pixel 9a's. + if [[ $woke =~ [[:space:]](KEY_POWER|Power)$ ]] && command -v omamobile-keys >/dev/null; then log "a power-key wake: lighting the lock screen" omamobile-keys wake >/dev/null 2>&1 & fi diff --git a/packages/omamobile-shell/test/sleepd.sh b/packages/omamobile-shell/test/sleepd.sh index 6369fddb2..e79ac494f 100755 --- a/packages/omamobile-shell/test/sleepd.sh +++ b/packages/omamobile-shell/test/sleepd.sh @@ -47,6 +47,7 @@ reset() { echo 0 >"$t/sys/power/suspend_stats/success"; echo 0 >"$t/sys/power/suspend_stats/fail" printf ' 145: 3 0 s2mpg12-pmic 0 Edge rtc-alarm0\n' >"$t/proc/interrupts" printf ' 111: 76 1 gpa10 0 Edge KEY_POWER\n' >>"$t/proc/interrupts" + printf ' 59: 12 0 gpa4 0 Edge Power\n' >>"$t/proc/interrupts" rm -f "$t/wake_irq" "$t/sys/power/pm_wakeup_irq" "$t/on_resume" "$t/now_at" "$t/off_at" "$t/active" "$t/home/.local/state/omarchy/indicators/stay-awake" } # Watch until the fake clock reaches 1000 + $1. @@ -124,6 +125,9 @@ grep -c '^omamobile-keys' "$t/log" >/dev/null && fail "an RTC wake doesn't light reset; echo 111 >"$t/wake_irq"; printf 'echo 0 >"%s"; echo true >"%s"\n' "$t/sys/class/backlight/panel/bl_power" "$t/dpms" >"$t/on_resume"; watch 700 grep -c '^omamobile-keys wake' "$t/log" >/dev/null || fail "a power-key wake asks omamobile-keys to light the PIN pad" grep -c 'a power-key wake: lighting the lock screen' "$t/out" >/dev/null || fail "the power-key wake is logged" +# The Pixel 9a's device tree labels the key "Power", not KEY_POWER. +reset; echo 59 >"$t/wake_irq"; printf 'echo 0 >"%s"; echo true >"%s"\n' "$t/sys/class/backlight/panel/bl_power" "$t/dpms" >"$t/on_resume"; watch 700 +grep -c '^omamobile-keys wake' "$t/log" >/dev/null || fail "a power-key wake labelled Power (the 9a) lights the PIN pad" # A failed suspend is logged and retried no sooner than 30 s later. reset fake systemctl 'echo "systemctl $* at $(cat "$T/clock")" >>"$T/log" diff --git a/packages/omamobile-shell/version b/packages/omamobile-shell/version index 00c8f41d5..8d671b69b 100644 --- a/packages/omamobile-shell/version +++ b/packages/omamobile-shell/version @@ -1 +1 @@ -0.2.65 +0.2.68