hyprland: make scratchpads tile by default
This commit is contained in:
@@ -260,8 +260,8 @@ Required behavior:
|
|||||||
- A named scratchpad exists for volume.
|
- A named scratchpad exists for volume.
|
||||||
- A named scratchpad exists for x.com.
|
- A named scratchpad exists for x.com.
|
||||||
- Scratchpads appear near-fullscreen and centered by default.
|
- Scratchpads appear near-fullscreen and centered by default.
|
||||||
- The codex, claude, and x.com scratchpads can be tiled into the normal
|
- Regular scratchpads can be tiled into the normal workspace when desired,
|
||||||
workspace when desired, while retaining their summon/dismiss toggles.
|
while retaining their summon/dismiss toggles.
|
||||||
- Toggling a scratchpad deactivates fullscreen/tabbed state first.
|
- Toggling a scratchpad deactivates fullscreen/tabbed state first.
|
||||||
- Floating scratchpads are hidden from normal workspace and window listings.
|
- Floating scratchpads are hidden from normal workspace and window listings.
|
||||||
|
|
||||||
|
|||||||
@@ -15,12 +15,10 @@ function M.setup(ctx)
|
|||||||
codex = {
|
codex = {
|
||||||
command = "codex_desktop_scratchpad",
|
command = "codex_desktop_scratchpad",
|
||||||
class = "codex-desktop",
|
class = "codex-desktop",
|
||||||
allow_tiling = true,
|
|
||||||
},
|
},
|
||||||
claude = {
|
claude = {
|
||||||
command = "claude-desktop",
|
command = "claude-desktop",
|
||||||
class = "claude-desktop",
|
class = "claude-desktop",
|
||||||
allow_tiling = true,
|
|
||||||
},
|
},
|
||||||
htop = {
|
htop = {
|
||||||
command = "alacritty --class htop-scratch --title htop -e htop",
|
command = "alacritty --class htop-scratch --title htop -e htop",
|
||||||
@@ -55,7 +53,6 @@ function M.setup(ctx)
|
|||||||
command = "x-com-pwa",
|
command = "x-com-pwa",
|
||||||
classes = { "x-com-pwa", "chrome-x.com" },
|
classes = { "x-com-pwa", "chrome-x.com" },
|
||||||
title = "X",
|
title = "X",
|
||||||
allow_tiling = true,
|
|
||||||
},
|
},
|
||||||
transmission = {
|
transmission = {
|
||||||
command = "transmission-gtk",
|
command = "transmission-gtk",
|
||||||
@@ -65,6 +62,7 @@ function M.setup(ctx)
|
|||||||
command = "ghostty --config-file=/home/imalison/.config/ghostty/dropdown",
|
command = "ghostty --config-file=/home/imalison/.config/ghostty/dropdown",
|
||||||
class = "com.mitchellh.ghostty.dropdown",
|
class = "com.mitchellh.ghostty.dropdown",
|
||||||
dropdown = true,
|
dropdown = true,
|
||||||
|
allow_tiling = false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +97,7 @@ function M.setup(ctx)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function tiled_scratchpad_is_normal_window(window, def)
|
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
|
end
|
||||||
|
|
||||||
local function is_scratchpad_window(window)
|
local function is_scratchpad_window(window)
|
||||||
|
|||||||
@@ -828,21 +828,9 @@ myScratchPadEventHook
|
|||||||
= dynamicPropertyChange "WM_CLASS" myScratchPadManageHook
|
= dynamicPropertyChange "WM_CLASS" myScratchPadManageHook
|
||||||
<> dynamicPropertyChange "WM_NAME" 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
|
-- TODO: This doesnt work well with minimized windows
|
||||||
doScratchpad name = do
|
doScratchpad name = do
|
||||||
maybeUnminimizeAfter $ deactivateFullAnd $ namedScratchpadAction scratchpads name
|
maybeUnminimizeAfter $ deactivateFullAnd $ namedScratchpadAction scratchpads name
|
||||||
manageIfScratchPadIsDisplayed name
|
|
||||||
|
|
||||||
-- Raise or spawn
|
-- Raise or spawn
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user