Search from the launcher, and give the touchpad something to do
Four things a Hyprland desktop can do that this one was not. Searching from the launcher needed no launcher work at all: Vicinae already models it, so this is a script command with one percent-encoded argument. Make it the fallback command and anything typed that matches nothing else offers to search it. Bangs come free -- they are a property of where the query is sent, not of the launcher -- so !yt reaches YouTube without a line of bang parsing. Suggestions could not be a script command. They need a view that reacts as you type, which is an extension: TypeScript, compiled, querying the same endpoint Firefox's address bar uses. It debounces, and aborts the request in flight on every keystroke -- typing is faster than the network, and an older answer landing after a newer one leaves the list describing a query that is no longer on screen. A bang skips suggestions entirely, because Google has no useful guesses about "!yt". The engine is now written down twice, once in each. The contract pins that they agree, since searching from the fallback and searching from the suggestions reaching different places is the kind of wrong that looks fine. Gestures mirror GNOME: three fingers sideways for workspaces, up for the overview, down to dismiss it. Open and close rather than toggle both ways -- toggling means swiping up from an open overview closes it, which is not what the fingers meant. Hyprland reads gesture registrations at startup so they cannot be a setting, but distance and direction can be, and are. Window swallowing is off by default and a preference like every other misc setting here. A terminal that vanishes when you did not ask for it is confusing rather than broken, which is worse. Claude-Session: https://claude.ai/code/session_01Q84axqUE5inJhf5Jz9CFy1
This commit is contained in:
@@ -51,6 +51,19 @@ done < <(grep -oE '\{ page: "[a-z-]+"' "$sidebar" | sed 's/.*"\([a-z-]*\)"/\1/')
|
||||
|
||||
(( ${#expected[@]} > 18 )) || fail 'no generated per-page commands were found; run scripts/panama-settings-commands'
|
||||
|
||||
# Commands that do not go through panama-action, and should not.
|
||||
#
|
||||
# Every command above asks the shell to do something, so routing them through
|
||||
# one dispatcher is what keeps that surface small. search-web is a different
|
||||
# animal: it takes a query and opens a browser, and neither half needs the
|
||||
# shell. Sending it through panama-action would mean a web search stops working
|
||||
# when Quickshell is down -- which is exactly when somebody is reaching for the
|
||||
# launcher to look up what went wrong.
|
||||
#
|
||||
# They are still commands, so everything else below applies to them: a title,
|
||||
# a description, search vocabulary, the Panama icon, and closing quietly.
|
||||
declare -a standalone=(search-web)
|
||||
|
||||
# Generated commands must match their source. A stale command dispatches to a
|
||||
# page that has been renamed or removed, and the launcher reports nothing wrong.
|
||||
"$repo_dir/config/dot/quickshell/scripts/panama-settings-commands" --check >/dev/null \
|
||||
@@ -69,11 +82,12 @@ chmod +x "$work/home/.config/quickshell/scripts/panama-action"
|
||||
# none: a shebang and the executable bit already select the interpreter, and an
|
||||
# extension is one more thing that has to stay in sync -- which it did not.
|
||||
mapfile -t actual_files < <(find "$commands_dir" -maxdepth 1 -type f -printf '%f\n' | sort)
|
||||
[[ ${#actual_files[@]} -eq ${#expected[@]} ]] \
|
||||
|| fail "expected ${#expected[@]} commands, found ${#actual_files[@]}"
|
||||
declared=$(( ${#expected[@]} + ${#standalone[@]} ))
|
||||
[[ ${#actual_files[@]} -eq $declared ]] \
|
||||
|| fail "expected $declared commands, found ${#actual_files[@]}"
|
||||
|
||||
declare -A seen_titles=()
|
||||
for script_name in "${!expected[@]}"; do
|
||||
for script_name in "${!expected[@]}" "${standalone[@]}"; do
|
||||
script="$commands_dir/$script_name"
|
||||
[[ -x "$script" ]] || fail "$script_name is missing or not executable"
|
||||
|
||||
@@ -109,6 +123,15 @@ for script_name in "${!expected[@]}"; do
|
||||
|| fail 'health command bypasses the stable dispatcher path'
|
||||
fi
|
||||
|
||||
# A standalone command has nothing to dispatch, and running it would open a
|
||||
# browser at whoever is running the tests.
|
||||
if [[ -z ${expected[$script_name]+x} ]]; then
|
||||
if grep -Fq 'panama-action' "$script"; then
|
||||
fail "$script_name is listed as standalone but goes through panama-action"
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
|
||||
: >"$dispatch_log"
|
||||
HOME="$work/home" PANAMA_COMMAND_TEST_LOG="$dispatch_log" "$script"
|
||||
dispatched="$(cat "$dispatch_log")"
|
||||
@@ -116,4 +139,4 @@ for script_name in "${!expected[@]}"; do
|
||||
|| fail "$script_name dispatched [$dispatched], expected [${expected[$script_name]}]"
|
||||
done
|
||||
|
||||
printf 'Panama commands contract: PASS (%d commands)\n' "${#expected[@]}"
|
||||
printf 'Panama commands contract: PASS (%d commands)\n' "$declared"
|
||||
|
||||
Reference in New Issue
Block a user