diff --git a/default/hypr/bindings/tiling.lua b/default/hypr/bindings/tiling.lua index 7e2408d3..30a32982 100644 --- a/default/hypr/bindings/tiling.lua +++ b/default/hypr/bindings/tiling.lua @@ -26,6 +26,8 @@ end o.bind("SUPER + S", "Toggle scratchpad", hl.dsp.workspace.toggle_special("scratchpad")) o.bind("SUPER + ALT + S", "Move window to scratchpad", hl.dsp.window.move({ workspace = "special:scratchpad", follow = false })) +o.bind("SUPER + grave", "Toggle scratchpad", hl.dsp.workspace.toggle_special("scratchpad")) +o.bind("SUPER + SHIFT + grave", "Move window to scratchpad", hl.dsp.window.move({ workspace = "special:scratchpad", follow = false })) o.bind("SUPER + TAB", "Next workspace", hl.dsp.focus({ workspace = "e+1" })) o.bind("SUPER + SHIFT + TAB", "Previous workspace", hl.dsp.focus({ workspace = "e-1" })) diff --git a/default/hypr/looknfeel.lua b/default/hypr/looknfeel.lua index 345f9105..1d45fc6d 100644 --- a/default/hypr/looknfeel.lua +++ b/default/hypr/looknfeel.lua @@ -22,6 +22,11 @@ hl.config({ decoration = { rounding = 0, + -- Dimming only kicks in while a special workspace is open, so the + -- scratchpad gets its overlay separation without costing anything the + -- rest of the time. + dim_special = 0.6, + shadow = { enabled = false, }, @@ -64,6 +69,19 @@ hl.config({ }, }) +-- Give the scratchpad a floating Quake-console presentation. Shadow and blur +-- stay off globally (they cost GPU on every frame for almost no visual gain, +-- and windows are near-opaque anyway), so the inset, the dimming, and the +-- slide carry the effect. +hl.workspace_rule({ + workspace = "special:scratchpad", + gaps_out = 80, + gaps_in = 40, +}) + +-- Round just the scratchpad, so the global default can stay square. +hl.window_rule({ match = { workspace = "special:scratchpad" }, rounding = 8 }) + -- Default animations, see https://wiki.hypr.land/Configuring/Advanced-and-Cool/Animations/ hl.curve("easeOutQuint", { type = "bezier", points = { { 0.23, 1 }, { 0.32, 1 } } }) hl.curve("easeInOutCubic", { type = "bezier", points = { { 0.65, 0.05 }, { 0.36, 1 } } }) @@ -86,7 +104,11 @@ hl.animation({ leaf = "layersOut", enabled = true, speed = 1.5, bezier = "linear hl.animation({ leaf = "fadeLayersIn", enabled = true, speed = 1.79, bezier = "almostLinear" }) hl.animation({ leaf = "fadeLayersOut", enabled = true, speed = 1.39, bezier = "almostLinear" }) hl.animation({ leaf = "workspaces", enabled = false }) -hl.animation({ leaf = "specialWorkspace", enabled = true, speed = 3, bezier = "easeOutQuint", style = "slidevert" }) +-- The direction names the edge the offset is measured from, not where the +-- workspace goes: "slide top" drops it down into view, and "slide bottom" +-- retracts it back up the way a Quake console does. +hl.animation({ leaf = "specialWorkspaceIn", enabled = true, speed = 3, bezier = "easeOutQuint", style = "slide top" }) +hl.animation({ leaf = "specialWorkspaceOut", enabled = true, speed = 2, bezier = "easeInOutCubic", style = "slide bottom" }) hl.config({ dwindle = { diff --git a/manual/04-navigation.md b/manual/04-navigation.md index 7c898d97..1d3bc173 100644 --- a/manual/04-navigation.md +++ b/manual/04-navigation.md @@ -62,9 +62,9 @@ You can pop a window out of its workspace allocation with `Super + O`. That'll p ### Scratchpad workspace -Finally, there's a special scratchpad workspace that overlays on whatever workspace you're currently on. You access what's on that using `Super + S` and you place windows there using `Super + Alt + S`. +Finally, there's a special scratchpad workspace that drops down over whatever workspace you're currently on, much like a Quake console. Toggle it with `Super + Grave` or `Super + S`, and place a window there using `Super + Shift + Grave` or `Super + Alt + S`. -It works well for controls or perhaps a terminal that you quickly want to interact with in an overlay without leaving the current workspace. If you want to move a window off the scratchpad, you just move it directly to another workspace with something like `Super + Shift + 1` to move it to workspace 1. +It works especially well for a terminal running an agent, or for controls you want to interact with quickly without leaving the current workspace. To move a window off the scratchpad, send it directly to another workspace with something like `Super + Shift + 1`. ### It takes some getting used to! diff --git a/manual/07-hotkeys.md b/manual/07-hotkeys.md index 88a46bf4..77b57e54 100644 --- a/manual/07-hotkeys.md +++ b/manual/07-hotkeys.md @@ -26,6 +26,8 @@ You can see all the main keyboard bindings with `Super + K` (Tmux bindings with | `Super + Ctrl + Tab` | Jump to former workspace | | `Super + Shift + 1/2/3/4` | Move window to workspace | | `Super + Shift + Alt + 1/2/3/4` | Move window to workspace without following | +| `Super + S` / `Super + Grave` | Toggle scratchpad | +| `Super + Alt + S` / `Super + Shift + Grave` | Move window to scratchpad | | `Super + Shift + Alt + Arrows` | Move workspaces to directional monitor | | `Super + Arrow` | Move focus to window in direction of arrow | | `Super + Shift + Arrow` | Swap window with another in direction of arrow | @@ -47,8 +49,6 @@ You can see all the main keyboard bindings with `Super + K` (Tmux bindings with | `Super + Alt + 1/2/3/4/5` | Jump to specific window in grouping | | `Super + Alt + Arrow` | Move window into grouping in direction of arrow | | `Super + Ctrl + Left/Right` | Move between windows inside a tiling group | -| `Super + S` | Show scratchpad workspace overlay | -| `Super + Alt + S` | Move window to scratchpad workspace | | `Super + Ctrl + Z` | Zoom in on screen (repeat for more zoom) | | `Super + Ctrl + Alt + Z` | Zoom fully out from screen | | `Super + /` | Step forward through monitor scaling options | diff --git a/test/shell.d/hyprland-default-config-test.sh b/test/shell.d/hyprland-default-config-test.sh index e37ef931..e35baba7 100644 --- a/test/shell.d/hyprland-default-config-test.sh +++ b/test/shell.d/hyprland-default-config-test.sh @@ -175,6 +175,21 @@ if grep -Fq $'SUPER + CTRL + X Toggle dictation' <<<"$missing_voxtype_output"; t fi pass "missing Voxtype skips dictation bindings" +# The Grave shortcuts are aliases, so the original SUPER + S pair has to keep +# working alongside them. +scratchpad_home="$tmpdir/scratchpad-home" +mkdir -p "$scratchpad_home" +scratchpad_output=$(run_omarchy_bindings "$scratchpad_home") +grep -Fqx $'SUPER + S Toggle scratchpad' <<<"$scratchpad_output" || + fail "scratchpad keeps its existing toggle binding" +grep -Fqx $'SUPER + grave Toggle scratchpad' <<<"$scratchpad_output" || + fail "scratchpad supports a Quake-style toggle binding" +grep -Fqx $'SUPER + ALT + S Move window to scratchpad' <<<"$scratchpad_output" || + fail "scratchpad keeps its existing move binding" +grep -Fqx $'SUPER + SHIFT + grave Move window to scratchpad' <<<"$scratchpad_output" || + fail "scratchpad supports a Quake-style move binding" +pass "scratchpad retains existing bindings and adds Grave shortcuts" + # The panel hotkeys claim a row of keys that workspace switching already uses # under other modifiers, so the count matters as much as the bindings: a tenth # claim on SUPER + CTRL + a number is a collision with one of these.