hyprland: make scratchpads tile by default

This commit is contained in:
2026-06-27 00:19:41 -07:00
parent 8fbebc2a71
commit d5a834e1dc
3 changed files with 4 additions and 18 deletions

View File

@@ -260,8 +260,8 @@ Required behavior:
- A named scratchpad exists for volume.
- A named scratchpad exists for x.com.
- Scratchpads appear near-fullscreen and centered by default.
- The codex, claude, and x.com scratchpads can be tiled into the normal
workspace when desired, while retaining their summon/dismiss toggles.
- Regular scratchpads can be tiled into the normal workspace when desired,
while retaining their summon/dismiss toggles.
- Toggling a scratchpad deactivates fullscreen/tabbed state first.
- Floating scratchpads are hidden from normal workspace and window listings.

View File

@@ -15,12 +15,10 @@ function M.setup(ctx)
codex = {
command = "codex_desktop_scratchpad",
class = "codex-desktop",
allow_tiling = true,
},
claude = {
command = "claude-desktop",
class = "claude-desktop",
allow_tiling = true,
},
htop = {
command = "alacritty --class htop-scratch --title htop -e htop",
@@ -55,7 +53,6 @@ function M.setup(ctx)
command = "x-com-pwa",
classes = { "x-com-pwa", "chrome-x.com" },
title = "X",
allow_tiling = true,
},
transmission = {
command = "transmission-gtk",
@@ -65,6 +62,7 @@ function M.setup(ctx)
command = "ghostty --config-file=/home/imalison/.config/ghostty/dropdown",
class = "com.mitchellh.ghostty.dropdown",
dropdown = true,
allow_tiling = false,
},
}
@@ -99,7 +97,7 @@ function M.setup(ctx)
end
local function tiled_scratchpad_is_normal_window(window, def)
return def.allow_tiling and window and window.floating == false
return def.allow_tiling ~= false and window and window.floating == false
end
local function is_scratchpad_window(window)

View File

@@ -828,21 +828,9 @@ myScratchPadEventHook
= dynamicPropertyChange "WM_CLASS" myScratchPadManageHook
<> dynamicPropertyChange "WM_NAME" myScratchPadManageHook
runScratchPadManageHookOnCurrent =
join (withFocusedD (Endo id) $ runQuery myScratchPadManageHook) >>= windows . appEndo
scratchPadIsDisplayed name = join $ withFocusedD False query
where
query = maybe (const $ return False) (runQuery . NS.query) scratchpadInfo
scratchpadInfo = find ((name ==) . NS.name) scratchpads
manageIfScratchPadIsDisplayed name =
scratchPadIsDisplayed name >>= (`when` runScratchPadManageHookOnCurrent)
-- TODO: This doesnt work well with minimized windows
doScratchpad name = do
maybeUnminimizeAfter $ deactivateFullAnd $ namedScratchpadAction scratchpads name
manageIfScratchPadIsDisplayed name
-- Raise or spawn