From 3e123796943f6c1297f896105b082d3e1a2e259b Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Mon, 7 Sep 2026 14:27:58 +0200 Subject: [PATCH] feat(hyprland): route apps through special workspaces --- system-config/config/user/common/hypr/hyprland.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/system-config/config/user/common/hypr/hyprland.lua b/system-config/config/user/common/hypr/hyprland.lua index d96fe95..9a9ead5 100644 --- a/system-config/config/user/common/hypr/hyprland.lua +++ b/system-config/config/user/common/hypr/hyprland.lua @@ -113,7 +113,8 @@ for _, direction in ipairs({ "left", "down", "up", "right" }) do hl.bind(main_mod .. " + " .. direction, hl.dsp.focus({ direction = direction })) end -for key, direction in pairs({ H = "l", J = "d", K = "u", L = "r", LEFT = "l", DOWN = "d", UP = "u", RIGHT = "r" }) do +-- Super+Shift+K is reserved for Obsidian; Super+Shift+Up still moves windows up. +for key, direction in pairs({ H = "l", J = "d", L = "r", LEFT = "l", DOWN = "d", UP = "u", RIGHT = "r" }) do hl.bind(main_mod .. " + SHIFT + " .. key, hl.dsp.window.move({ direction = direction })) end @@ -133,6 +134,9 @@ hl.bind(main_mod .. " + CTRL + LEFT", hl.dsp.focus({ workspace = "-1" })) -- Hyprland special workspaces are the Wayland analogue of the i3 scratchpad. hl.bind(main_mod .. " + MINUS", hl.dsp.workspace.toggle_special("scratchpad")) hl.bind(main_mod .. " + SHIFT + MINUS", hl.dsp.window.move({ workspace = "special:scratchpad" })) +hl.bind(main_mod .. " + SHIFT + S", hl.dsp.workspace.toggle_special("spotify")) +hl.bind(main_mod .. " + SHIFT + M", hl.dsp.workspace.toggle_special("mail")) +hl.bind(main_mod .. " + SHIFT + K", hl.dsp.workspace.toggle_special("obsidian")) -- Keep the i3 floating and fullscreen shortcuts. Layout-specific binds are deferred. hl.bind(main_mod .. " + F", hl.dsp.window.fullscreen({ action = "toggle" })) @@ -150,8 +154,8 @@ local function float_rule(name, match, border_size) }) end -hl.window_rule({ name = "obsidian-workspace", match = { class = "^obsidian$" }, workspace = "8" }) -hl.window_rule({ name = "thunderbird-workspace", match = { class = "^Thunderbird$" }, workspace = "9" }) +hl.window_rule({ name = "obsidian-workspace", match = { class = "^obsidian$" }, workspace = "special:obsidian silent", no_initial_focus = true }) +hl.window_rule({ name = "thunderbird-mail", match = { class = "^(Thunderbird|thunderbird)$" }, workspace = "special:mail silent", no_initial_focus = true }) float_rule("pi-status-ui", { class = "^(pi-status-ui|Pi-status-ui)$" }, 1) float_rule("alsamixer", { title = "^alsamixer$" }, 1) float_rule("qalculate", { title = "^Qalculate!$" }) @@ -162,8 +166,8 @@ float_rule("volume-control", { title = "^Volume Control$" }) float_rule("virtualbox", { class = ".*VirtualBox.*" }) hl.window_rule({ name = "virtualbox-manager-tiles", match = { class = ".*VirtualBox Manager.*" }, tile = true }) hl.window_rule({ name = "virtualbox-machine-tiles", match = { class = ".*VirtualBox Machine.*" }, tile = true }) --- Send music clients to the existing scratchpad without stealing startup focus. -hl.window_rule({ name = "spotify-music", match = { class = "^Spotify$" }, workspace = "special:scratchpad silent", no_initial_focus = true }) +-- Send music clients to hidden workspaces without stealing startup focus. +hl.window_rule({ name = "spotify-music", match = { class = "^Spotify$" }, workspace = "special:spotify silent", no_initial_focus = true }) hl.window_rule({ name = "deezer-music", match = { class = "^Deezer$" }, workspace = "special:scratchpad silent", no_initial_focus = true }) hl.on("hyprland.start", function()