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:
@@ -44,7 +44,28 @@ hl.config({
|
||||
},
|
||||
})
|
||||
|
||||
-- Desktop machine: no touchpad, no gestures worth wiring. If a laptop ever
|
||||
-- runs this config, add touchpad settings in overrides.lua.
|
||||
-- ── Touchpad gestures ───────────────────────────────────────────────────────
|
||||
--
|
||||
-- GNOME's gestures, reproduced: three fingers sideways moves between
|
||||
-- workspaces, three fingers up opens the overview, three fingers down closes
|
||||
-- it. That is the same muscle memory the keybinds were built to preserve.
|
||||
--
|
||||
-- Registered unconditionally rather than behind a preference. Hyprland 0.56
|
||||
-- dropped `gestures:workspace_swipe` in favour of this `gesture` keyword, and a
|
||||
-- registration is read at config time -- so a toggle would need a reload to
|
||||
-- take effect, which is worse than the nothing these cost on a machine with no
|
||||
-- touchpad. What IS tunable at runtime lives in Settings: how far a swipe has
|
||||
-- to travel, and which way round it goes.
|
||||
--
|
||||
-- open and close rather than toggle twice: with a toggle on both directions,
|
||||
-- swiping up from an already-open overview would close it, and swiping down
|
||||
-- would reopen it. GNOME does not do that, and neither does this.
|
||||
local overview = function(fn)
|
||||
return function() hl.exec_cmd("qs ipc call overview " .. fn) end
|
||||
end
|
||||
|
||||
hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" })
|
||||
hl.gesture({ fingers = 3, direction = "up", action = overview("open") })
|
||||
hl.gesture({ fingers = 3, direction = "down", action = overview("close") })
|
||||
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user