diff --git a/packages/omamobile-shell/bin/omamobile-setup-user b/packages/omamobile-shell/bin/omamobile-setup-user index 5c827813e..aa325d43b 100755 --- a/packages/omamobile-shell/bin/omamobile-setup-user +++ b/packages/omamobile-shell/bin/omamobile-setup-user @@ -141,6 +141,15 @@ o.launch_on_start("squeekboard") LUA fi +# Files (Nautilus) opens folders with one tap: a double tap is a mouse habit +# (issue #261). Set once, so a user who goes back to double-click keeps it; +# skipped when this Nautilus has no click-policy key, so a release that drops +# it can't break the login setup. +if gsettings list-keys org.gnome.nautilus.preferences 2>/dev/null | grep -qx click-policy \ + && omarchy-done ensure omamobile-files-single-tap; then + gsettings set org.gnome.nautilus.preferences click-policy single +fi + # Terminals get squeekboard's terminal layout (Tab, Ctrl, Alt, arrows); ours # adds Esc to its top row, for vim and friends. squeekboard reads layouts only # from the user's data dir, so link ours there unless the user has their own. diff --git a/packages/omamobile-shell/test/setup-user.sh b/packages/omamobile-shell/test/setup-user.sh index 0972031c1..b5fd6aebc 100644 --- a/packages/omamobile-shell/test/setup-user.sh +++ b/packages/omamobile-shell/test/setup-user.sh @@ -18,7 +18,12 @@ case $1 in ensure) [[ -e $d/$2 ]] && exit 1; touch "$d/$2" ;; mark) touch "$d/$2" ;; esac' -fake gsettings 'echo "gsettings $*" >>"$HOME/calls"' +# gsettings: logs calls; list-keys answers for Nautilus (click-policy unless +# GSETTINGS_NO_CLICK_POLICY plays a Nautilus without the key) +fake gsettings 'echo "gsettings $*" >>"$HOME/calls" +if [[ $1 == list-keys && $2 == org.gnome.nautilus.preferences ]]; then + printf "default-folder-viewer\n"; [[ -n ${GSETTINGS_NO_CLICK_POLICY:-} ]] || printf "click-policy\n" +fi' fake systemctl 'echo "systemctl $*" >>"$HOME/calls"' fake chromium 'echo "Chromium 153.0.0.0"' fake omamobile-keyboard-theme 'echo "omamobile-keyboard-theme $*" >>"$HOME/calls"' @@ -49,6 +54,7 @@ done run() { env -i HOME="${RUN_HOME:-$H}" PATH="$F:/usr/bin:/bin" XDG_RUNTIME_DIR="$t" OMAMOBILE_SHELL_SHARE="$pkg" OMAMOBILE_SYSTEM_APPLICATIONS="$A" \ OMAMOBILE_DT="${RUN_DT:-$t/dt-gs201-cheetah}" OMAMOBILE_SQUEEKBOARD_SHARE="$pkg/squeekboard/keyboards" \ + GSETTINGS_NO_CLICK_POLICY="${GSETTINGS_NO_CLICK_POLICY:-}" \ bash bin/omamobile-setup-user >"$t/out" 2>&1 || { cat "$t/out"; fail "omamobile-setup-user runs"; } } run @@ -255,3 +261,14 @@ RUN_HOME=$hk run || fail "a layout the user wrote stays" [[ -L $hk/.local/share/squeekboard/keyboards/fr.yaml ]] || fail "the others are linked beside it" pass "the keyboard: a layout of the user's own stays" + +# Files opens folders with one tap (issue #261): set once (H ran three times), +# and not at all on a Nautilus without the click-policy key +[[ $(grep -c '^gsettings set org.gnome.nautilus.preferences click-policy single$' "$H/calls") == 1 ]] \ + || fail "Nautilus's click-policy is set to single once" +hn=$t/no-click-policy; mkdir -p "$hn/.config/hypr" "$hn/.config/omarchy/extensions" +cp "$H"/.config/hypr/{looknfeel,autostart,monitors}.lua "$hn/.config/hypr/" +RUN_HOME=$hn GSETTINGS_NO_CLICK_POLICY=1 run +grep -q '^gsettings set org.gnome.nautilus.preferences' "$hn/calls" && fail "nothing is set on a Nautilus without click-policy" +[[ ! -e $hn/.local/state/omarchy/done/omamobile-files-single-tap ]] || fail "the step isn't marked done when the key is missing" +pass "Files: one tap opens a folder, set once, skipped on a Nautilus without the key" diff --git a/packages/omamobile-shell/version b/packages/omamobile-shell/version index 69d48bba4..b816fa806 100644 --- a/packages/omamobile-shell/version +++ b/packages/omamobile-shell/version @@ -1 +1 @@ -0.2.66 +0.2.69