Skip to content
Closed
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
17 changes: 14 additions & 3 deletions packages/omamobile-shell/bin/omamobile-setup-user
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,25 @@ if omarchy-done ensure omamobile-suspend-off; then
touch ~/.local/state/omarchy/toggles/suspend-off
fi

# Phone window rules (apps fill the screen instead of floating at desktop
# sizes), loaded after Omarchy's defaults from the user's override file, once.
# Phone window and layer rules (apps fill the screen instead of floating at
# desktop sizes; the fingerprint target, the keyboard and the call card draw
# above the lock), loaded after Omarchy's defaults from the user's override
# file, once. Omarchy's hyprland.lua requires looknfeel.lua, so the dofile
# goes there; a hyprland.lua of the user's own that never loads looknfeel.lua
# (a bring-up gate, say) gets it appended directly, or the rules would never
# run and the fingerprint target would sit under the lock, unseen.
if omarchy-done ensure omamobile-phone-rules; then
cat >>~/.config/hypr/looknfeel.lua <<LUA
phone_rules_target=~/.config/hypr/looknfeel.lua
if [[ -f ~/.config/hypr/hyprland.lua ]] && ! grep -q 'looknfeel' ~/.config/hypr/hyprland.lua; then
phone_rules_target=~/.config/hypr/hyprland.lua
fi
if ! grep -qs 'hypr/phone\.lua' ~/.config/hypr/*.lua; then
cat >>"$phone_rules_target" <<LUA

-- Omarchy Mobile: phone window rules
dofile("$share/hypr/phone.lua")
LUA
fi
fi

# Chromium's first-run dialogs are desktop-sized: their buttons land off a
Expand Down
15 changes: 15 additions & 0 deletions packages/omamobile-shell/test/setup-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,21 @@ RUN_HOME=$t/own run
[[ $(idle "$t/own") == '{"screensaver": 300, "lock": 0}' ]] && ! toggle "$t/own" || fail "a user's own idle block is kept, and their screensaver"
pass "idle: lock after a minute, no screensaver, unless the user set their own"

# The phone rules land where Hyprland reads them: looknfeel.lua under
# Omarchy's hyprland.lua, hyprland.lua itself when the user's own file never
# loads looknfeel.lua (a bring-up gate); never twice.
grep -c 'dofile(".*hypr/phone.lua")' "$H/.config/hypr/looknfeel.lua" >/dev/null || fail "the phone rules are loaded from looknfeel.lua"
[[ $(grep -c 'hypr/phone.lua' "$H/.config/hypr/looknfeel.lua") == 1 ]] || fail "the phone rules are added once"
mkdir -p "$t/gate/.config/hypr" "$t/gate/.config/omarchy/extensions"
printf 'dofile("/usr/share/omarchy/default/hypr/bootstrap.lua")\nrequire("default.hypr.omarchy")\n' >"$t/gate/.config/hypr/hyprland.lua"
for f in monitors looknfeel autostart; do echo "-- $f" >"$t/gate/.config/hypr/$f.lua"; done
printf 'local omarchy_gdk_scale = 2\nlocal omarchy_monitor_scale = "auto"\n' >"$t/gate/.config/hypr/monitors.lua"
cp "$H/.config/omarchy/extensions/omarchy-menu.jsonc" "$t/gate/.config/omarchy/extensions/"
RUN_HOME=$t/gate run
grep -c 'dofile(".*hypr/phone.lua")' "$t/gate/.config/hypr/hyprland.lua" >/dev/null || fail "a hyprland.lua that skips looknfeel.lua gets the phone rules itself"
grep -c 'hypr/phone.lua' "$t/gate/.config/hypr/looknfeel.lua" >/dev/null && fail "the phone rules aren't put where Hyprland never reads them"
pass "the phone rules go to the file Hyprland loads, once"

# GDK_SCALE follows the phone's monitor scale (TOUCH-PLAN 2.8)
grep -cx 'local omarchy_monitor_scale = 3' "$H/.config/hypr/monitors.lua" >/dev/null || fail "the monitor scale is 3"
grep -cx 'local omarchy_gdk_scale = 3' "$H/.config/hypr/monitors.lua" >/dev/null || fail "GDK_SCALE is 3 with it"
Expand Down
2 changes: 1 addition & 1 deletion packages/omamobile-shell/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.45
0.2.47