diff --git a/configs/ABOUTME.md b/configs/ABOUTME.md index af6a5d4..986a2ca 100644 --- a/configs/ABOUTME.md +++ b/configs/ABOUTME.md @@ -16,6 +16,7 @@ these cases where the source subdir and `~/.config` target differ. |---|---| | `niri/` | Niri Wayland compositor config | | `fwbook/hypr/` | Hyprland config for `fwbook` (scrolling layout + noctalia); linked to `~/.config/hypr` | +| `fwbook/quickshell/` | Quickshell configs for `fwbook` (scrolling overview); linked to `~/.config/quickshell` | | `extra.nu` | Extra NuShell config sourced at shell startup | | `fwbook.knsv` | fwbook-specific Kanshi display profile | | `libinput-gestures.conf` | Touchpad gesture bindings | diff --git a/configs/fwbook/hypr/ABOUTME.md b/configs/fwbook/hypr/ABOUTME.md index d401e5b..2d67c61 100644 --- a/configs/fwbook/hypr/ABOUTME.md +++ b/configs/fwbook/hypr/ABOUTME.md @@ -33,19 +33,16 @@ split under `conf/` and pulled in with `require()`. intentionally no waybar/hyprpanel. - **Keybinds:** `conf/keybindings.lua` mirrors `configs/niri/shared/binds.kdl` and `configs/niri/dms/binds.kdl` as closely as Hyprland allows. -- **Overview:** Pure-Lua workspace overview (`conf/overview.lua`), no plugin. It - enumerates workspaces via `hl.get_workspaces()` and presents them in a - `wofi --dmenu` picker, dispatching the chosen workspace with - `hyprctl dispatch workspace`. Hyprland's Lua API has no "render a workspace - to a texture" primitive, so this is a switcher-style overview (id, name, - window count, active/empty/urgent flags) rather than live scaled thumbnails. - Bound to `Mod+Tab` (niri parity) and `Mod+G`. -- **Overview (plugin, WIP):** ScrollOverview (`conf/scrolloverview.lua`), a - niri-like overview plugin (github.com/yayuuu/hyprland-scroll-overview), is - the live-thumbnail alternative. Currently **disabled** (commented out in - `hyprland.lua`) while it's being debugged; would load via `hl.plugin.load` - from the `SCROLLOVERVIEW_SO` session variable set in - `modules/nixos/desktop/tiler/hyprland.nix`. +- **Overview:** A standalone Quickshell config (`configs/fwbook/quickshell/overview/`, + symlinked to `~/.config/quickshell/overview` by the + `skyg.nixos.desktop.tiler.quickshell` module) provides a niri-like scrolling + overview — a vertical stack of workspace rows, each a horizontal strip of + that workspace's windows with live screencopy previews. It runs as its own + `qs -c overview` daemon (autostarted in `conf/autostart.lua`), toggled over + Quickshell's IPC (`qs -c overview ipc call overview toggle`) from `Mod+Tab` + (`conf/keybindings.lua`) and a 4-finger swipe up/down (`conf/inputs.lua`). + Arrow keys move the selection, Enter focuses + closes, Esc cancels. See + `configs/fwbook/quickshell/ABOUTME.md` for the QML implementation. ## Files @@ -68,11 +65,8 @@ hypr/ ├── monitors.lua # hl.monitor per display (from configs/niri/.../outputs.kdl) ├── inputs.lua # touchpad tap + natural scroll, kb us, hl.gesture ├── window-rules.lua # hl.window_rule floats for small dialogs/utilities - ├── keybindings.lua # niri + noctalia binds, scrolling dispatchers (hl.bind/hl.dsp) - ├── autostart.lua # noctalia, hypridle via setpriv (hl.on hyprland.start; drops compositor caps) - ├── overview.lua # pure-Lua workspace switcher overview (wofi picker, Mod+Tab/Mod+G) - └── scrolloverview.lua # ScrollOverview plugin (niri-like, live thumbnails) — WIP/disabled; - # loads via $SCROLLOVERVIEW_SO, require() commented out in hyprland.lua + ├── keybindings.lua # niri + noctalia binds, scrolling dispatchers (hl.bind/hl.dsp); Mod+Tab toggles the Quickshell overview + └── autostart.lua # noctalia, Quickshell overview, hypridle via setpriv (hl.on hyprland.start; drops compositor caps) ``` ## Bindings without a clean 1:1 niri mapping @@ -80,8 +74,9 @@ hypr/ - `Mod+Shift+H` (show-hotkey-overlay) — no native Hyprland equivalent; left commented. - `Mod+Escape` (toggle-keyboard-shortcuts-inhibit) — no native equivalent; omitted. - `Mod+W` (toggle-column-tabbed-display) — mapped to `hl.dsp.group.toggle()` as the nearest analog. -- `Mod+Tab` (toggle-overview) — pure-Lua overview (`conf/overview.lua`); - previously the ScrollOverview plugin, and `cyclenext` before that existed. +- `Mod+Tab` (toggle-overview) — the Quickshell scrolling overview (see above); + previously a pure-Lua wofi picker, then the ScrollOverview plugin, and + `cyclenext` before that. ## Touchpad gestures (niri parity) @@ -91,6 +86,9 @@ niri's 3-finger swipes are mirrored in `conf/inputs.lua`: - **Mod + swipe (any direction)** → move the whole workspace to the monitor in that direction (`movecurrentworkspacetomonitor`), mirroring niri's `Mod+TouchpadScroll*` binds. This replaced the old `Mod + mouse wheel` approach. +- **4-finger up/down** → open/close the Quickshell scrolling overview (see + Overview above). `hl.gesture` is a discrete trigger, so there's no + swipe-progress animation. > The gesture action is `scroll_move` (underscore), not `scrollmove`. The > `mods = "SUPER"` mask is what lets the Mod + swipe variants coexist with the diff --git a/configs/fwbook/hypr/conf/autostart.lua b/configs/fwbook/hypr/conf/autostart.lua index cc37509..75dddd6 100644 --- a/configs/fwbook/hypr/conf/autostart.lua +++ b/configs/fwbook/hypr/conf/autostart.lua @@ -9,6 +9,8 @@ hl.on("hyprland.start", function() -- setpriv drops ambient capabilities inherited from the compositor; -- without it, D-Bus calls inside quickshell-based apps fail silently. hl.exec_cmd("setpriv --ambient-caps -all -- noctalia") + -- Scrolling overview (Quickshell); toggled via Mod+Tab / 4-finger swipe + hl.exec_cmd("setpriv --ambient-caps -all -- qs -c overview") -- Idle management hl.exec_cmd("setpriv --ambient-caps -all -- hypridle") end) diff --git a/configs/fwbook/hypr/conf/inputs.lua b/configs/fwbook/hypr/conf/inputs.lua index 2d863a4..c2fa239 100644 --- a/configs/fwbook/hypr/conf/inputs.lua +++ b/configs/fwbook/hypr/conf/inputs.lua @@ -21,13 +21,59 @@ hl.config({ -- Match niri's touchpad axes: 3-finger horizontal scrolls through columns -- (scroll_move drives the scrolling-layout tape), vertical switches workspaces. hl.gesture({ fingers = 3, direction = "horizontal", action = "scroll_move" }) -hl.gesture({ fingers = 3, direction = "vertical", action = "workspace" }) +hl.gesture({ fingers = 3, direction = "vertical", action = "workspace" }) -- niri moved a whole workspace to another monitor via Mod + touchpad scroll. -- Hyprland gestures take a `mods` mask, so mirror that with Mod + 3-finger -- swipes. Directions mirror niri's binds (swipe up -> monitor down, etc.); -- flip the monitor letters if the axis feels reversed on your hardware. -hl.gesture({ fingers = 3, direction = "up", mods = "SUPER", action = function() hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor d") end }) -hl.gesture({ fingers = 3, direction = "down", mods = "SUPER", action = function() hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor u") end }) -hl.gesture({ fingers = 3, direction = "left", mods = "SUPER", action = function() hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor r") end }) -hl.gesture({ fingers = 3, direction = "right", mods = "SUPER", action = function() hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor l") end }) +hl.gesture({ + fingers = 3, + direction = "up", + mods = "SUPER", + action = function() + hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor d") + end, +}) +hl.gesture({ + fingers = 3, + direction = "down", + mods = "SUPER", + action = function() + hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor u") + end, +}) +hl.gesture({ + fingers = 3, + direction = "left", + mods = "SUPER", + action = function() + hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor r") + end, +}) +hl.gesture({ + fingers = 3, + direction = "right", + mods = "SUPER", + action = function() + hl.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor l") + end, +}) + +-- niri: toggle-overview via 4-finger swipe (mirrors Mod+Tab in keybindings.lua). +-- Swipe up opens, swipe down closes; gestures are discrete triggers, no +-- swipe-progress animation is possible via hl.gesture. +hl.gesture({ + fingers = 4, + direction = "up", + action = function() + hl.exec_cmd("qs -c overview ipc call overview open") + end, +}) +hl.gesture({ + fingers = 4, + direction = "down", + action = function() + hl.exec_cmd("qs -c overview ipc call overview close") + end, +}) diff --git a/configs/fwbook/hypr/conf/keybindings.lua b/configs/fwbook/hypr/conf/keybindings.lua index 60db1bb..0ab9c84 100644 --- a/configs/fwbook/hypr/conf/keybindings.lua +++ b/configs/fwbook/hypr/conf/keybindings.lua @@ -25,9 +25,9 @@ hl.bind(mod .. " + right", hl.dsp.focus({ direction = "right" })) hl.bind(mod .. " + up", hl.dsp.focus({ workspace = "e-1" })) hl.bind(mod .. " + down", hl.dsp.focus({ workspace = "e+1" })) --- hl.bind(mod .. " + Tab", function() --- hl.plugin.scrolloverview.overview("toggle all") --- end) +-- niri: toggle-overview -> Quickshell scrolling overview (see conf/inputs.lua +-- for the 4-finger swipe equivalent) +hl.bind(mod .. " + Tab", hl.dsp.exec_cmd("qs -c overview ipc call overview toggle")) -- niri: focus-monitor-next hl.bind(mod .. " + SHIFT + Tab", hl.dsp.focus({ monitor = "+1" })) diff --git a/configs/fwbook/hypr/conf/overview.lua b/configs/fwbook/hypr/conf/overview.lua deleted file mode 100644 index 2c1c07c..0000000 --- a/configs/fwbook/hypr/conf/overview.lua +++ /dev/null @@ -1,127 +0,0 @@ --- ========================= --- Overview (pure Lua, wofi-driven) --- ========================= --- A niri-style workspace overview built entirely from Hyprland's Lua API -- no --- external plugin (.so). Because Hyprland's Lua API exposes no "render a --- workspace to a texture" primitive, we can't draw live scaled thumbnails from --- Lua alone. So this is the honest pure-Lua version: a workspace *switcher --- overview* -- enumerate every workspace (id, name, window count, active/empty --- state) with hl.get_workspaces(), present them in a wofi dmenu, and jump to --- the one you pick. --- --- Flow: the Lua side is the source of truth for the workspace list; it writes a --- tiny picker script to /tmp and launches it with `sh `. The script shows --- wofi, extracts the leading workspace id from the chosen line, and dispatches --- it with hyprctl. --- --- Why the dispatch lives in the script (not in a Lua timer): a Lua keybind --- callback runs on the compositor's main thread under a ~100ms watchdog, so it --- can't block reading wofi's stdout, and an async poll-timer handoff (reading a --- result file on a repeating hl.timer) proved fragile -- a dispatch error left --- the poll timer leaked. Keeping the switch in the spawned shell is the simple, --- robust path. The script is launched as `sh ` (not executed) so we never --- need os.execute/chmod, which would also block the callback. --- --- Bound to Mod+Tab (niri parity) and Mod+G. The old plugin-based --- conf/scrolloverview.lua is left untouched and still commented out in --- hyprland.lua. - -local mod = "SUPER" - --- Where the generated picker script lives. /tmp is fine for a per-session --- helper; it's rewritten on every toggle so it always reflects live state. -local script_path = "/tmp/hypr-overview.sh" - ----Build the display lines fed to wofi. ----Each line starts with the numeric workspace id, which is what the picker ----dispatches on. Keeping the id first means we never have to round-trip a ----hidden selector column through wofi. ----@return string[] lines one human-readable label per workspace -local function workspace_lines() - local lines = {} - - -- Stable ordering: numeric id ascending. - local ws = hl.get_workspaces() or {} - table.sort(ws, function(a, b) - return (a.id or 0) < (b.id or 0) - end) - - for _, w in ipairs(ws) do - -- Skip special (scratchpad) workspaces; they aren't part of the tape. - if not w.special and w.id and w.id > 0 then - local name = (w.name and w.name ~= "") and w.name or ("workspace " .. w.id) - local count = w.windows or 0 - - local flags = {} - if w.active then - table.insert(flags, "active") - end - if count == 0 then - table.insert(flags, "empty") - end - if w.has_urgent then - table.insert(flags, "urgent") - end - local suffix = #flags > 0 and (" [" .. table.concat(flags, ", ") .. "]") or "" - - -- Leading "." is parsed back out by the picker; keep it first. - table.insert( - lines, - string.format("%d. %-24s %2d window(s)%s", w.id, name, count, suffix) - ) - end - end - - return lines -end - ----Write the picker helper script. It feeds the display lines to wofi, extracts ----the leading workspace id from the chosen line, and dispatches it via hyprctl. ----@param lines string[] ----@return boolean ok -local function write_script(lines) - local f = io.open(script_path, "w") - if not f then - hl.print("overview: could not write", script_path) - return false - end - - f:write("#!/bin/sh\n") - f:write("# Generated by conf/overview.lua -- do not edit by hand.\n") - -- No `set -e`: wofi exits non-zero on Escape/cancel; we just do nothing. - f:write("pick=$(cat <<'__DATA__' | wofi --dmenu --prompt 'Overview' --width 480 --lines 15)\n") - for _, line in ipairs(lines) do - -- Guard against a stray newline/heredoc terminator inside a name. - local safe = line:gsub("\n", " ") - f:write(safe .. "\n") - end - f:write("__DATA__\n") - f:write(")\n") - f:write('[ -z "$pick" ] && exit 0\n') - -- The chosen line begins with "."; take the leading digits as the id. - f:write('id=$(printf %s "$pick" | cut -d. -f1 | tr -dc 0-9)\n') - f:write('[ -z "$id" ] && exit 0\n') - f:write('exec hyprctl dispatch workspace "$id"\n') - f:close() - - return true -end - ----Toggle the overview: regenerate the live workspace list and pop wofi. ----Writing a small file and spawning a process are both fast enough to run ----directly in the keybind callback (no blocking subprocess, no chmod). -local function show_overview() - local lines = workspace_lines() - if #lines == 0 then - return - end - - if write_script(lines) then - hl.exec_cmd("sh " .. script_path) - end -end - --- Mod+Tab is niri's toggle-overview; Mod+G kept for muscle-memory parity with --- the old scrolloverview bind. -hl.bind(mod .. " + Tab", show_overview) -hl.bind(mod .. " + g", show_overview) diff --git a/configs/fwbook/hypr/conf/scrolloverview.lua b/configs/fwbook/hypr/conf/scrolloverview.lua deleted file mode 100644 index 424d692..0000000 --- a/configs/fwbook/hypr/conf/scrolloverview.lua +++ /dev/null @@ -1,26 +0,0 @@ --- ========================= --- ScrollOverview (niri-like overview) --- ========================= --- ScrollOverview plugin: an overview just like niri's, based on the --- scroll-overview branch of hyprexpo. Docs: --- https://github.com/yayuuu/hyprland-scroll-overview - --- environment.systemPackages only puts libscrolloverview.so on disk -- Hyprland --- doesn't load plugins on its own. SCROLLOVERVIEW_SO is set in --- modules/nixos/desktop/tiler/hyprland.nix (sessionVariables) to the resolved --- store path, since that path changes on every flake update. Must run before --- anything below references plugin.scrolloverview config keys or --- hl.plugin.scrolloverview, both of which only exist once the plugin is loaded. -hl.plugin.load(os.getenv("SCROLLOVERVIEW_SO")) - -hl.config({ - plugin = { - scrolloverview = {}, - }, -}) - --- Toggle the overview with Mod+g (niri's toggle-overview lives on Mod+Tab in --- conf/keybindings.lua, which now calls into this plugin too). -hl.bind("SUPER + g", function() - hl.plugin.scrolloverview.overview("toggle all") -end) diff --git a/configs/fwbook/hypr/hyprland.lua b/configs/fwbook/hypr/hyprland.lua index 506c378..e5af201 100644 --- a/configs/fwbook/hypr/hyprland.lua +++ b/configs/fwbook/hypr/hyprland.lua @@ -10,5 +10,3 @@ require("conf/inputs") require("conf/window-rules") require("conf/keybindings") require("conf/autostart") --- require("conf/overview") -require("conf/scrolloverview") diff --git a/configs/fwbook/quickshell/ABOUTME.md b/configs/fwbook/quickshell/ABOUTME.md new file mode 100644 index 0000000..1ae91c3 --- /dev/null +++ b/configs/fwbook/quickshell/ABOUTME.md @@ -0,0 +1,71 @@ +# configs/fwbook/quickshell/ + +Host-specific Quickshell configs for `fwbook`. Symlinked to `~/.config/quickshell` +by the `skyg.nixos.desktop.tiler.quickshell` module, which defaults its +`configName` to the machine hostName (`configs/${hostName}/quickshell`). + +Quickshell resolves each subdirectory as an independently named config, run +via `qs -c ` (or `qs -p ` for direct path testing without the +symlink). This is deliberately not part of noctalia/DMS — each `qs -c ` +here is its own standalone process/shell. + +## overview/ + +A niri-like scrolling overview for Hyprland, standing in for a native overview +plugin (Hyprland has none maintained against tagged releases — see +`modules/nixos/desktop/tiler/ABOUTME.md`). + +- **Model:** the current monitor's workspaces are vertical rows, each row a + horizontal strip of that workspace's windows (columns), sorted by x-position + to match the Hyprland `scrolling` layout's tape order. +- **Controls:** Arrow keys move the selection (Left/Right = window in the row, + Up/Down = workspace row), Enter focuses the selection and closes, Esc + cancels. No mouse-driven drag/resize. +- **Previews:** live via `Quickshell.Wayland.ScreencopyView`, capturing each + window's `HyprlandToplevel.wayland` handle. Capture only runs while the + overview is visible (`live` is bound to the window's visibility). +- **Focus dispatch:** classic `hyprctl`-style dispatcher strings + (`"workspace " + id`, `"focuswindow address:" + addr`) via + `Hyprland.dispatch(...)` — these work regardless of whether Hyprland's + config is Lua or hyprlang, unlike the Lua-eval dispatch form. + +### Files + +``` +overview/ +├── shell.qml # ShellRoot: IpcHandler (target "overview": toggle/open/close) +│ # + Variants { model: Quickshell.screens } instantiating one +│ # OverviewWindow per monitor +├── OverviewWindow.qml # per-monitor PanelWindow (layer-shell overlay); builds the +│ # workspace/window model from Quickshell.Hyprland, owns +│ # selection state, key handling, and HyprlandFocusGrab +├── WorkspaceRow.qml # one workspace = horizontal Row of WindowCards + label +├── WindowCard.qml # live ScreencopyView preview + icon/title footer + selection ring +└── Theme.qml # plain QtObject with colors/sizes, instantiated once per + # OverviewWindow and prop-drilled down (no singleton/qmldir) +``` + +`Theme.qml` and the other sibling `.qml` files are used without explicit +imports — Quickshell (like plain QML) makes same-directory files visible as +types automatically, no `qmldir` needed for single-directory configs like this +one. + +### Wiring (Hyprland side, `configs/fwbook/hypr/`) + +- `conf/keybindings.lua` — `Mod+Tab` runs `qs -c overview ipc call overview toggle` +- `conf/inputs.lua` — 4-finger swipe up/down open/close it (discrete gesture, + no swipe-progress animation) +- `conf/autostart.lua` — the daemon is started via + `setpriv --ambient-caps -all -- qs -c overview` (D-Bus calls in + quickshell-based apps fail silently without this wrapper under this + Hyprland/UWSM setup) + +### Testing without a rebuild + +Since `~/.config/quickshell` is a symlink into this repo, edits are live. +Test directly by path before relying on the installed symlink: + +``` +qs -p ~/nixos-setup/configs/fwbook/quickshell/overview +qs -p ~/nixos-setup/configs/fwbook/quickshell/overview ipc call overview toggle +``` diff --git a/configs/fwbook/quickshell/overview/OverviewWindow.qml b/configs/fwbook/quickshell/overview/OverviewWindow.qml new file mode 100644 index 0000000..6091db8 --- /dev/null +++ b/configs/fwbook/quickshell/overview/OverviewWindow.qml @@ -0,0 +1,188 @@ +import QtQuick +import Quickshell +import Quickshell.Wayland +import Quickshell.Hyprland + +PanelWindow { + id: root + + required property bool shellOpen + signal requestClose() + + readonly property var monitor: Hyprland.monitorFor(root.screen) + readonly property bool monitorFocused: monitor && Hyprland.focusedMonitor && monitor.id === Hyprland.focusedMonitor.id + visible: root.shellOpen && root.monitorFocused + + color: "transparent" + + WlrLayershell.namespace: "quickshell:overview" + WlrLayershell.layer: WlrLayer.Overlay + WlrLayershell.exclusiveZone: -1 + WlrLayershell.keyboardFocus: root.visible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None + + anchors { + top: true + left: true + right: true + bottom: true + } + + property Theme theme: Theme {} + + // Sorts a workspace's toplevels by x-position so card order matches the + // scrolling layout's column order. + function sortedToplevels(ws) { + const list = (ws && ws.toplevels) ? ws.toplevels.values.slice() : []; + return list.sort((a, b) => { + const ax = a?.lastIpcObject?.at?.[0] ?? 0; + const bx = b?.lastIpcObject?.at?.[0] ?? 0; + return ax - bx; + }); + } + + // Workspace rows for this monitor, top-to-bottom by workspace id. Special + // (scratchpad) workspaces have negative ids and are excluded. + readonly property var rows: { + const mon = root.monitor; + if (!mon || !Hyprland.workspaces) return []; + const workspaces = Hyprland.workspaces.values + .filter(ws => ws && ws.id > 0 && ws.monitor && ws.monitor.name === mon.name) + .sort((a, b) => a.id - b.id); + return workspaces.map(ws => ({ workspace: ws, toplevels: root.sortedToplevels(ws) })); + } + + property int selectedRow: 0 + property int selectedCol: 0 + + function clampSelection() { + if (root.rows.length === 0) { + root.selectedRow = 0; + root.selectedCol = 0; + return; + } + if (root.selectedRow >= root.rows.length) root.selectedRow = root.rows.length - 1; + if (root.selectedRow < 0) root.selectedRow = 0; + const count = root.rows[root.selectedRow].toplevels.length; + if (root.selectedCol >= count) root.selectedCol = Math.max(0, count - 1); + if (root.selectedCol < 0) root.selectedCol = 0; + } + + // Reset the selection to the active workspace/window whenever the + // overview opens. + function resetSelection() { + const activeRowIndex = root.rows.findIndex(r => r.workspace.active); + root.selectedRow = activeRowIndex >= 0 ? activeRowIndex : 0; + const row = root.rows[root.selectedRow]; + const activeColIndex = row ? row.toplevels.findIndex(tl => tl.activated) : -1; + root.selectedCol = activeColIndex >= 0 ? activeColIndex : 0; + root.clampSelection(); + } + + function moveSelection(dRow, dCol) { + if (root.rows.length === 0) return; + if (dRow !== 0) { + root.selectedRow = (root.selectedRow + dRow + root.rows.length) % root.rows.length; + root.clampSelection(); + } + if (dCol !== 0) { + const count = root.rows[root.selectedRow].toplevels.length; + if (count > 0) root.selectedCol = (root.selectedCol + dCol + count) % count; + } + } + + function activateSelection() { + const row = root.rows[root.selectedRow]; + if (!row) { root.requestClose(); return; } + if (!row.workspace.active) Hyprland.dispatch("workspace " + row.workspace.id); + const tl = row.toplevels[root.selectedCol]; + if (tl) Hyprland.dispatch("focuswindow address:" + tl.address); + root.requestClose(); + } + + onVisibleChanged: { + if (root.visible) { + Hyprland.refreshMonitors(); + Hyprland.refreshWorkspaces(); + Hyprland.refreshToplevels(); + root.resetSelection(); + Qt.callLater(() => focusScope.forceActiveFocus()); + } + } + + HyprlandFocusGrab { + windows: [root] + active: root.visible + onCleared: { + if (root.visible) root.requestClose(); + } + } + + Rectangle { + anchors.fill: parent + color: root.theme.backdrop + + MouseArea { + anchors.fill: parent + onClicked: root.requestClose() + } + } + + FocusScope { + id: focusScope + anchors.fill: parent + focus: root.visible + + Keys.onPressed: event => { + switch (event.key) { + case Qt.Key_Left: + root.moveSelection(0, -1); + break; + case Qt.Key_Right: + root.moveSelection(0, 1); + break; + case Qt.Key_Up: + root.moveSelection(-1, 0); + break; + case Qt.Key_Down: + root.moveSelection(1, 0); + break; + case Qt.Key_Return: + case Qt.Key_Enter: + root.activateSelection(); + break; + case Qt.Key_Escape: + root.requestClose(); + break; + default: + return; + } + event.accepted = true; + } + + Column { + anchors.centerIn: parent + spacing: root.theme.rowSpacing + + Repeater { + model: root.rows + + WorkspaceRow { + required property var modelData + required property int index + + theme: root.theme + workspace: modelData.workspace + toplevels: modelData.toplevels + selectedIndex: index === root.selectedRow ? root.selectedCol : -1 + live: root.visible + + onCardClicked: colIndex => { + root.selectedRow = index; + root.selectedCol = colIndex; + root.activateSelection(); + } + } + } + } + } +} diff --git a/configs/fwbook/quickshell/overview/Theme.qml b/configs/fwbook/quickshell/overview/Theme.qml new file mode 100644 index 0000000..f1a26e3 --- /dev/null +++ b/configs/fwbook/quickshell/overview/Theme.qml @@ -0,0 +1,14 @@ +import QtQuick + +QtObject { + readonly property color backdrop: "#cc0b0e14" + readonly property color cardBg: "#332a2e3a" + readonly property color cardBorder: "#40ffffff" + readonly property color selectedBorder: "#7aa2f7" + readonly property color textColor: "#ffffff" + readonly property color emptyTextColor: "#80ffffff" + readonly property real cornerRadius: 10 + readonly property real cardHeight: 180 + readonly property real cardSpacing: 20 + readonly property real rowSpacing: 28 +} diff --git a/configs/fwbook/quickshell/overview/WindowCard.qml b/configs/fwbook/quickshell/overview/WindowCard.qml new file mode 100644 index 0000000..d3b5b68 --- /dev/null +++ b/configs/fwbook/quickshell/overview/WindowCard.qml @@ -0,0 +1,69 @@ +import QtQuick +import Quickshell +import Quickshell.Wayland + +Rectangle { + id: root + + required property var theme + required property var toplevel + required property bool selected + required property bool live + + signal activated() + + readonly property var ipc: root.toplevel ? root.toplevel.lastIpcObject : null + readonly property real aspect: (ipc && ipc.size && ipc.size[0] > 0 && ipc.size[1] > 0) ? ipc.size[0] / ipc.size[1] : (16 / 9) + + width: Math.min(height * aspect, theme.cardHeight * 2.2) + height: theme.cardHeight + radius: theme.cornerRadius + color: theme.cardBg + border.width: selected ? 3 : 1 + border.color: selected ? theme.selectedBorder : theme.cardBorder + clip: true + + ScreencopyView { + anchors.fill: parent + anchors.margins: 3 + captureSource: root.live && root.toplevel ? root.toplevel.wayland : null + live: root.live + paintCursor: false + } + + Image { + anchors.left: parent.left + anchors.bottom: parent.bottom + anchors.margins: 6 + width: 20 + height: 20 + source: Quickshell.iconPath(ipc ? ipc.class : "", "application-x-executable") + sourceSize: Qt.size(20, 20) + } + + Rectangle { + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + height: title.implicitHeight + 8 + color: "#99000000" + + Text { + id: title + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 30 + anchors.rightMargin: 6 + anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + color: theme.textColor + text: root.toplevel ? root.toplevel.title : "" + font.pixelSize: 12 + } + } + + MouseArea { + anchors.fill: parent + onClicked: root.activated() + } +} diff --git a/configs/fwbook/quickshell/overview/WorkspaceRow.qml b/configs/fwbook/quickshell/overview/WorkspaceRow.qml new file mode 100644 index 0000000..526cea8 --- /dev/null +++ b/configs/fwbook/quickshell/overview/WorkspaceRow.qml @@ -0,0 +1,72 @@ +import QtQuick + +Item { + id: root + + required property var theme + required property var workspace + required property var toplevels + required property int selectedIndex + required property bool live + + signal cardClicked(int index) + + implicitWidth: content.implicitWidth + implicitHeight: content.implicitHeight + + Column { + id: content + spacing: root.theme.cardSpacing * 0.5 + + Text { + anchors.horizontalCenter: parent.horizontalCenter + text: "Workspace " + (root.workspace ? root.workspace.id : "?") + color: root.theme.textColor + font.pixelSize: 14 + font.bold: root.workspace && root.workspace.active + } + + Row { + spacing: root.theme.cardSpacing + + Repeater { + model: root.toplevels + + WindowCard { + required property var modelData + required property int index + + theme: root.theme + toplevel: modelData + selected: index === root.selectedIndex + live: root.live + + onActivated: root.cardClicked(index) + } + } + + // Placeholder for an empty workspace so the row stays visible + // and selectable even with no windows. + Rectangle { + visible: root.toplevels.length === 0 + width: root.theme.cardHeight * 1.6 + height: root.theme.cardHeight + radius: root.theme.cornerRadius + color: "transparent" + border.width: root.selectedIndex === 0 ? 3 : 1 + border.color: root.selectedIndex === 0 ? root.theme.selectedBorder : root.theme.cardBorder + + Text { + anchors.centerIn: parent + text: "Empty" + color: root.theme.emptyTextColor + } + + MouseArea { + anchors.fill: parent + onClicked: root.cardClicked(0) + } + } + } + } +} diff --git a/configs/fwbook/quickshell/overview/shell.qml b/configs/fwbook/quickshell/overview/shell.qml new file mode 100644 index 0000000..017d20a --- /dev/null +++ b/configs/fwbook/quickshell/overview/shell.qml @@ -0,0 +1,37 @@ +import Quickshell +import Quickshell.Io + +// Scrolling overview for Hyprland — vertical stack of workspace rows on the +// current monitor, each row a horizontal strip of that workspace's windows. +// Toggle with `qs -c overview ipc call overview `; wired +// to Mod+Tab and a 4-finger swipe in the Hyprland config. +ShellRoot { + id: shell + + property bool overviewOpen: false + + IpcHandler { + target: "overview" + + function toggle(): void { + shell.overviewOpen = !shell.overviewOpen; + } + function open(): void { + shell.overviewOpen = true; + } + function close(): void { + shell.overviewOpen = false; + } + } + + Variants { + model: Quickshell.screens + + OverviewWindow { + required property var modelData + screen: modelData + shellOpen: shell.overviewOpen + onRequestClose: shell.overviewOpen = false + } + } +} diff --git a/flake.lock b/flake.lock index 93bb252..8f2e9b9 100644 --- a/flake.lock +++ b/flake.lock @@ -453,27 +453,6 @@ } }, "flake-parts_3": { - "inputs": { - "nixpkgs-lib": [ - "scrolloverview", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1782949081, - "narHash": "sha256-vp6Y/Grm98ESt6ceOkWiHWyZRDV3J1RID4w+6NWK9yA=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "17c9d6cdfc60c64f4ee8d306f9bc0b4ccb51481e", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_4": { "inputs": { "nixpkgs-lib": [ "stylix", @@ -1411,22 +1390,6 @@ "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1" } }, - "nixpkgs_10": { - "locked": { - "lastModified": 1785090369, - "narHash": "sha256-m0pDuRJG7EDo9ri+4Ksu83VsI+PlxNC9lNBfydejce4=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "624af665418d3c65d544145b4d34ad696439570e", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1784160687, @@ -1726,7 +1689,6 @@ "nixpkgs": "nixpkgs_9", "nixpkgs-unstable": "nixpkgs-unstable", "noctalia": "noctalia", - "scrolloverview": "scrolloverview", "stylix": "stylix", "systems": "systems_6" } @@ -1748,29 +1710,6 @@ "type": "github" } }, - "scrolloverview": { - "inputs": { - "flake-parts": "flake-parts_3", - "hyprland": [ - "hyprland" - ], - "nixpkgs": "nixpkgs_10" - }, - "locked": { - "lastModified": 1787510763, - "narHash": "sha256-+mvHHi5Ou9RB6G5E3qMoxkATtAFuFoJlIev0yfkDI0Q=", - "owner": "yayuuu", - "repo": "hyprland-scroll-overview", - "rev": "a8e47fa769be1f0bdceb9869b2dfea97a84a1ecc", - "type": "github" - }, - "original": { - "owner": "yayuuu", - "ref": "new-release", - "repo": "hyprland-scroll-overview", - "type": "github" - } - }, "stylix": { "inputs": { "base16": "base16", @@ -1778,7 +1717,7 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts_4", + "flake-parts": "flake-parts_3", "gnome-shell": "gnome-shell", "nixpkgs": [ "nixpkgs" diff --git a/flake.nix b/flake.nix index ec73eff..5efbc27 100644 --- a/flake.nix +++ b/flake.nix @@ -52,14 +52,6 @@ # Hyprland compositor via flake (latest git). hyprland.url = "github:hyprwm/Hyprland"; - # Hyprland niri-like scroll overview plugin. - # `new-release` branch, not `main`: our hyprland input is a git build, and - # main still includes the pre-refactor managers/EventManager.hpp (fails to - # compile against Hyprland 0.56+git). new-release targets current git. - scrolloverview = { - url = "github:yayuuu/hyprland-scroll-overview/new-release"; - inputs.hyprland.follows = "hyprland"; - }; # Secrets management agenix.url = "github:ryantm/agenix"; # Claude Desktop @@ -82,7 +74,6 @@ , stylix , hyprlauncher , hyprland - , scrolloverview , dms , noctalia , git-hooks @@ -117,7 +108,6 @@ inherit hyprlauncher hyprland - scrolloverview nixpkgs-unstable dms noctalia diff --git a/hosts/fwbook.nix b/hosts/fwbook.nix index fbfd8bb..b986c08 100644 --- a/hosts/fwbook.nix +++ b/hosts/fwbook.nix @@ -44,6 +44,7 @@ in enable = true; hyprland.enable = true; noctalia.enable = true; + quickshell.enable = true; niri = { enable = true; touchscreen-gestures = { diff --git a/modules/nixos/desktop/tiler/ABOUTME.md b/modules/nixos/desktop/tiler/ABOUTME.md index b9038db..1744d6f 100644 --- a/modules/nixos/desktop/tiler/ABOUTME.md +++ b/modules/nixos/desktop/tiler/ABOUTME.md @@ -13,6 +13,7 @@ tiler/ ├── niri-touchscreen-gestures.nix # skyg.nixos.desktop.tiler.niri.touchscreen-gestures — touchscreen swipe support ├── hyprland.nix # skyg.nixos.desktop.tiler.hyprland — Hyprland via flake (sets tiler.enable) ├── noctalia.nix # skyg.nixos.desktop.tiler.noctalia — noctalia shell + per-host config symlink +├── quickshell.nix # skyg.nixos.desktop.tiler.quickshell — qs package + per-host config symlink └── swww.nix # skyg.nixos.desktop.tiler.background — swww/waypaper wallpaper tools ``` @@ -37,6 +38,8 @@ skyg.nixos.desktop.tiler.hyprland.enable skyg.nixos.desktop.tiler.hyprland.configName # per-host config dir (default: hostName) skyg.nixos.desktop.tiler.noctalia.enable # standalone noctalia + config symlink skyg.nixos.desktop.tiler.noctalia.configName # per-host config dir (default: hostName) +skyg.nixos.desktop.tiler.quickshell.enable # qs package + config symlink (e.g. fwbook's overview) +skyg.nixos.desktop.tiler.quickshell.configName # per-host config dir (default: hostName) skyg.nixos.desktop.tiler.background.enable ``` @@ -47,11 +50,8 @@ skyg.nixos.desktop.tiler.background.enable - Installs the noctalia shell and autostart-friendly tools (grim/slurp/satty, wofi/rofi, hypridle, wl-clipboard). There is no waybar/hyprpanel — the shell is noctalia. -- Hyprland plugins (=scrolloverview overview): the packages are - installed and their `.so` paths exported as session variables (`SCROLLOVERVIEW_SO`); - `scrolloverview.lua` call `hl.plugin.load` on them. The store path changes on every - flake update, so it can't be hardcoded in the config. The active plugin is toggled - by the `*_SO` line here plus the matching `require()` in `hyprland.lua`. +- No Hyprland overview plugin — the scrolling overview is a standalone Quickshell + config (`quickshell.nix`, see below), not a Hyprland plugin. - Symlinks `~/.config/hypr` -> `configs//hypr`, where `configName` defaults to `config.skyg.core.hostName` (so `fwbook` -> `configs/fwbook/hypr`). @@ -62,14 +62,18 @@ hyprlang — Hyprland 0.55+ deprecated hyprlang in favor of Lua. See The Hyprland Cachix cache (`hyprland.cachix.org`) is added in `modules/core/nix-substituters.nix` so the flake build doesn't compile from source. -### No overview plugin +### Quickshell -We intentionally do not ship an overview plugin. hyprexpo was dropped from the -official `hyprland-plugins` repo in 2026, and the maintained community fork -(`sandwichfarm/hyprexpo`) chases Hyprland `main` and fails to build against -tagged releases — it's a moving target. `Mod+Tab` falls back to `cyclenext` -instead of niri's `toggle-overview`. Revisit if a plugin lands in nixpkgs -kept in sync with the packaged Hyprland. +`quickshell.nix` installs `pkgs.quickshell` (the `qs` binary) and symlinks +`~/.config/quickshell` -> `configs//quickshell`, mirroring the +Hyprland/noctalia modules. It's a general-purpose Quickshell config host, not +Hyprland-specific — `fwbook` uses it for the scrolling overview +(`configs/fwbook/quickshell/overview/`, see +`configs/fwbook/hypr/ABOUTME.md`), a standalone `qs -c overview` process +independent of noctalia/DMS. We previously tried Hyprland overview plugins +(hyprexpo, then a community `hyprland-scroll-overview` fork); both were +dropped as moving targets that chased Hyprland `main` and failed to build +against tagged releases. Quickshell avoids the plugin-ABI churn entirely. ## Conventions diff --git a/modules/nixos/desktop/tiler/default.nix b/modules/nixos/desktop/tiler/default.nix index ea213dd..bb19d70 100644 --- a/modules/nixos/desktop/tiler/default.nix +++ b/modules/nixos/desktop/tiler/default.nix @@ -13,6 +13,7 @@ in ./niri.nix ./niri-touchscreen-gestures.nix ./noctalia.nix + ./quickshell.nix ./swww.nix ]; options = { diff --git a/modules/nixos/desktop/tiler/hyprland.nix b/modules/nixos/desktop/tiler/hyprland.nix index 3db2547..7655ab9 100644 --- a/modules/nixos/desktop/tiler/hyprland.nix +++ b/modules/nixos/desktop/tiler/hyprland.nix @@ -3,7 +3,6 @@ , pkgs , skygUtils , hyprland -, scrolloverview , noctalia , ... }: @@ -56,11 +55,7 @@ in grim slurp satty - scrolloverview.packages.${system}.scrolloverview ]; - # Resolved store path for the scrolloverview plugin - environment.sessionVariables.SCROLLOVERVIEW_SO = - "${scrolloverview.packages.${system}.scrolloverview}/lib/libscrolloverview.so"; # Symlink ~/.config/hypr -> configs//hypr (host-specific). system.userActivationScripts.hyprlandConfig.text = skygUtils.makeHyperlinkScriptToConfigs { diff --git a/modules/nixos/desktop/tiler/quickshell.nix b/modules/nixos/desktop/tiler/quickshell.nix new file mode 100644 index 0000000..3b51862 --- /dev/null +++ b/modules/nixos/desktop/tiler/quickshell.nix @@ -0,0 +1,35 @@ +{ config +, lib +, pkgs +, skygUtils +, ... +}: +let + cfg = config.skyg.nixos.desktop.tiler.quickshell; +in +{ + options = { + skyg.nixos.desktop.tiler.quickshell = { + enable = lib.mkEnableOption "quickshell"; + configName = lib.mkOption { + type = lib.types.str; + default = config.skyg.core.hostName; + description = '' + Name of the per-host Quickshell config directory under `configs/`. + The module symlinks `~/.config/quickshell` -> `configs//quickshell`. + Defaults to the machine's hostName (e.g. `fwbook` -> `configs/fwbook/quickshell`). + ''; + }; + }; + }; + config = lib.mkIf cfg.enable { + environment.systemPackages = [ pkgs.quickshell ]; + + # Symlink ~/.config/quickshell -> configs//quickshell (host-specific). + system.userActivationScripts.quickshellCfg.text = skygUtils.makeHyperlinkScriptToConfigs { + filePath = "${cfg.configName}/quickshell"; + targetPath = "quickshell"; + configSource = "/home/${config.skyg.user.name}/nixos-setup/configs"; + }; + }; +}