From 205e4ae66858d3decb1b264fe200b26016d5542e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Fri, 6 Nov 2026 19:43:50 +0100 Subject: [PATCH 01/15] omamobile-keys: the brightness comes back only once the panel is off A short press on an unlocked phone dims the panel to 0, locks behind it, turns the display off and puts the brightness back for the next wake. On a Pixel 7 the panel goes off about 0.4 s after the DPMS dispatch (bl_power then reads 4), and the brightness came back before that, lighting the lock screen for a moment before the screen went dark. It now waits for bl_power to read 4 (at most 1.5 s). Measured on the phone every 20 ms: brightness 0 at 0.62 s, panel off at 1.99 s, brightness back at 2.02 s; before, back at 1.61 s with the panel still on until 1.97 s. I used AI help (Claude) to work on this. --- packages/omamobile-shell/bin/omamobile-keys | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index 6aece0fd0..c2f5d48d0 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -220,7 +220,18 @@ short_press() { lock_dark omarchy-brightness-display off # The brightness the next wake lights up with: the saved level, or 40 % when - # the press caught the panel at 0. + # the press caught the panel at 0. Only once the panel is really off: DPMS + # takes it down about 0.4 s after the dispatch on a Pixel 7 (bl_power goes + # to 4 then), and putting the level back before that lit the lock screen + # for a moment (Ángel, 6-nov: "vuelve a la pantalla de bloqueo antes de + # apagar la pantalla"). At most 1.5 s, for a panel whose bl_power never + # says so. + if [[ -n $device && -r /sys/class/backlight/$device/bl_power ]]; then + for _ in $(seq 30); do + [[ $( Date: Fri, 6 Nov 2026 19:47:28 +0100 Subject: [PATCH 02/15] omamobile-keys: a short press turns the panel off at once, then locks The backlight at 0 only dimmed a Pixel 7's OLED: the screen went dim, the lock showed through it, and only then did the screen go off. The press now powers the panel off first (DPMS), with the backlight at 0 for a panel DPMS doesn't reach, and takes the lock behind it, as Android goes dark at once. I used AI help (Claude) to work on this. --- packages/omamobile-shell/bin/omamobile-keys | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index c2f5d48d0..643b374ba 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -201,12 +201,15 @@ short_press() { # off by hand): a press wakes it instead of locking into the dark again. wake_unlocked else - # Dark at once, as on Android, but only by the backlight: Omarchy's lock - # waits for a working screen ("screen-stabilizing"), so powering the panel - # off first made the lock light it again for a moment. Lock behind the dark - # panel, then power it off and put the brightness back for the next wake. + # Off at once, as on Android: the panel powered off first, then the lock + # taken behind it. The backlight at 0 alone only dimmed a Pixel 7's OLED, + # so the lock showed dim before the screen went off (Ángel, 6-nov: "se + # atenúa, va a la pantalla de bloqueo y luego se apaga"). The brightness + # goes to 0 too, for a panel DPMS doesn't reach; it comes back below, + # once the panel is off, for the next wake. local device level= device=$(omarchy-hw-display 2>/dev/null) + hyprctl dispatch 'hl.dsp.dpms({ action = "disable" })' >/dev/null 2>&1 if [[ -n $device ]]; then level=$(brightnessctl -d "$device" get 2>/dev/null) [[ ${level:-0} -gt 0 ]] || level= From ad3b1224ac337125bb16327dc31b4db4de263fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Fri, 6 Nov 2026 19:50:45 +0100 Subject: [PATCH 03/15] omamobile-keys: a fade to black first, where the shell has one A shell with omamobile.home's screenOff call (the Pixel layer's 200 ms fade) gets it before the panel goes off; without it the call fails and the panel goes off at once, as before. I used AI help (Claude) to work on this. --- packages/omamobile-shell/bin/omamobile-keys | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index 643b374ba..0ae25bb8b 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -209,6 +209,11 @@ short_press() { # once the panel is off, for the next wake. local device level= device=$(omarchy-hw-display 2>/dev/null) + # First Android's fade to black (200 ms, the shell's screenOff), where + # the shell has one; then the panel off. + if [[ $(omarchy-shell shell call omamobile.home screenOff "" 2>/dev/null) == ok ]]; then + sleep 0.2 + fi hyprctl dispatch 'hl.dsp.dpms({ action = "disable" })' >/dev/null 2>&1 if [[ -n $device ]]; then level=$(brightnessctl -d "$device" get 2>/dev/null) From 6655ed5f6fcd91459e2390962006705fa08d2731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Fri, 6 Nov 2026 20:12:52 +0100 Subject: [PATCH 04/15] omamobile-keys: a locked phone wakes as the power key goes down Android wakes on the key's press, not its release, so the screen answers the press itself; the release then does nothing. I used AI help (Claude) to work on this. --- packages/omamobile-shell/bin/omamobile-keys | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index 0ae25bb8b..f463bcb1b 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -175,6 +175,12 @@ long_press() { } short_press() { + # This press already woke the phone as it went down (power-down). + if [[ -f $state/woke-on-press ]] && (( $(now) - $(<"$state/woke-on-press") < 5000 )); then + rm -f "$state/woke-on-press" + echo "$(now)" >"$state/last-press" + return 0 + fi # Debounce: a second press within 0.8 s of the first, while it was still # locking and powering the panel off, read the screen as on and saved a # brightness of 0, which left the phone dark on the next wake. A press a @@ -257,6 +263,14 @@ case "${1:-}" in elif [[ -f $state/volume-up-held ]] && recent volume-up && voice_ptt_enabled; then start_ptt else + # A locked, dark phone wakes as the key goes down, as Android's does + # (it wakes on the press, not the release), so the screen answers the + # press itself. The release then has nothing left to do (short_press + # sees the mark). + if screen_off && locked; then + echo "$press" >"$state/woke-on-press" + wake_locked >/dev/null 2>&1 & + fi # Long press: still the same press, still held, no chord in between. ( sleep "$hold" From 001d3dad0769dc60c20ed32d3c9d975416fd660c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Fri, 6 Nov 2026 20:18:33 +0100 Subject: [PATCH 05/15] omamobile-keys: presses one at a time, a held press wakes once Repeated presses ran over each other (a wake under a going-to-sleep), and a held press woke the phone on the way down and again at the long-press mark, then left its mark behind so the next short press within 5 s was swallowed. Each press's work now waits for the one before (flock, at most 4 s), a long press neither wakes a lit screen nor a phone its press woke, and its release clears the mark. I used AI help (Claude) to work on this. --- packages/omamobile-shell/bin/omamobile-keys | 33 ++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index f463bcb1b..2f836b482 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -167,13 +167,28 @@ sleep_now() { long_press() { touch "$state/long" + # This press already woke the phone as it went down: held, it stays lit, + # with no second wake. + [[ -f $state/woke-on-press ]] && return 0 if locked; then - wake_locked + # Lit already: nothing to wake. + screen_off && wake_locked else omarchy-menu toggle system fi } +# One press's work at a time: presses in quick succession (or a press while +# the last one is still locking and powering the panel off) ran over each +# other, a wake under a going-to-sleep. Each waits for the one before, at +# most 4 s. +serially() { + ( + flock -w 4 9 || true + "$@" + ) 9>"$state/action.lock" +} + short_press() { # This press already woke the phone as it went down (power-down). if [[ -f $state/woke-on-press ]] && (( $(now) - $(<"$state/woke-on-press") < 5000 )); then @@ -269,7 +284,7 @@ case "${1:-}" in # sees the mark). if screen_off && locked; then echo "$press" >"$state/woke-on-press" - wake_locked >/dev/null 2>&1 & + serially wake_locked >/dev/null 2>&1 & fi # Long press: still the same press, still held, no chord in between. ( @@ -343,19 +358,9 @@ case "${1:-}" in if [[ -f $state/chord ]]; then rm -f "$state/chord" elif [[ -f $state/long ]]; then - rm -f "$state/long" + rm -f "$state/long" "$state/woke-on-press" else - # Let a second press observe the finished off transition before it - # decides whether to wake. Keep the lock out of background helpers. - released_at=$(now) - exec {short_lock}>"$state/short.lock" - # A stuck action must not queue every later press forever. Drop this - # press after five seconds rather than overlap display transitions. - if ! flock -w 5 "$short_lock"; then - echo 'omamobile-keys: short-press lock wait failed; dropping press' >&2 - exit 0 - fi - ( short_press "$released_at" ) {short_lock}>&- + serially short_press "$(now)" fi ;; wake) From e22fe88bad72918c0998b755c92527fbc2f1abc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Fri, 6 Nov 2026 20:28:19 +0100 Subject: [PATCH 06/15] omamobile-keys: the wake starts at once and the panel first Measured on the phone with a timing log: a press that woke the phone took about 100 ms to decide (screen_off and locked ask Hyprland and the shell) and asked for the panel some 170 ms after the press, behind the lock's wake and the reveal. It now decides by the panel's bl_power (a file read, with screen_off as the fallback where bl_power stays 0) and asks for the panel first, the rest happening while it comes on (about 270 ms): the wake starts 30 ms after the press and asks for the panel at 44 ms. I used AI help (Claude) to work on this. --- packages/omamobile-shell/bin/omamobile-keys | 26 +++++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index 2f836b482..ec889d307 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -93,10 +93,13 @@ screensaver_up() { # display itself, because on tegu that wake reports ok without powering the # panel back on. The brightness is put back if it was saved as 0. wake_locked() { - # The lock's wake restarts its blank timer, but on tegu it reports "ok" - # without powering the panel back on, so always turn the display on too. + # The panel first: it takes about 270 ms to come on (measured on the + # Pixel 7), and the lock's wake happens meanwhile. The lock's wake + # restarts its blank timer, but on tegu it reports "ok" without powering + # the panel back on, so the display is turned on anyway. + omarchy-brightness-display on & omarchy-shell lock wake >/dev/null 2>&1 - omarchy-brightness-display on + wait local device device=$(omarchy-hw-display 2>/dev/null) sleep 0.3 @@ -133,6 +136,19 @@ screen_off() { hyprctl monitors -j 2>/dev/null | jq -e 'any(.[]; .dpmsStatus == false)' >/dev/null } +# The quick check for the press that wakes: the panel's own bl_power (4 is +# off) is a file read, where screen_off and locked ask Hyprland and the +# shell (about 100 ms before the wake could start). Where bl_power stays 0 +# with the panel off (tegu), screen_off decides. +panel_dark() { + local p + for p in /sys/class/backlight/*/bl_power; do + [[ -r $p ]] || continue + [[ $(<"$p") == 4 ]] && return 0 + done + screen_off +} + # The chord marker is cleared on power's release, but Hyprland drops that # release once another key went down, so a marker older than this is stale. in_chord() { @@ -278,11 +294,11 @@ case "${1:-}" in elif [[ -f $state/volume-up-held ]] && recent volume-up && voice_ptt_enabled; then start_ptt else - # A locked, dark phone wakes as the key goes down, as Android's does + # A dark phone wakes as the key goes down, as Android's does # (it wakes on the press, not the release), so the screen answers the # press itself. The release then has nothing left to do (short_press # sees the mark). - if screen_off && locked; then + if panel_dark; then echo "$press" >"$state/woke-on-press" serially wake_locked >/dev/null 2>&1 & fi From 7e34fa8f86783392bb34cdb03e90252575f85c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Fri, 6 Nov 2026 21:12:03 +0100 Subject: [PATCH 07/15] omamobile-sleepd: a power-key wake from sleep lights the lock at once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The watcher noticed a resume only on its next poll, and the phone freezes it mid-pause while asleep with the pause's clock not counting the sleep: up to 2 s (5 s idle) between the press that woke the phone and the lit lock screen (Ángel, 6-nov: the power key's quicker wake didn't show after a while off). Asked to sleep and not yet seen to wake, it now polls every 0.2 s, until a retry is due. omamobile-keys' wake from sleep uses the quick bl_power check as the press's own wake does. test/sleepd.sh's fake clock moves a whole second for a sub-second pause. I used AI help (Claude) to work on this. --- packages/omamobile-shell/bin/omamobile-keys | 3 ++- packages/omamobile-shell/bin/omamobile-sleepd | 7 ++++++- packages/omamobile-shell/test/sleepd.sh | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index ec889d307..438dc0b2c 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -383,7 +383,8 @@ case "${1:-}" in # omamobile-sleepd after a power-key wake from sleep: Hyprland never sees # the press that woke the phone, so light the PIN pad as that press would. now >"$state/power-wake" - if locked && screen_off; then wake_locked; fi + # The quick check (a file read), as the press's own wake. + if panel_dark; then serially wake_locked; fi ;; double-tap) # omamobile-doubletap: a double tap on the touchscreen. Only a dark diff --git a/packages/omamobile-shell/bin/omamobile-sleepd b/packages/omamobile-shell/bin/omamobile-sleepd index 491f476c9..208685dca 100755 --- a/packages/omamobile-shell/bin/omamobile-sleepd +++ b/packages/omamobile-shell/bin/omamobile-sleepd @@ -197,7 +197,12 @@ watch() { request "$cause" fi fi - pause "$poll" + # Asked to sleep and not yet seen to wake: every 0.2 s. The phone freezes + # this loop mid-pause while it sleeps, and the pause's clock doesn't count + # the sleep, so a 2 s pause left up to 2 s between a power-key wake and the + # lit lock screen (Ángel, 6-nov: slow to light after a while off). Only + # until a retry is due, so a refused sleep doesn't keep it spinning. + if ((requested >= 0 && t - requested < retry)); then pause 0.2; else pause "$poll"; fi done } diff --git a/packages/omamobile-shell/test/sleepd.sh b/packages/omamobile-shell/test/sleepd.sh index e79ac494f..8e0986d4c 100755 --- a/packages/omamobile-shell/test/sleepd.sh +++ b/packages/omamobile-shell/test/sleepd.sh @@ -12,7 +12,9 @@ F=$t/bin; mkdir -p "$F" "$t/sys/power/suspend_stats" "$t/sys/class/backlight/pan fail() { printf 'not ok - %s\n' "$1" >&2; sed 's/^/# /' "$t/log" "$t/out" >&2 2>/dev/null; exit 1; } fake() { printf '#!/bin/bash\nT=%q\n%s\n' "$t" "$2" >"$F/$1"; chmod +x "$F/$1"; } -fake sleep 'echo $(( $(cat "$T/clock") + ${1%%.*} )) >"$T/clock" +# (a pause under a second, the watcher's 0.2 s while it waits to sleep, moves +# the fake clock a whole second, or it would never move) +fake sleep 's=${1%%.*}; ((s > 0)) || s=1; echo $(( $(cat "$T/clock") + s )) >"$T/clock" # "the user presses power" at a given time: the watcher gets its signal. if [[ -f $T/now_at ]] && (( $(cat "$T/clock") >= $(cat "$T/now_at") )); then rm -f "$T/now_at"; kill -USR1 $PPID; fi # "the panel finishes powering off" at a given time. From 73b1db448449c97af9e1bca333dffdd1601b9115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Fri, 6 Nov 2026 21:42:04 +0100 Subject: [PATCH 08/15] omamobile-keys: quick presses count Measured with a timing log on the phone: of 13 quick presses, 3 were thrown away as bounces. A press that had woken the phone wrote its time once its wake was done (half a second later), and the next press came within the 0.8 s debounce of that. Presses are now timed from the key's release, and the debounce is 0.3 s, enough for a bounce now that presses run one at a time. Measured again: 33 presses, every one acted on. I used AI help (Claude) to work on this. --- packages/omamobile-shell/bin/omamobile-keys | 25 +++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index 438dc0b2c..ea8b638b2 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -206,20 +206,27 @@ serially() { } short_press() { + # $1: when the key came up. The work may start later, behind the press + # before (serially), and timing it from then threw quick presses away as + # bounces (Ángel, 6-nov: "los toques rápidos no los detecta bien"). + local up=${1:-$(now)} # This press already woke the phone as it went down (power-down). - if [[ -f $state/woke-on-press ]] && (( $(now) - $(<"$state/woke-on-press") < 5000 )); then + if [[ -f $state/woke-on-press ]] && (( up - $(<"$state/woke-on-press") < 5000 )); then rm -f "$state/woke-on-press" - echo "$(now)" >"$state/last-press" + echo "$up" >"$state/last-press" return 0 fi - # Debounce: a second press within 0.8 s of the first, while it was still - # locking and powering the panel off, read the screen as on and saved a - # brightness of 0, which left the phone dark on the next wake. A press a - # few seconds later must still count: it is the wake. - local now last - now=$1; last=$(cat "$state/last-press" 2>/dev/null || echo 0) + # Debounce (below). A second press while the first was still locking and + # powering the panel off once read the screen as on and saved a brightness + # of 0, leaving the phone dark on the next wake: presses now run one at a + # time (serially) instead. A press a few seconds later is the wake. + # A bounce, not a press: within 0.3 s of the last. It was 0.8 s, from when + # a second press could overtake a lock still going on; presses now wait + # for each other (serially), and 0.8 s swallowed quick ones. + local now=$up last + last=$(cat "$state/last-press" 2>/dev/null || echo 0) echo "$now" >"$state/last-press" - (( now - last < 800 )) && return 0 + (( now - last < 300 )) && return 0 # The press that woke the phone from sleep, if it gets here at all: # omamobile-sleepd has lit the PIN pad for it already. [[ -f $state/power-wake ]] && (( now - $(<"$state/power-wake") < 1500 )) && return 0 From 2a772f6c224b6e2c4e51b1dbb3715c89b898ad08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Fri, 6 Nov 2026 22:58:09 +0100 Subject: [PATCH 09/15] omamobile-keys: a press while the screen is going off wakes it back MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Measured with a timing log on the phone: turning an unlocked phone off takes about 2 s (the reveal, the lock, the panel going off), and a press in that time was queued behind it and lost (Ángel, 6-nov: slow to light). As Android's, such a press now wakes the phone back at once, locked: the press marks it, and each step of the turning off looks and stops, puts the brightness back, takes the lock if it isn't yet, and wakes. I used AI help (Claude) to work on this. --- packages/omamobile-shell/bin/omamobile-keys | 32 ++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index ea8b638b2..69106325a 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -253,11 +253,28 @@ short_press() { # once the panel is off, for the next wake. local device level= device=$(omarchy-hw-display 2>/dev/null) + # A press while this runs (about 2 s: the reveal, the lock, the panel + # going off) wakes the phone back at once, locked, as Android's does; it + # was queued behind it and lost (Ángel, 6-nov: slow to light, measured). + # power-down marks it; each step here looks. + now >"$state/going-off" + rm -f "$state/wake-during-off" + back_on() { + [[ -f $state/wake-during-off ]] || return 1 + rm -f "$state/wake-during-off" "$state/going-off" + if [[ -n $device ]]; then + [[ -n $level ]] && brightnessctl -q -d "$device" set "$level" || brightnessctl -q -d "$device" set 40% + fi + locked || omarchy-system-lock + wake_locked + return 0 + } # First Android's fade to black (200 ms, the shell's screenOff), where # the shell has one; then the panel off. if [[ $(omarchy-shell shell call omamobile.home screenOff "" 2>/dev/null) == ok ]]; then sleep 0.2 fi + back_on && return 0 hyprctl dispatch 'hl.dsp.dpms({ action = "disable" })' >/dev/null 2>&1 if [[ -n $device ]]; then level=$(brightnessctl -d "$device" get 2>/dev/null) @@ -269,6 +286,7 @@ short_press() { omarchy-shell lock status 2>/dev/null | grep -q '"secure":true' && break sleep 0.1 done + back_on && return 0 lock_dark omarchy-brightness-display off # The brightness the next wake lights up with: the saved level, or 40 % when @@ -287,6 +305,13 @@ short_press() { if [[ -n $device ]]; then [[ -n $level ]] && brightnessctl -q -d "$device" set "$level" || brightnessctl -q -d "$device" set 40% fi + rm -f "$state/going-off" + # A press in the last moment found the panel still going off. + if [[ -f $state/wake-during-off ]]; then + rm -f "$state/wake-during-off" + wake_locked + return 0 + fi sleep_now fi } @@ -301,11 +326,16 @@ case "${1:-}" in elif [[ -f $state/volume-up-held ]] && recent volume-up && voice_ptt_enabled; then start_ptt else + # Pressed while a press before is still turning the screen off: that + # one wakes the phone back (short_press, back_on). + if [[ -f $state/going-off ]] && (( press - $(<"$state/going-off") < 5000 )); then + touch "$state/wake-during-off" + echo "$press" >"$state/woke-on-press" # A dark phone wakes as the key goes down, as Android's does # (it wakes on the press, not the release), so the screen answers the # press itself. The release then has nothing left to do (short_press # sees the mark). - if panel_dark; then + elif panel_dark; then echo "$press" >"$state/woke-on-press" serially wake_locked >/dev/null 2>&1 & fi From 977a1b539e84d6589eebed97420ca226958b8cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Mon, 9 Nov 2026 19:43:20 +0100 Subject: [PATCH 10/15] omamobile-keys: the power key as Android's only with OMAMOBILE_POWER_KEY_ANDROID=1 The commits before change shared code every phone runs. Off, the shared default, omamobile-keys puts back the three functions they changed (wake_locked, long_press, short_press) word for word from before, a press doesn't wait for the one before, the press doesn't wake on the way down, and omamobile-sleepd keeps its poll. device-panther turns it on through environment.d, as OMAMOBILE_ROTATION_HOLD. test/keys.sh and test/sleepd.sh run both ways; a new check tells them apart (the fade to black before the lock), and fails with the switch forced either way. device-panther's test fails without the file or with the switch at 0. --- packages/omamobile-device-panther/README.md | 1 + packages/omamobile-device-panther/install | 2 + packages/omamobile-device-panther/test/all | 3 + .../environment.d/40-omamobile-power-key.conf | 10 ++ packages/omamobile-shell/bin/omamobile-keys | 110 +++++++++++++++++- packages/omamobile-shell/bin/omamobile-sleepd | 5 +- packages/omamobile-shell/test/all | 8 +- packages/omamobile-shell/test/keys.sh | 9 ++ 8 files changed, 139 insertions(+), 9 deletions(-) create mode 100644 packages/omamobile-device-panther/vendor/environment.d/40-omamobile-power-key.conf diff --git a/packages/omamobile-device-panther/README.md b/packages/omamobile-device-panther/README.md index 0f95d6458..d44e96647 100644 --- a/packages/omamobile-device-panther/README.md +++ b/packages/omamobile-device-panther/README.md @@ -5,6 +5,7 @@ Omarchy Mobile's first userspace package for the Google Pixel 7 (codename panthe | Path | Installs to | What it does | | --- | --- | --- | | `vendor/environment.d/40-omamobile-rotation.conf` | `/usr/lib/environment.d` | `OMAMOBILE_ROTATION_HOLD=1`: Hyprland (packages/hyprland, 0002) holds the last frame across a rotation and turns the new one in as Android does. Off in the shared build until it has run on the other phones | +| `vendor/environment.d/40-omamobile-power-key.conf` | `/usr/lib/environment.d` | `OMAMOBILE_POWER_KEY_ANDROID=1`: the power key as Android's (omamobile-keys, omamobile-sleepd): a dark phone wakes on the press, a short press turns the panel off at once and locks behind it. Off in the shared shell until it has run on the other phones | | `vendor/systemd/system/omamobile-speaker-protection.service.d/50-panther-default-cal.conf` | `/usr/lib/systemd/system/omamobile-speaker-protection.service.d` | `OMAMOBILE_SPK_DEFAULT_CAL=1`: a Pixel 7 with no `speaker.cal` in persist runs its speakers on the protection firmware's default calibration, as stock does (omamobile-audio 0.5.16; c9 and `verify` stay refused). A phone with `speaker.cal` still uses it; a line in `/etc/omamobile/speaker.conf` overrides it | | `vendor/udev/rules.d/10-omamobile-storage.rules` | `/usr/lib/udev/rules.d` | Hides `sda` and every Android partition except `userdata` from desktop tools. Same rule as the Pixel 7 Pro. The initramfs stops its guard loop before `switch_root`; the kernel's read-only flags are what remain | | `vendor/udev/rules.d/20-omamobile-gpu-always-on.rules` | `/usr/lib/udev/rules.d` | Keeps the Mali-G710 powered while Panthor drives it: powering its domain back up needs a secure call our kernel doesn't make yet. Same rule as the Pixel 7 Pro | diff --git a/packages/omamobile-device-panther/install b/packages/omamobile-device-panther/install index fa535d334..735d89e59 100755 --- a/packages/omamobile-device-panther/install +++ b/packages/omamobile-device-panther/install @@ -36,6 +36,8 @@ install -Dm644 vendor/systemd/network/20-usb-gadget.network \ "$destination/usr/lib/systemd/network/20-usb-gadget.network" install -Dm644 vendor/environment.d/40-omamobile-rotation.conf \ "$destination/usr/lib/environment.d/40-omamobile-rotation.conf" +install -Dm644 vendor/environment.d/40-omamobile-power-key.conf \ + "$destination/usr/lib/environment.d/40-omamobile-power-key.conf" install -Dm644 vendor/systemd/system/omamobile-speaker-protection.service.d/50-panther-default-cal.conf \ "$destination/usr/lib/systemd/system/omamobile-speaker-protection.service.d/50-panther-default-cal.conf" install -Dm644 vendor/systemd/logind.conf.d/10-omamobile-power-key.conf \ diff --git a/packages/omamobile-device-panther/test/all b/packages/omamobile-device-panther/test/all index 56ad60d8d..35903473a 100755 --- a/packages/omamobile-device-panther/test/all +++ b/packages/omamobile-device-panther/test/all @@ -96,6 +96,7 @@ for f in usr/bin/reboot-to \ usr/lib/udev/rules.d/70-omamobile-dma-heap.rules \ usr/lib/systemd/network/20-usb-gadget.network \ usr/lib/environment.d/40-omamobile-rotation.conf \ + usr/lib/environment.d/40-omamobile-power-key.conf \ usr/lib/systemd/system/omamobile-speaker-protection.service.d/50-panther-default-cal.conf \ usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf \ usr/lib/systemd/sleep.conf.d/10-omamobile.conf \ @@ -130,6 +131,8 @@ grep -q 'Address=172.16.42.1/24' "$tmp/root/usr/lib/systemd/network/20-usb-gadge || fail "usb0 keeps the initramfs address" grep -qx 'OMAMOBILE_ROTATION_HOLD=1' "$tmp/root/usr/lib/environment.d/40-omamobile-rotation.conf" \ || fail "the Pixel 7 turns on Hyprland's rotation hold" +grep -qx 'OMAMOBILE_POWER_KEY_ANDROID=1' "$tmp/root/usr/lib/environment.d/40-omamobile-power-key.conf" \ + || fail "the Pixel 7 turns on the power key as Android's" dropin="$tmp/root/usr/lib/systemd/system/omamobile-speaker-protection.service.d/50-panther-default-cal.conf" grep -qx '\[Service\]' "$dropin" && grep -qx 'Environment=OMAMOBILE_SPK_DEFAULT_CAL=1' "$dropin" \ || fail "the Pixel 7 starts its speakers on the default calibration when it has no speaker.cal" diff --git a/packages/omamobile-device-panther/vendor/environment.d/40-omamobile-power-key.conf b/packages/omamobile-device-panther/vendor/environment.d/40-omamobile-power-key.conf new file mode 100644 index 000000000..06030fe50 --- /dev/null +++ b/packages/omamobile-device-panther/vendor/environment.d/40-omamobile-power-key.conf @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: MIT +# Omarchy Mobile: the power key as Android's (omamobile-keys and +# omamobile-sleepd, packages/omamobile-shell): a dark phone wakes on the +# press, a short press turns the panel off at once and locks behind it. +# The order is the reverse of the shared default's on purpose: the panel +# goes off first and the lock follows behind it, where the default locks +# and then powers the panel off. That is why it stays off on the other +# phones for now; the Pixel 7 turns it on, where it has run. Read when the +# session starts. +OMAMOBILE_POWER_KEY_ANDROID=1 diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index 69106325a..976133e11 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -316,6 +316,92 @@ short_press() { fi } +# The power key as Android's (each change above says what it does): only +# with OMAMOBILE_POWER_KEY_ANDROID=1 in the session's environment, which +# device-panther sets (environment.d), where it has run. Off, the shared +# default, the key works as before: the functions it changed are put back +# here word for word, and a press doesn't wait for the one before. These go +# once it has run on the other phones. +android_power=${OMAMOBILE_POWER_KEY_ANDROID:-} +if [[ $android_power != 1 ]]; then +serially() { "$@"; } + +wake_locked() { + # The lock's wake restarts its blank timer, but on tegu it reports "ok" + # without powering the panel back on, so always turn the display on too. + omarchy-shell lock wake >/dev/null 2>&1 + omarchy-brightness-display on + local device + device=$(omarchy-hw-display 2>/dev/null) + sleep 0.3 + [[ -n $device ]] || return 0 + [[ $(brightnessctl -d "$device" get 2>/dev/null || echo 1) -gt 0 ]] || brightnessctl -q -d "$device" set 40% +} + +long_press() { + touch "$state/long" + if locked; then + wake_locked + else + omarchy-menu toggle system + fi +} + +short_press() { + # Debounce: a second press within 0.8 s of the first, while it was still + # locking and powering the panel off, read the screen as on and saved a + # brightness of 0, which left the phone dark on the next wake. A press a + # few seconds later must still count: it is the wake. + local now last + now=$1; last=$(cat "$state/last-press" 2>/dev/null || echo 0) + echo "$now" >"$state/last-press" + (( now - last < 800 )) && return 0 + # The press that woke the phone from sleep, if it gets here at all: + # omamobile-sleepd has lit the PIN pad for it already. + [[ -f $state/power-wake ]] && (( now - $(<"$state/power-wake") < 1500 )) && return 0 + if screensaver_up; then + omarchy-system-lock + elif locked; then + if screen_off; then + wake_locked + else + lock_dark + omarchy-brightness-display off + sleep_now + fi + elif screen_off; then + # Unlocked but dark (the lock didn't engage, or the panel was powered + # off by hand): a press wakes it instead of locking into the dark again. + wake_unlocked + else + # Dark at once, as on Android, but only by the backlight: Omarchy's lock + # waits for a working screen ("screen-stabilizing"), so powering the panel + # off first made the lock light it again for a moment. Lock behind the dark + # panel, then power it off and put the brightness back for the next wake. + local device level= + device=$(omarchy-hw-display 2>/dev/null) + if [[ -n $device ]]; then + level=$(brightnessctl -d "$device" get 2>/dev/null) + [[ ${level:-0} -gt 0 ]] || level= + brightnessctl -q -d "$device" set 0 + fi + omarchy-system-lock + for _ in $(seq 30); do + omarchy-shell lock status 2>/dev/null | grep -q '"secure":true' && break + sleep 0.1 + done + lock_dark + omarchy-brightness-display off + # The brightness the next wake lights up with: the saved level, or 40 % when + # the press caught the panel at 0. + if [[ -n $device ]]; then + [[ -n $level ]] && brightnessctl -q -d "$device" set "$level" || brightnessctl -q -d "$device" set 40% + fi + sleep_now + fi +} +fi + case "${1:-}" in power-down) rm -f "$state/chord" "$state/long" @@ -328,14 +414,15 @@ case "${1:-}" in else # Pressed while a press before is still turning the screen off: that # one wakes the phone back (short_press, back_on). - if [[ -f $state/going-off ]] && (( press - $(<"$state/going-off") < 5000 )); then + # Both only with the power key as Android's (android_power). + if [[ $android_power == 1 && -f $state/going-off ]] && (( press - $(<"$state/going-off") < 5000 )); then touch "$state/wake-during-off" echo "$press" >"$state/woke-on-press" # A dark phone wakes as the key goes down, as Android's does # (it wakes on the press, not the release), so the screen answers the # press itself. The release then has nothing left to do (short_press # sees the mark). - elif panel_dark; then + elif [[ $android_power == 1 ]] && panel_dark; then echo "$press" >"$state/woke-on-press" serially wake_locked >/dev/null 2>&1 & fi @@ -412,16 +499,31 @@ case "${1:-}" in rm -f "$state/chord" elif [[ -f $state/long ]]; then rm -f "$state/long" "$state/woke-on-press" - else + elif [[ $android_power == 1 ]]; then + # One lock for every key action (serially), so no second one here. serially short_press "$(now)" + else + # Let a second press observe the finished off transition before it + # decides whether to wake. Keep the lock out of background helpers. + released_at=$(now) + exec {short_lock}>"$state/short.lock" + # A stuck action must not queue every later press forever. Drop this + # press after five seconds rather than overlap display transitions. + if ! flock -w 5 "$short_lock"; then + echo 'omamobile-keys: short-press lock wait failed; dropping press' >&2 + exit 0 + fi + ( short_press "$released_at" ) {short_lock}>&- fi ;; wake) # omamobile-sleepd after a power-key wake from sleep: Hyprland never sees # the press that woke the phone, so light the PIN pad as that press would. now >"$state/power-wake" + if [[ $android_power != 1 ]]; then + if locked && screen_off; then wake_locked; fi # The quick check (a file read), as the press's own wake. - if panel_dark; then serially wake_locked; fi + elif panel_dark; then serially wake_locked; fi ;; double-tap) # omamobile-doubletap: a double tap on the touchscreen. Only a dark diff --git a/packages/omamobile-shell/bin/omamobile-sleepd b/packages/omamobile-shell/bin/omamobile-sleepd index 208685dca..853fd1981 100755 --- a/packages/omamobile-shell/bin/omamobile-sleepd +++ b/packages/omamobile-shell/bin/omamobile-sleepd @@ -201,8 +201,9 @@ watch() { # this loop mid-pause while it sleeps, and the pause's clock doesn't count # the sleep, so a 2 s pause left up to 2 s between a power-key wake and the # lit lock screen (Ángel, 6-nov: slow to light after a while off). Only - # until a retry is due, so a refused sleep doesn't keep it spinning. - if ((requested >= 0 && t - requested < retry)); then pause 0.2; else pause "$poll"; fi + # until a retry is due, so a refused sleep doesn't keep it spinning. With + # the power key as Android's (OMAMOBILE_POWER_KEY_ANDROID=1, omamobile-keys). + if [[ ${OMAMOBILE_POWER_KEY_ANDROID:-} == 1 ]] && ((requested >= 0 && t - requested < retry)); then pause 0.2; else pause "$poll"; fi done } diff --git a/packages/omamobile-shell/test/all b/packages/omamobile-shell/test/all index fc58d8298..1aa56d947 100755 --- a/packages/omamobile-shell/test/all +++ b/packages/omamobile-shell/test/all @@ -1073,7 +1073,8 @@ sys.exit(1 if bad else 0) PY pass "Mobile network page" bash -n bin/omamobile-sleepd || fail "omamobile-sleepd parses" -bash test/sleepd.sh || fail "omamobile-sleepd" +env -u OMAMOBILE_POWER_KEY_ANDROID bash test/sleepd.sh || fail "omamobile-sleepd" +OMAMOBILE_POWER_KEY_ANDROID=1 bash test/sleepd.sh || fail "omamobile-sleepd, with the power key as Android's" python3 -B -c 'import ast,sys; ast.parse(open(sys.argv[1]).read())' bin/omamobile-doubletap || fail "omamobile-doubletap parses" python3 -B test/doubletap.py >/dev/null || { python3 -B test/doubletap.py | grep -v '^ok'; fail "omamobile-doubletap"; } pass "omamobile-doubletap: double taps and the touchscreen by its capabilities" @@ -1156,7 +1157,8 @@ grep -c 'Copyright (c) 2026 Simon Schubert and contributors' widgets/OWL.md >/de grep -c 'd355bdb2789f7bd1023d88b17f8a2898dc0ffa2b' widgets/OWL.md >/dev/null || fail "the OWL guide names its source commit" pass "install stages the package" -test/keys.sh || fail "omamobile-keys volume keys" +env -u OMAMOBILE_POWER_KEY_ANDROID test/keys.sh || fail "omamobile-keys volume keys" +OMAMOBILE_POWER_KEY_ANDROID=1 test/keys.sh || fail "omamobile-keys, with the power key as Android's" # Back threshold feedback handler state only; never invoke feedbackd. rc=0; out=$(python3 -B test/back-haptic.py 2>&1) || rc=$? @@ -1167,4 +1169,4 @@ elif [[ $rc != 0 ]]; then else pass "Back threshold feedback: once per gesture, both edges and retreat" fi -bash test/power-overlap.sh || fail "overlapping power-key presses" +env -u OMAMOBILE_POWER_KEY_ANDROID bash test/power-overlap.sh || fail "overlapping power-key presses" diff --git a/packages/omamobile-shell/test/keys.sh b/packages/omamobile-shell/test/keys.sh index c13f42c54..9c17a3e09 100755 --- a/packages/omamobile-shell/test/keys.sh +++ b/packages/omamobile-shell/test/keys.sh @@ -86,6 +86,15 @@ press() { reset; keys power-down; keys power-up; sleep 0.5; } before() { awk -v a="$1" -v b="$2" '{ sub(/ +$/, "") } $0 == a && !x { x = NR } $0 == b && !y { y = NR } END { exit !(x && y && x < y) }' "$log"; } echo false >"$t/locked"; echo true >"$t/dpms" press; grep -q "omarchy-system-lock" "$log" || fail "unlocked and lit: a press locks" +# OMAMOBILE_POWER_KEY_ANDROID=1 (device-panther): Android's fade to black +# first, the shell's screenOff, then the panel off before the lock. Off, as +# before: no fade, the lock first. +if [[ ${OMAMOBILE_POWER_KEY_ANDROID:-} == 1 ]]; then + before "omarchy-shell shell call omamobile.home screenOff" "omarchy-system-lock" \ + || fail "unlocked and lit, as Android's: the fade to black first, then the lock" +else + grep -q "screenOff" "$log" && fail "unlocked and lit, shared default: no fade, as before" +fi before "omarchy-system-lock" "omarchy-shell lock dark" && before "omarchy-shell lock dark" "omarchy-brightness-display off" \ || fail "unlocked and lit: the new lock hears it goes dark, before the panel goes off" echo false >"$t/locked"; echo false >"$t/dpms" From 48ec440eb94b00b260fa68be229ae08cbbf1c0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Tue, 10 Nov 2026 09:12:33 +0100 Subject: [PATCH 11/15] omamobile-keys: an English paraphrase next to the two quoted reports --- packages/omamobile-shell/bin/omamobile-keys | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index 976133e11..d43ff4cc8 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -208,7 +208,8 @@ serially() { short_press() { # $1: when the key came up. The work may start later, behind the press # before (serially), and timing it from then threw quick presses away as - # bounces (Ángel, 6-nov: "los toques rápidos no los detecta bien"). + # bounces (Ángel, 6-nov: "los toques rápidos no los detecta bien", quick + # presses aren't picked up well). local up=${1:-$(now)} # This press already woke the phone as it went down (power-down). if [[ -f $state/woke-on-press ]] && (( up - $(<"$state/woke-on-press") < 5000 )); then @@ -248,7 +249,8 @@ short_press() { # Off at once, as on Android: the panel powered off first, then the lock # taken behind it. The backlight at 0 alone only dimmed a Pixel 7's OLED, # so the lock showed dim before the screen went off (Ángel, 6-nov: "se - # atenúa, va a la pantalla de bloqueo y luego se apaga"). The brightness + # atenúa, va a la pantalla de bloqueo y luego se apaga", it dims, goes to + # the lock screen and only then turns off). The brightness # goes to 0 too, for a panel DPMS doesn't reach; it comes back below, # once the panel is off, for the next wake. local device level= From 2c075e939b2eb10146d171125af3ecb6fb917d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Thu, 12 Nov 2026 15:59:30 +0100 Subject: [PATCH 12/15] omamobile-keys: the Android press's comment gives wait_screen_off's 1 s I used AI help (Claude) to work on this. --- packages/omamobile-shell/bin/omamobile-keys | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/omamobile-shell/bin/omamobile-keys b/packages/omamobile-shell/bin/omamobile-keys index 8cd6c0ff7..5d7f71686 100644 --- a/packages/omamobile-shell/bin/omamobile-keys +++ b/packages/omamobile-shell/bin/omamobile-keys @@ -327,8 +327,8 @@ short_press() { # takes it down about 0.4 s after the dispatch on a Pixel 7 (bl_power goes # to 4 then), and putting the level back before that lit the lock screen # for a moment (Ángel, 6-nov: "vuelve a la pantalla de bloqueo antes de - # apagar la pantalla"). At most 1.5 s, for a panel whose bl_power never - # says so. + # apagar la pantalla"). At most 1 s (wait_screen_off), for a panel that + # never says so. wait_screen_off "$device" if [[ -n $device ]]; then [[ -n $level ]] && brightnessctl -q -d "$device" set "$level" || brightnessctl -q -d "$device" set 40% From 2a3658fd0e223bd6564e0c3fb441d39d692429bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Thu, 12 Nov 2026 19:08:39 +0100 Subject: [PATCH 13/15] omamobile-sleepd: drop the 0.2 s poll while waiting to sleep Measured on the Pixel 7 (12 Nov), power-key wake from a real s2idle sleep to the lit lock screen (bl_power 0), the press timed from the key's evdev event: with the 0.2 s poll 0.66 s (1 wake), without it 0.70 s and 0.76 s (2 wakes). Without the poll it could have taken up to 2 s more; it didn't, because logind's PrepareForSleep(false) already ends the watcher's pause at once (test/sleepd.sh checks that). The poll added nothing, so omamobile-sleepd, its test and test/all's sleepd line are back to main's. I used AI help (Claude) to work on this. --- packages/omamobile-shell/bin/omamobile-sleepd | 8 +------- packages/omamobile-shell/test/all | 3 +-- packages/omamobile-shell/test/sleepd.sh | 4 +--- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/omamobile-shell/bin/omamobile-sleepd b/packages/omamobile-shell/bin/omamobile-sleepd index 2e54bc57b..c93da4adc 100755 --- a/packages/omamobile-shell/bin/omamobile-sleepd +++ b/packages/omamobile-shell/bin/omamobile-sleepd @@ -243,13 +243,7 @@ watch() { request "$cause" fi fi - # Asked to sleep and not yet seen to wake: every 0.2 s. The phone freezes - # this loop mid-pause while it sleeps, and the pause's clock doesn't count - # the sleep, so a 2 s pause left up to 2 s between a power-key wake and the - # lit lock screen (Ángel, 6-nov: slow to light after a while off). Only - # until a retry is due, so a refused sleep doesn't keep it spinning. With - # the power key as Android's (OMAMOBILE_POWER_KEY_ANDROID=1, omamobile-keys). - if [[ ${OMAMOBILE_POWER_KEY_ANDROID:-} == 1 ]] && ((requested >= 0 && t - requested < retry)); then pause 0.2; else pause "$poll"; fi + pause "$poll" done } diff --git a/packages/omamobile-shell/test/all b/packages/omamobile-shell/test/all index 88dd32ad1..79672bcd5 100755 --- a/packages/omamobile-shell/test/all +++ b/packages/omamobile-shell/test/all @@ -1142,8 +1142,7 @@ sys.exit(1 if bad else 0) PY pass "Mobile network page" bash -n bin/omamobile-sleepd || fail "omamobile-sleepd parses" -env -u OMAMOBILE_POWER_KEY_ANDROID bash test/sleepd.sh || fail "omamobile-sleepd" -OMAMOBILE_POWER_KEY_ANDROID=1 bash test/sleepd.sh || fail "omamobile-sleepd, with the power key as Android's" +bash test/sleepd.sh || fail "omamobile-sleepd" python3 -B -c 'import ast,sys; ast.parse(open(sys.argv[1]).read())' bin/omamobile-doubletap || fail "omamobile-doubletap parses" python3 -B test/doubletap.py >/dev/null || { python3 -B test/doubletap.py | grep -v '^ok'; fail "omamobile-doubletap"; } pass "omamobile-doubletap: double taps and the touchscreen by its capabilities" diff --git a/packages/omamobile-shell/test/sleepd.sh b/packages/omamobile-shell/test/sleepd.sh index b92964650..56301d753 100755 --- a/packages/omamobile-shell/test/sleepd.sh +++ b/packages/omamobile-shell/test/sleepd.sh @@ -12,9 +12,7 @@ F=$t/bin; mkdir -p "$F" "$t/sys/power/suspend_stats" "$t/sys/class/backlight/pan fail() { printf 'not ok - %s\n' "$1" >&2; sed 's/^/# /' "$t/log" "$t/out" >&2 2>/dev/null; exit 1; } fake() { printf '#!/bin/bash\nT=%q\n%s\n' "$t" "$2" >"$F/$1"; chmod +x "$F/$1"; } -# (a pause under a second, the watcher's 0.2 s while it waits to sleep, moves -# the fake clock a whole second, or it would never move) -fake sleep 's=${1%%.*}; ((s > 0)) || s=1; echo $(( $(cat "$T/clock") + s )) >"$T/clock" +fake sleep 'echo $(( $(cat "$T/clock") + ${1%%.*} )) >"$T/clock" # "the user presses power" at a given time: the watcher gets its signal. if [[ -f $T/now_at ]] && (( $(cat "$T/clock") >= $(cat "$T/now_at") )); then rm -f "$T/now_at"; kill -USR1 $PPID; fi # A one-shot real hang that moves no clock: the frozen sleep of a phone that From 657c88a07668447b99bc989d1017c2256775676c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Fri, 13 Nov 2026 18:02:18 +0100 Subject: [PATCH 14/15] device-panther: the power key's switch is read by omamobile-keys alone omamobile-sleepd no longer reads OMAMOBILE_POWER_KEY_ANDROID since its 0.2 s poll went (2a3658fd): the environment.d file's comment and the README named it still. I used AI help (Claude) to work on this. --- packages/omamobile-device-panther/README.md | 2 +- .../vendor/environment.d/40-omamobile-power-key.conf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/omamobile-device-panther/README.md b/packages/omamobile-device-panther/README.md index d44e96647..996b5ef0e 100644 --- a/packages/omamobile-device-panther/README.md +++ b/packages/omamobile-device-panther/README.md @@ -5,7 +5,7 @@ Omarchy Mobile's first userspace package for the Google Pixel 7 (codename panthe | Path | Installs to | What it does | | --- | --- | --- | | `vendor/environment.d/40-omamobile-rotation.conf` | `/usr/lib/environment.d` | `OMAMOBILE_ROTATION_HOLD=1`: Hyprland (packages/hyprland, 0002) holds the last frame across a rotation and turns the new one in as Android does. Off in the shared build until it has run on the other phones | -| `vendor/environment.d/40-omamobile-power-key.conf` | `/usr/lib/environment.d` | `OMAMOBILE_POWER_KEY_ANDROID=1`: the power key as Android's (omamobile-keys, omamobile-sleepd): a dark phone wakes on the press, a short press turns the panel off at once and locks behind it. Off in the shared shell until it has run on the other phones | +| `vendor/environment.d/40-omamobile-power-key.conf` | `/usr/lib/environment.d` | `OMAMOBILE_POWER_KEY_ANDROID=1`: the power key as Android's (omamobile-keys): a dark phone wakes on the press, a short press turns the panel off at once and locks behind it. Off in the shared shell until it has run on the other phones | | `vendor/systemd/system/omamobile-speaker-protection.service.d/50-panther-default-cal.conf` | `/usr/lib/systemd/system/omamobile-speaker-protection.service.d` | `OMAMOBILE_SPK_DEFAULT_CAL=1`: a Pixel 7 with no `speaker.cal` in persist runs its speakers on the protection firmware's default calibration, as stock does (omamobile-audio 0.5.16; c9 and `verify` stay refused). A phone with `speaker.cal` still uses it; a line in `/etc/omamobile/speaker.conf` overrides it | | `vendor/udev/rules.d/10-omamobile-storage.rules` | `/usr/lib/udev/rules.d` | Hides `sda` and every Android partition except `userdata` from desktop tools. Same rule as the Pixel 7 Pro. The initramfs stops its guard loop before `switch_root`; the kernel's read-only flags are what remain | | `vendor/udev/rules.d/20-omamobile-gpu-always-on.rules` | `/usr/lib/udev/rules.d` | Keeps the Mali-G710 powered while Panthor drives it: powering its domain back up needs a secure call our kernel doesn't make yet. Same rule as the Pixel 7 Pro | diff --git a/packages/omamobile-device-panther/vendor/environment.d/40-omamobile-power-key.conf b/packages/omamobile-device-panther/vendor/environment.d/40-omamobile-power-key.conf index 06030fe50..9e74493e3 100644 --- a/packages/omamobile-device-panther/vendor/environment.d/40-omamobile-power-key.conf +++ b/packages/omamobile-device-panther/vendor/environment.d/40-omamobile-power-key.conf @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT -# Omarchy Mobile: the power key as Android's (omamobile-keys and -# omamobile-sleepd, packages/omamobile-shell): a dark phone wakes on the -# press, a short press turns the panel off at once and locks behind it. +# Omarchy Mobile: the power key as Android's (omamobile-keys, +# packages/omamobile-shell): a dark phone wakes on the press, a short +# press turns the panel off at once and locks behind it. # The order is the reverse of the shared default's on purpose: the panel # goes off first and the lock follows behind it, where the default locks # and then powers the panel off. That is why it stays off on the other From 1f7b4bc04e4495242e34886a23c7fcba6a6386ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Sun, 15 Nov 2026 20:50:57 +0100 Subject: [PATCH 15/15] omamobile-shell 0.2.133, device-panther 0.1.16 The version numbers for this pull request. omamobile-shell takes 0.2.133 because #425 took 0.2.132 on main. Co-Authored-By: Claude Opus 5.5 --- packages/omamobile-device-panther/version | 2 +- packages/omamobile-shell/version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/omamobile-device-panther/version b/packages/omamobile-device-panther/version index 71d6a66ed..e8e277f2f 100644 --- a/packages/omamobile-device-panther/version +++ b/packages/omamobile-device-panther/version @@ -1 +1 @@ -0.1.14 +0.1.16 diff --git a/packages/omamobile-shell/version b/packages/omamobile-shell/version index 6cf0bd9e1..89bb7cae3 100644 --- a/packages/omamobile-shell/version +++ b/packages/omamobile-shell/version @@ -1 +1 @@ -0.2.126 +0.2.133