diff --git a/settings/hyprland.nix b/settings/hyprland.nix index 11589fc..4d74837 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -263,6 +263,20 @@ in hl.layer_rule({ match = { namespace = "quickshell-bar" }, blur = true, ignore_alpha = 0.3 }) hl.layer_rule({ match = { namespace = "quickshell-osd" }, blur = true, ignore_alpha = 0.3 }) + -- Scratchpad respawn: both special-workspace terminals are meant to + -- exist for the whole session, so SUPER+Q on them reads as "reset + -- this thing", not "close it". Relaunch on close. + local scratchpads = { + ["scratchpad"] = "ghostty --title=scratchpad", + ["spotify-player"] = "ghostty --title=spotify-player -e spotify_player", + } + local shutting_down = false + hl.on("hyprland.shutdown", function() shutting_down = true end) + hl.on("window.close", function(win) + local cmd = scratchpads[win.title] + if cmd and not shutting_down then hl.exec_cmd(cmd) end + end) + -- Startup hl.on("hyprland.start", function() -- Ensure hyprland-session.target starts even if HM's