xmonad-config/xmonad.hs
2020-12-14 21:49:03 +02:00

74 lines
2.8 KiB
Haskell
Executable file

-- 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
import XMonad
import XMonad.Actions.DynamicProjects
import XMonad.Config.Desktop
import XMonad.Hooks.DynamicLog
--import XMonad.Hooks.EwmhDesktops (ewmh, ewmhFullscreen)
import XMonad.Hooks.EwmhDesktops (ewmh)
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.NoBorders (noBorders, smartBorders)
import XMonad.Layout.ResizableTile (ResizableTall(..))
import XMonad.Layout.Spacing
import XMonad.Layout.ToggleLayouts (toggleLayouts)
import XMonad.Util.EZConfig
import qualified Nord as N
import qualified XMonad.Layout.Spacing as SS (Border(..))
-- Tidy modules
import KeyBindings as Keys (modify)
import MouseBindings as Mouse (modify)
import Projects (modify)
import Scratchpad (modify)
--------- toggle btw vvvvvvvvvv or vvvvv
layouts = toggleLayouts fullscreen tiled
where
smallBorder = SS.Border 5 5 5 5
fullscreen = (noBorders Full)
tiled = smarts $ resizableTall ||| (Mirror resizableTall)
smarts = (spacingRaw True smallBorder True smallBorder True) . smartBorders
resizableTall = ResizableTall 1 (5/100) (1/2) []
-- Use the `xprop' tool to get the info you need for these matches.
-- For className, use the second value that xprop gives you.
-------------- Here be the law of windows
myManageHook = composeOne
[ className =? "Pavucontrol" -?> doShift "music"
, className =? "Pinentry" -?> doFloat
, className =? "Steam" -?> doShift "steam"
, className =? "VirtualBox" -?> doFloat
, className =? "csgo_linux64" -?> doShift "csgo"
, className =? "mpv" -?> doFullFloat <+> (doShift "flims")
, className =? "qemu-system-x86_64" -?> doFloat
, className =? "qutebrowser" -?> doShift "web"
, appName =? "Wine System Tray" -?> doShift "wine-tray"
, className =? "battle.net.exe" -?> doShift "battlenet"
, isDialog -?> doCenterFloat
-- Move transient windows to their parent:
, transience
]
------------ build the full config
withConfig =
ewmh
$ Projects.modify -- Apply projects config
$ Keys.modify -- Apply keybindings config
$ Mouse.modify -- Apply mouse bindings config
$ Scratchpad.modify -- Apply scratchpad managehook config
$ desktopConfig -- on a default desktop config
{ manageHook = myManageHook <+> manageHook desktopConfig
, layoutHook = desktopLayoutModifiers layouts
, terminal = "/home/eeva/.nix-profile/bin/alacritty"
, normalBorderColor = N.backgroundhl
, focusedBorderColor = N.nord9
, borderWidth = 5
}
------ and pass it to xmonad:
main = xmonad withConfig