From 92411af6f93ac17ae8c22224fa511072268ec0a8 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Fri, 30 Oct 2026 10:25:19 -0647 Subject: [PATCH 1/3] omamobile-shell 0.2.41: a touch wake lights the lock screen as the power key does After the power key put the palmtop to sleep, a tap woke it and the panel showed the lock screen, but Hyprland still reported DPMS off and the panel's backlight device stayed powered down, so the panel driver refused the fingerprint circle (EPERM) until a power-key press ran the proper wake. omamobile-sleepd lit the lock screen only for a KEY_POWER wake; it now does the same for a wake from the touchscreen's interrupt (found as the parent device of the input device with INPUT_PROP_DIRECT), through omamobile-keys wake: the lock's wake, Hyprland's DPMS enable and the backlight. A test covers the touch wake and an unknown interrupt. --- packages/omamobile-shell/bin/omamobile-sleepd | 44 ++++++++++++++++--- packages/omamobile-shell/test/sleepd.sh | 12 +++++ packages/omamobile-shell/version | 2 +- 3 files changed, 51 insertions(+), 7 deletions(-) diff --git a/packages/omamobile-shell/bin/omamobile-sleepd b/packages/omamobile-shell/bin/omamobile-sleepd index d106d1566..ab0c322ac 100755 --- a/packages/omamobile-shell/bin/omamobile-sleepd +++ b/packages/omamobile-shell/bin/omamobile-sleepd @@ -16,8 +16,9 @@ # and the sleep hook apply) once the screen has been off and the lock secure # for OMAMOBILE_SLEEP_AFTER_OFF seconds (30), and again OMAMOBILE_SLEEP_GRACE # seconds (5) after a dark resume: a wake that left the screen off (an alarm, -# the RTC, Bluetooth, the fuel gauge, a volume key). A power-key wake lights -# the PIN pad (omamobile-keys wake, from here), and a lit screen never sleeps. +# the RTC, Bluetooth, the fuel gauge, a volume key). A power-key or a touch +# wake lights the PIN pad (omamobile-keys wake, from here), and a lit screen +# never sleeps. # # Never while: # - the toggle is off, the screen is on, or the lock isn't secure; @@ -117,6 +118,28 @@ wake_reason() { echo "IRQ $irq:${name:- (unknown)}" } +# The touchscreen's interrupt, as /proc/interrupts names it: the driver +# requests it under its device's name (the SPI or I2C device, "spi3.0"), so +# find the input device that is a direct touch surface (INPUT_PROP_DIRECT) +# and take its parent device's name. Empty when there is none. +touch_irq_name() { + local d props + for d in "$sys"/class/input/input*; do + props=$(cat "$d/properties" 2>/dev/null) || continue + (( (0x${props:-0} & 0x2) )) || continue + basename "$(readlink -f "$d/device")" + return 0 + done + return 1 +} + +# A touch woke the phone: the wake IRQ is the touchscreen's. +touch_woke() { + local name + name=$(touch_irq_name) || return 1 + [[ -n $name && $1 == *" $name" ]] +} + request() { log "sleeping ($1)" systemctl suspend 2>&1 | sed 's/^/omamobile-sleepd: systemctl: /' @@ -150,10 +173,19 @@ watch() { # The press that woke the phone never reaches Hyprland's binds: the # 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 - log "a power-key wake: lighting the lock screen" - omamobile-keys wake >/dev/null 2>&1 & + # it does arrive, so the screen doesn't go straight back off). A touch + # wake is the same: Hyprland's DPMS state and the panel's backlight + # power stay as the sleep left them unless the lock is lit through + # omamobile-keys, and on tegu that left a lit lock screen that Hyprland + # read as dark and whose panel refused the fingerprint circle. + if command -v omamobile-keys >/dev/null; then + if [[ $woke == *KEY_POWER* ]]; then + log "a power-key wake: lighting the lock screen" + omamobile-keys wake >/dev/null 2>&1 & + elif touch_woke "$woke"; then + log "a touch wake: lighting the lock screen" + omamobile-keys wake >/dev/null 2>&1 & + fi fi # Any wake that leaves the screen off and locked is dark: back to # sleep after the grace. A power-key wake lights the screen and diff --git a/packages/omamobile-shell/test/sleepd.sh b/packages/omamobile-shell/test/sleepd.sh index abb8b8e0c..632068be4 100755 --- a/packages/omamobile-shell/test/sleepd.sh +++ b/packages/omamobile-shell/test/sleepd.sh @@ -120,6 +120,18 @@ 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" +# A touch woke it: the touchscreen's interrupt carries its device's name +# (the input device with INPUT_PROP_DIRECT, parent "spi3.0"), and the lock +# is lit the same way; Hyprland's DPMS state and bl_power would otherwise +# stay as the sleep left them. +reset; mkdir -p "$t/sys/class/input/input0" "$t/sys/devices/spi3.0"; echo 2 >"$t/sys/class/input/input0/properties"; ln -sfn "$t/sys/devices/spi3.0" "$t/sys/class/input/input0/device" +printf ' 73: 12 0 gpa7 6 Edge spi3.0\n' >>"$t/proc/interrupts" +echo 73 >"$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 touch wake asks omamobile-keys to light the PIN pad" +grep -c 'a touch wake: lighting the lock screen' "$t/out" >/dev/null || fail "the touch wake is logged" +# The same interrupt line with no touchscreen among the input devices is a dark resume. +reset; rm -rf "$t/sys/class/input"; printf ' 73: 12 0 gpa7 6 Edge spi3.0\n' >>"$t/proc/interrupts"; echo 73 >"$t/wake_irq"; watch 700 +grep -c '^omamobile-keys' "$t/log" >/dev/null && fail "an unknown wake doesn't light the screen" # 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 655b3ef46..c1e088e61 100644 --- a/packages/omamobile-shell/version +++ b/packages/omamobile-shell/version @@ -1 +1 @@ -0.2.40 +0.2.41 From 77fd96d1febe64954d60d15989292d70639acb87 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Fri, 30 Oct 2026 13:21:00 -0647 Subject: [PATCH 2/3] omamobile-shell 0.2.45: a touch wake is only matched through a device with a parent A direct-touch input device without a device link (uinput, a test tool) listed before the real touchscreen would have given an empty name and masked it; such devices are skipped now, with a test for the case. --- packages/omamobile-shell/bin/omamobile-sleepd | 5 ++++- packages/omamobile-shell/test/sleepd.sh | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/omamobile-shell/bin/omamobile-sleepd b/packages/omamobile-shell/bin/omamobile-sleepd index b79d7a4a8..930f4368e 100755 --- a/packages/omamobile-shell/bin/omamobile-sleepd +++ b/packages/omamobile-shell/bin/omamobile-sleepd @@ -121,12 +121,15 @@ wake_reason() { # The touchscreen's interrupt, as /proc/interrupts names it: the driver # requests it under its device's name (the SPI or I2C device, "spi3.0"), so # find the input device that is a direct touch surface (INPUT_PROP_DIRECT) -# and take its parent device's name. Empty when there is none. +# with a parent device, and take that parent's name. A virtual input device +# (uinput, a test tool) has no `device` link and is skipped, so it can't +# mask the real touchscreen. Empty when there is none. touch_irq_name() { local d props for d in "$sys"/class/input/input*; do props=$(cat "$d/properties" 2>/dev/null) || continue (( (0x${props:-0} & 0x2) )) || continue + [[ -e $d/device ]] || continue basename "$(readlink -f "$d/device")" return 0 done diff --git a/packages/omamobile-shell/test/sleepd.sh b/packages/omamobile-shell/test/sleepd.sh index aed892397..fe15bd53e 100755 --- a/packages/omamobile-shell/test/sleepd.sh +++ b/packages/omamobile-shell/test/sleepd.sh @@ -136,6 +136,11 @@ grep -c 'a touch wake: lighting the lock screen' "$t/out" >/dev/null || fail "th # The same interrupt line with no touchscreen among the input devices is a dark resume. reset; rm -rf "$t/sys/class/input"; printf ' 73: 12 0 gpa7 6 Edge spi3.0\n' >>"$t/proc/interrupts"; echo 73 >"$t/wake_irq"; watch 700 grep -c '^omamobile-keys' "$t/log" >/dev/null && fail "an unknown wake doesn't light the screen" +# A virtual direct-touch device (no `device` link, as uinput makes) listed +# before the real one must not mask it: the real touchscreen's name is used. +reset; mkdir -p "$t/sys/class/input/input0" "$t/sys/class/input/input1" "$t/sys/devices/spi3.0"; echo 2 >"$t/sys/class/input/input0/properties"; echo 2 >"$t/sys/class/input/input1/properties"; ln -sfn "$t/sys/devices/spi3.0" "$t/sys/class/input/input1/device" +printf ' 73: 12 0 gpa7 6 Edge spi3.0\n' >>"$t/proc/interrupts"; echo 73 >"$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 'a touch wake: lighting the lock screen' "$t/out" >/dev/null || fail "a virtual touch device without a parent doesn't mask the real touchscreen" # A failed suspend is logged and retried no sooner than 30 s later. reset fake systemctl 'echo "systemctl $* at $(cat "$T/clock")" >>"$T/log" From f6fa42968abfca717fd53fd643f86c1dce777d2e Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Fri, 30 Oct 2026 13:55:12 -0647 Subject: [PATCH 3/3] omamobile-shell 0.2.46: the next free version after #161 --- packages/omamobile-shell/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/omamobile-shell/version b/packages/omamobile-shell/version index 16c9e92a2..614610503 100644 --- a/packages/omamobile-shell/version +++ b/packages/omamobile-shell/version @@ -1 +1 @@ -0.2.45 +0.2.46