hyprland: respawn scratchpad + spotify-player on window close
This commit is contained in:
parent
66fb7536e8
commit
7c0098a184
1 changed files with 14 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue