xmonad-config/xmonad.hs

86 lines
3 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
import XMonad.Hooks.ManageHelpers
2019-04-17 16:31:38 +02:00
2017-12-10 01:14:39 +01:00
import XMonad.Layout.NoBorders (noBorders, smartBorders)
2020-10-16 09:43:31 +02:00
import XMonad.Layout.NoFrillsDecoration
2019-04-17 16:31:38 +02:00
import XMonad.Layout.PerScreen
import XMonad.Layout.Reflect
2017-12-10 01:14:39 +01:00
import XMonad.Layout.ResizableTile (ResizableTall(..))
import XMonad.Layout.Spacing
2019-05-31 17:42:52 +02:00
import XMonad.Layout.ThreeColumns (ThreeCol(..))
2017-12-12 20:55:08 +01:00
import XMonad.Layout.ToggleLayouts (toggleLayouts)
2019-04-17 16:31:38 +02:00
import XMonad.StackSet (sink)
2017-12-10 01:14:39 +01:00
import XMonad.Util.EZConfig
2021-07-14 11:49:35 +02:00
import XMonad.Util.SpawnOnce
2017-12-10 01:14:39 +01:00
import qualified Solarized as S
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)
2020-11-23 15:01:13 +01:00
import ScreenEvents (modify)
2017-12-10 01:14:39 +01:00
2020-10-16 09:43:31 +02:00
-------------------- toggle btw vvvvvvvvvv or vvvvv
--layouts = titleBar $ toggleLayouts fullscreen tiled
layouts = toggleLayouts fullscreen tiled
2017-12-08 19:32:06 +01:00
where
2017-12-11 12:30:50 +01:00
fullscreen = (noBorders Full)
2019-09-25 09:03:08 +02:00
tiled = smarts $ ifWider (1920 + 1) wideScreen normalScreen
2019-05-31 17:42:52 +02:00
wideScreen = ThreeColMid 1 (5/100) (1/2)
2021-07-14 11:49:35 +02:00
normalScreen = ResizableTall 1 (5/100) (1/2) []
2019-05-31 17:42:52 +02:00
smarts = (smartSpacingWithEdge 5) . smartBorders
--titleBar = noFrillsDeco shrinkText S.theme
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
2017-12-10 01:14:39 +01:00
myManageHook = composeOne
2022-09-15 15:23:00 +02:00
[ className =? "Gcr-prompter" -?> doCenterFloat
, className =? "Pavucontrol" -?> doShift "music"
2018-05-29 08:20:58 +02:00
, className =? "Pinentry" -?> doFloat
, className =? "VirtualBox" -?> doFloat
2022-09-15 15:23:00 +02:00
, className =? "gpclient" -?> doTile <+> (doShift "VPN")
2018-05-29 08:20:58 +02:00
, className =? "mpv" -?> doFullFloat <+> (doShift "flims")
, className =? "qemu-system-x86_64" -?> doFloat
, className =? "qutebrowser" -?> doShift "web"
, isDialog -?> doCenterFloat
2017-12-10 01:14:39 +01:00
-- Move transient windows to their parent:
, transience
]
doTile :: ManageHook
doTile = ask >>= doF . sink
2017-12-12 20:55:08 +01:00
------------ build the full config
withConfig =
2020-11-23 15:01:13 +01:00
Projects.modify -- Apply projects config
$ Keys.modify -- Apply keybindings config
$ Mouse.modify -- Apply mouse bindings config
$ Scratchpad.modify -- Apply scratchpad managehook config
$ ScreenEvents.modify -- Apply screen event hook config
$ desktopConfig -- on a default desktop config
2017-12-12 20:55:08 +01:00
{ manageHook = myManageHook <+> manageHook desktopConfig
, layoutHook = desktopLayoutModifiers layouts
2021-07-14 11:49:35 +02:00
, startupHook = spawnOnce "sh ~/.fehbg"
2021-12-15 11:38:09 +01:00
, terminal = "nvidia-offload kitty"
2017-12-12 20:55:08 +01:00
, normalBorderColor = S.base03
2023-03-10 14:09:07 +01:00
, focusedBorderColor = S.green
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