feat(xmonad): Add scratchpads for a shell and emacs
This commit is contained in:
parent
e67f5fed51
commit
203749c452
1 changed files with 31 additions and 3 deletions
|
|
@ -3,7 +3,7 @@ import XMonad.Actions.CycleWS qualified as WS
|
|||
import XMonad.Actions.Navigation2D (navigation2DP, windowGo, windowSwap)
|
||||
import XMonad.Hooks.EwmhDesktops
|
||||
import XMonad.Hooks.ManageDocks qualified as Docks
|
||||
import XMonad.Hooks.ManageHelpers (doFullFloat, isDialog, isFullscreen)
|
||||
import XMonad.Hooks.ManageHelpers (doCenterFloat, doFullFloat, isDialog, isFullscreen)
|
||||
import XMonad.Hooks.SetWMName
|
||||
import XMonad.Layout.BinarySpacePartition
|
||||
import XMonad.Layout.BorderResize (borderResize)
|
||||
|
|
@ -11,8 +11,11 @@ import XMonad.Layout.NoBorders (smartBorders)
|
|||
import XMonad.Layout.ThreeColumns
|
||||
import XMonad.Layout.ToggleLayouts (ToggleLayout (..), toggleLayouts)
|
||||
import XMonad.ManageHook (doFloat)
|
||||
import XMonad.StackSet as W
|
||||
import XMonad.Util.EZConfig qualified as EZ
|
||||
import XMonad.Util.NamedScratchpad
|
||||
import XMonad.Util.Ungrab (unGrab)
|
||||
import XMonad.Util.WorkspaceCompare qualified as WS
|
||||
|
||||
import Control.Monad (when)
|
||||
import Numeric.Natural
|
||||
|
|
@ -60,8 +63,28 @@ interpretVolumeCommand command = "amixer -q set Master " <> cmd
|
|||
changeVolume :: VolumeCommand -> X ()
|
||||
changeVolume = spawn . interpretVolumeCommand
|
||||
|
||||
myWorkspaceFilter :: X WS.WorkspaceSort
|
||||
myWorkspaceFilter = do
|
||||
sortXineramaAware <- WS.getSortByXineramaRule
|
||||
pure $ sortXineramaAware . WS.filterOutWs [scratchpadWorkspaceTag]
|
||||
|
||||
scratchpads =
|
||||
[ NS
|
||||
"notes"
|
||||
"emacsclient -c -F '((name . \"gtd\"))'"
|
||||
(resource =? "gtd")
|
||||
doCenterFloat
|
||||
, -- (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3))
|
||||
NS
|
||||
"shell"
|
||||
"alacritty --class scratchpad"
|
||||
(resource =? "scratchpad")
|
||||
(customFloating $ W.RationalRect (1 / 6) (1 / 6) (2 / 3) (2 / 3))
|
||||
]
|
||||
|
||||
myConfig =
|
||||
ewmhFullscreen
|
||||
addEwmhWorkspaceSort myWorkspaceFilter
|
||||
. ewmhFullscreen
|
||||
. ewmh
|
||||
. Docks.docks
|
||||
. nav
|
||||
|
|
@ -74,8 +97,10 @@ myConfig =
|
|||
startupHook = ewmhDesktopsStartup >> setWMName "LG3D"
|
||||
, manageHook =
|
||||
mconcat
|
||||
[ isDialog --> doFloat
|
||||
[ namedScratchpadManageHook scratchpads
|
||||
, isDialog --> doFloat
|
||||
, isFullscreen --> doFullFloat
|
||||
, manageHook def
|
||||
]
|
||||
}
|
||||
`EZ.additionalKeysP` [ ("M-S-z", spawn "xscreensaver-command -lock")
|
||||
|
|
@ -90,6 +115,9 @@ myConfig =
|
|||
, ("M-l", WS.toggleWS)
|
||||
, ("M-g", WS.prevWS)
|
||||
, ("M-r", WS.nextWS)
|
||||
, -- scratchpads
|
||||
("M-s n", namedScratchpadAction scratchpads "notes")
|
||||
, ("M-s s", namedScratchpadAction scratchpads "shell")
|
||||
, -- backlight control
|
||||
|
||||
("<XF86MonBrightnessDown>", spawn "xbacklight -dec 5")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue