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
12 changes: 12 additions & 0 deletions packages/omamobile-shell/bin/omamobile-setup-user
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,18 @@ if omarchy-done ensure omamobile-chromium-mobile; then
echo "\"--user-agent=Mozilla/5.0 (Linux; Android 14; Pixel 7 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${major:-153}.0.0.0 Mobile Safari/537.36\"" >>"$flags"
fi

# Auto-sleep (omamobile-sleepd: s2idle 30 s after the screen goes off behind
# a secure lock), once, on a phone whose device package says its suspend is
# verified (/usr/share/omamobile/auto-sleep-default; device/<codename>'s
# SUSPEND-PLAN). The user's later choice stays: this runs once, and the
# toggle (omarchy-toggle omamobile-sleep off) turns it off for good. With the
# modem up the phone still doesn't sleep: the modem holds a sleep inhibitor.
if [[ -e ${OMAMOBILE_AUTO_SLEEP_DEFAULT:-/usr/share/omamobile/auto-sleep-default} ]] &&
omarchy-done ensure omamobile-auto-sleep-on; then
mkdir -p ~/.local/state/omarchy/toggles
touch ~/.local/state/omarchy/toggles/omamobile-sleep
fi

# Lock screen: Omarchy's lock with a number pad (lock-keypad toggle, see
# patches/omarchy/0003-*), since its session lock hides the on-screen keyboard.
if omarchy-done ensure omamobile-lock-keypad; then
Expand Down
10 changes: 8 additions & 2 deletions packages/omamobile-shell/test/all
Original file line number Diff line number Diff line change
Expand Up @@ -1206,9 +1206,15 @@ grep -cx 'ExecStart=/usr/bin/omamobile-weather' systemd/user/omamobile-weather.s
&& grep -cx 'Unit=omamobile-weather.service' systemd/user/omamobile-weather.timer >/dev/null \
|| fail "the weather timer runs the one-shot service every 30 minutes"
pass "the lock screen's weather runs at login and every 30 minutes"
if grep -rnE '^[^#]*(omarchy-toggle omamobile-sleep( on| toggle|$)|toggles/omamobile-sleep)' bin install systemd plugins; then
fail "nothing turns the omamobile-sleep toggle on by default"
# Auto-sleep is on by default only where the device package says suspend is
# verified: setup-user's one step, gated on auto-sleep-default (its behaviour
# is test/setup-user.sh's). Nothing else turns the toggle on.
if grep -rnE '^[^#]*(omarchy-toggle omamobile-sleep( on| toggle|$)|toggles/omamobile-sleep)' bin install systemd plugins |
grep -vE '^bin/omamobile-setup-user:[0-9]+: touch ~/\.local/state/omarchy/toggles/omamobile-sleep$'; then
fail "nothing but the device-gated setup step turns the omamobile-sleep toggle on by default"
fi
grep -B3 'touch ~/.local/state/omarchy/toggles/omamobile-sleep$' bin/omamobile-setup-user | grep -c 'auto-sleep-default' >/dev/null ||
fail "setup-user turns auto-sleep on only behind the device's auto-sleep-default"
[[ -x $tmp/root/usr/bin/omamobile-setup-user ]] || fail "setup-user is installed where the unit runs it"
[[ -x $tmp/root/usr/bin/omamobile-portal-access && -f $tmp/root/usr/share/xdg-desktop-portal/portals/omamobile.portal \
&& -f $tmp/root/etc/xdg/xdg-desktop-portal/hyprland-portals.conf \
Expand Down
16 changes: 16 additions & 0 deletions packages/omamobile-shell/test/setup-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ run() {
OMAMOBILE_VOICE_MODELS="${RUN_VOICE_MODELS:-$t/no-voice-models}" OMAMOBILE_VOXTYPE="${RUN_VOXTYPE:-voxtype}" \
OMARCHY_PATH="${RUN_OMARCHY_PATH:-$t/omarchy}" \
OMAMOBILE_USER_UNITS="${RUN_USER_UNITS:-$t/no-user-units}" \
OMAMOBILE_AUTO_SLEEP_DEFAULT="${RUN_AUTO_SLEEP:-$t/no-auto-sleep-default}" \
bash bin/omamobile-setup-user "$@" >"$t/out" 2>&1 || { cat "$t/out"; fail "omamobile-setup-user runs"; }
}
run
Expand Down Expand Up @@ -484,3 +485,18 @@ for gliff in no yes; do
done
rm -f "$F/gliff-server"
pass "Omarchy's remote session is off on every phone, once, with or without gliff, and a user can turn it back on"

# Auto-sleep: on once where the device package says suspend is verified;
# off by default elsewhere; a user who turns it off keeps it off.
ha=$t/auto-sleep; mkdir -p "$ha/.config/hypr" "$ha/.local/state/omarchy/done"
cp "$H"/.config/hypr/*.lua "$ha/.config/hypr/"
touch "$ha/.local/state/omarchy/done/omamobile-shell-profile"
RUN_HOME=$ha run
[[ ! -e $ha/.local/state/omarchy/toggles/omamobile-sleep ]] || fail "no device flag: auto-sleep stays off"
touch "$t/auto-sleep-default"
RUN_HOME=$ha RUN_AUTO_SLEEP=$t/auto-sleep-default run
[[ -e $ha/.local/state/omarchy/toggles/omamobile-sleep ]] || fail "the device flag turns auto-sleep on"
rm "$ha/.local/state/omarchy/toggles/omamobile-sleep"
RUN_HOME=$ha RUN_AUTO_SLEEP=$t/auto-sleep-default run
[[ ! -e $ha/.local/state/omarchy/toggles/omamobile-sleep ]] || fail "a user who turns auto-sleep off keeps it off"
pass "auto-sleep: on once where the device says suspend is verified, a user's off kept"
2 changes: 1 addition & 1 deletion packages/omamobile-shell/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.127
0.2.129