Add scratchpad and fix floating.

This commit is contained in:
CronyAkatsuki 2024-02-07 22:18:21 +01:00
parent a613c33712
commit def66dc28a

View File

@ -6,6 +6,7 @@ import qualified XMonad.StackSet as W
-- Actions
import XMonad.Actions.CycleWS (toggleWS')
import XMonad.Actions.MouseResize
import XMonad.Actions.SinkAll (sinkAll)
-- Data
import qualified Data.Map as M
@ -98,6 +99,7 @@ myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm
, NS "wiki" spawnWiki findWiki manageWiki
, NS "notes" spawnNotes findNotes manageNotes
, NS "profanity" spawnProfanity findProfanity manageProfanity
, NS "godot" spawnGodot findGodot manageGodot
]
where
spawnTerm = myTerminal ++ " --class scratchpad,scratchpad"
@ -132,6 +134,14 @@ myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm
w = 0.8
t = 0.9 -h
l = 0.9 -w
spawnGodot = myTerminal ++ " --class godot,godot -e nvim --listen /tmp/godot.pipe"
findGodot = className =? "godot"
manageGodot = customFloating $ W.RationalRect l t w h
where
h = 0.8
w = 0.8
t = 0.9 -h
l = 0.9 -w
--Makes setting the spacingRaw simpler to write. The spacingRaw module adds a configurable amount of space around windows.
@ -227,6 +237,7 @@ myKeys = \c -> mkKeymap c $
, ("M-s w", namedScratchpadAction myScratchPads "wiki") -- Toggle scratchpad
, ("M-s n", namedScratchpadAction myScratchPads "notes") -- Toggle scratchpad
, ("M-s p", namedScratchpadAction myScratchPads "profanity") -- Toggle scratchpad
, ("M-s g", namedScratchpadAction myScratchPads "godot") -- Toggle scratchpad
, ("M-1", viewDesktop 0) -- Check workspace 1
, ("M-2", viewDesktop 1) -- Check workspace 2
, ("M-3", viewDesktop 2) -- Check workspace 3
@ -254,6 +265,7 @@ myKeys = \c -> mkKeymap c $
, ("M-C-7", shiftAndView 6) -- Send window and check workspace 7
, ("M-C-8", shiftAndView 7) -- Send window and check workspace 8
, ("M-C-9", shiftAndView 8) -- Send window and check workspace 9
, ("M-f", sinkAll) -- Nuke solution for simplestFloat layout
]
where
toggleFloat w = windows (\s -> if M.member w (W.floating s)