xmonad-config/xmonad.hs

72 lines
2.6 KiB
Haskell
Raw Normal View History

2017-12-10 01:14:39 +01:00
-- My xmonad configuration, based on the example.hs of the xmonad project
-- including best practises.
-- https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Config/Example.hs
module Main (main) where
2017-12-08 19:32:06 +01:00
import XMonad
import XMonad.Actions.DynamicProjects
2017-12-08 19:32:06 +01:00
import XMonad.Config.Desktop
import XMonad.Hooks.DynamicLog
2020-07-25 16:49:14 +02:00
--import XMonad.Hooks.EwmhDesktops (ewmh, ewmhFullscreen)
import XMonad.Hooks.EwmhDesktops (ewmh)
2017-12-08 19:32:06 +01:00
import XMonad.Hooks.ManageHelpers
2021-08-22 23:02:59 +02:00
import XMonad.Layout.NoBorders (noBorders, smartBorders, hasBorder, BorderMessage (HasBorder))
2017-12-10 01:14:39 +01:00
import XMonad.Layout.ResizableTile (ResizableTall(..))
import XMonad.Layout.Spacing
2017-12-12 20:55:08 +01:00
import XMonad.Layout.ToggleLayouts (toggleLayouts)
2017-12-10 01:14:39 +01:00
import XMonad.Util.EZConfig
2020-03-08 08:51:14 +01:00
import qualified Nord as N
2020-03-10 14:51:05 +01:00
import qualified XMonad.Layout.Spacing as SS (Border(..))
2017-12-08 19:32:06 +01:00
-- Tidy modules
import KeyBindings as Keys (modify)
2017-12-12 20:55:08 +01:00
import MouseBindings as Mouse (modify)
2018-05-27 15:39:24 +02:00
import Projects (modify)
import Scratchpad (modify)
2017-12-10 01:14:39 +01:00
2017-12-12 20:55:08 +01:00
--------- toggle btw vvvvvvvvvv or vvvvv
layouts = toggleLayouts fullscreen tiled
2017-12-08 19:32:06 +01:00
where
2020-03-10 14:51:05 +01:00
smallBorder = SS.Border 5 5 5 5
2021-08-25 03:51:46 +02:00
fullscreen = noBorders Full
tiled = smarts $ resizableTall ||| Mirror resizableTall
smarts = spacingRaw True smallBorder True smallBorder True . smartBorders
2017-12-11 12:30:50 +01:00
resizableTall = ResizableTall 1 (5/100) (1/2) []
2017-12-10 01:14:39 +01:00
-- Use the `xprop' tool to get the info you need for these matches.
-- For className, use the second value that xprop gives you.
2017-12-12 20:55:08 +01:00
-------------- Here be the law of windows
2021-08-25 03:51:46 +02:00
myManageHook = composeAll
2021-10-05 22:40:55 +02:00
[ className =? "Patchage" --> doShift "patchage"
2021-08-25 03:51:46 +02:00
, className =? "Pavucontrol" --> doShift "music"
, className =? "Pinentry" --> doCenterFloat
, className =? "REAPER" --> hasBorder False
, className =? "Renoise" --> hasBorder False
, className =? "Steam" --> doShift "steam"
, className =? "csgo_linux64" --> doShift "steam"
, isDialog --> doCenterFloat
2017-12-10 01:14:39 +01:00
-- Move transient windows to their parent:
2021-08-25 03:51:46 +02:00
, transience'
2017-12-10 01:14:39 +01:00
]
2017-12-12 20:55:08 +01:00
------------ build the full config
withConfig =
2020-10-16 18:28:13 +02:00
ewmh
$ Projects.modify -- Apply projects config
2018-05-27 15:39:24 +02:00
$ Keys.modify -- Apply keybindings config
$ Mouse.modify -- Apply mouse bindings config
$ Scratchpad.modify -- Apply scratchpad managehook config
$ desktopConfig -- on a default desktop config
2021-08-22 23:02:59 +02:00
{ manageHook = myManageHook
2017-12-12 20:55:08 +01:00
, layoutHook = desktopLayoutModifiers layouts
2022-02-19 16:24:39 +01:00
, terminal = "kitty"
2020-03-08 08:51:14 +01:00
, normalBorderColor = N.backgroundhl
, focusedBorderColor = N.nord9
2017-12-12 20:55:08 +01:00
, borderWidth = 5
}
2017-12-10 01:14:39 +01:00
2017-12-12 20:55:08 +01:00
------ and pass it to xmonad:
main = xmonad withConfig