Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

339 changes: 303 additions & 36 deletions packages/omamobile-omarchy/test/lock-glance.qml

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions packages/omamobile-omarchy/test/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,21 @@ def lock_glance(root):
ok(len(wake) == 2 and "root.wakeSerial += 1" in wake[1].split("}", 1)[0]
and "wakeSerial: root.wakeSerial" in service,
"real omarchy: the wake call brings the glance back (0023)")
blank = service.split("function runBlank() {", 1)
dark = service.split("function dark(): string {", 1)
run_wake = service.split("function runWake() {", 1)
ok(len(blank) == 2 and "markDark()" in blank[1].split("}", 1)[0]
and len(dark) == 2 and "root.markDark()" in dark[1].split("}", 1)[0]
and len(run_wake) == 2 and "displayDark = false" in run_wake[1].split("}", 1)[0]
and "blankSerial: root.blankSerial" in service and "displayDark: root.displayDark" in service,
"real omarchy: the lock's blank and the dark call bring the glance back, a wake lights it (0023)")
ok("maximumLineCount: root.summaryLines" in card and "maximumLineCount: root.bodyLines" in card
and "property int summaryLines: 2" in card and "property int bodyLines: 3" in card,
"real omarchy: notification toasts keep their line counts (0023)")
glance = read(root, lock + "LockGlance.qml") + read(root, lock + "LockGlance.js")
ok("XMLHttpRequest" not in glance and "curl" not in glance and "execDetached" not in glance,
"real omarchy: the glance asks no network and runs nothing (0023)")
ok("XMLHttpRequest" not in glance and "curl" not in glance and "execDetached" not in glance
and "call notifications forget" in glance and "invokeAction" not in glance,
"real omarchy: the glance asks no network and runs no notification action, only the forget call (0023)")
p = subprocess.run(["bash", os.path.join(HERE, "lock-glance"), os.path.join(root, "usr/share/omarchy/shell")],
capture_output=True, text=True)
if p.returncode == 77:
Expand Down
2 changes: 1 addition & 1 deletion packages/omamobile-omarchy/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.16
0.1.17
1 change: 1 addition & 0 deletions packages/omamobile-shell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Omarchy Mobile's phone profile for Omarchy's own shell. It isn't a fork: these a
| `bin/omamobile-osk-watch` | Reports squeekboard's visibility (sm.puri.OSK0) to the fingerprint, keyboard and launcher plugins |
| `bin/omamobile-osk-guard` | Turns the on-screen keyboard (`screen-keyboard-enabled`) back on when it was left off with no screensaver running (a user unit for every graphical session) |
| `bin/omamobile-sleepd` | Sleep (s2idle) once the screen has been off behind a secure lock for `OMAMOBILE_SLEEP_AFTER_OFF` s (30), and again 5 s after a dark resume; `now` for the power key (`omamobile-keys`), `check` to see what holds it awake. Refuses with the screen on, Stay awake on, an SSH session open, a logind sleep block inhibitor (calls, GNSS) or a RUNNING PipeWire sink. A user unit for every graphical session, **off until `omarchy-toggle omamobile-sleep on`** (device/cheetah/SUSPEND-PLAN.md 6.2) |
| `bin/omamobile-weather` | The current weather for the lock screen's glance (`~/.local/state/omamobile/weather.json`, with the `source` it used) from Open-Meteo, at login and every 30 minutes (`omamobile-weather.timer`, a user unit for every graphical session). Where, in order: the phone's position from GeoClue at city accuracy, at most every 3 h and only while the Location switch runs GeoClue's agent (never a prompt); the setting `~/.config/omamobile/weather.json` (`omamobile-weather set "State College, PA" F`, or `{"latitude", "longitude"}`; `"location": "fixed"` puts it before the position); the home screen's today widget's city, or the weather widget's named place. Unit: the setting's, else the locale's. One try per run; a failure keeps the old reading. `omamobile-weather show` says where it would look |
| `bin/omamobile-fp-enroll` | fprintd enrollment helper the fingerprint screen runs (JSON lines) |
| `bin/omamobile-bt-agent` | BlueZ pairing agent and discovery helper the quick-settings Bluetooth panel runs while open |
| `bin/omamobile-portal-access` | The xdg-desktop-portal Access backend (`org.freedesktop.impl.portal.desktop.omamobile`, a D-Bus-activated user unit) that shows the permission sheet and answers the portal |
Expand Down
12 changes: 11 additions & 1 deletion packages/omamobile-shell/bin/omamobile-keys
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# power, short unlocked: lock and turn the screen off
# unlocked, dark: screen on (nothing locked it, or the
# panel was powered off by hand)
# locked: screen off if it's on, on (PIN pad) if it's off
# locked: screen off if it's on (the lock goes back to
# its glance view), on if it's off
# screensaver up: lock (it wakes to the PIN pad)
# a press that turned the screen off behind a secure
# lock also asks omamobile-sleepd to sleep now (it does
Expand Down Expand Up @@ -107,6 +108,13 @@ chord() {
(sleep 0.4; omarchy-capture-screenshot fullscreen) >/dev/null 2>&1 &
}

# The locked screen is going dark: the lock goes back to its glance view, so
# whatever wakes it next finds the glance, and the touch that wakes it only
# wakes it (patches/omarchy/0023). An older lock without the call ignores it.
lock_dark() {
omarchy-shell lock dark >/dev/null 2>&1
}

# The screen just went off: sleep now if the lock is secure (SUSPEND-PLAN
# 6.1). omamobile-sleepd checks the toggle, the screen and its inhibitors
# itself; in the background, so the key handler returns at once.
Expand Down Expand Up @@ -143,6 +151,7 @@ short_press() {
if screen_off; then
wake_locked
else
lock_dark
omarchy-brightness-display off
sleep_now
fi
Expand Down Expand Up @@ -174,6 +183,7 @@ short_press() {
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.
Expand Down
5 changes: 5 additions & 0 deletions packages/omamobile-shell/bin/omamobile-sleepd
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ wake_reason() {

request() {
log "sleeping ($1)"
# The lock goes back to its glance view before the freeze, for a screen
# that went dark some way that didn't tell it (patches/omarchy/0023): the
# next wake finds the glance, and a touch that wakes it only wakes it.
# Bounded: a stuck shell must not hold the watcher up.
timeout 3 omarchy-shell lock dark >/dev/null 2>&1
systemctl suspend 2>&1 | sed 's/^/omamobile-sleepd: systemctl: /'
}

Expand Down
Loading