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.Config.Desktop
|
|
|
|
import XMonad.Hooks.DynamicLog
|
|
|
|
import XMonad.Hooks.ManageHelpers
|
2017-12-10 01:14:39 +01:00
|
|
|
import XMonad.Layout.NoBorders (noBorders, smartBorders)
|
|
|
|
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
|
|
|
|
import qualified Solarized as S
|
2017-12-08 19:32:06 +01:00
|
|
|
|
2017-12-12 00:48:56 +01:00
|
|
|
-- Tidy modules
|
|
|
|
import StatusBar as Bar (modify)
|
|
|
|
import KeyBindings as Keys (modify)
|
2017-12-12 20:55:08 +01:00
|
|
|
import MouseBindings as Mouse (modify)
|
2017-12-12 00:48:56 +01:00
|
|
|
|
2017-12-12 20:55:08 +01:00
|
|
|
-------- A list of my usual workspaces (with some FontAwesome & xmobar format)
|
2017-12-10 22:52:41 +01:00
|
|
|
wkspcs = [ wrap "<fn=1>" "</fn>" "\xF0E0" -- email
|
|
|
|
, wrap "<fn=1>" "</fn>" "\xF086" -- chat
|
|
|
|
, wrap "<fn=1>" "</fn>" "\xF120" -- work
|
2018-01-27 14:03:59 +01:00
|
|
|
, wrap "<fn=1>" "</fn>" "\xF1B6" -- game
|
|
|
|
, wrap "<fn=1>" "</fn>" "\xF11B" -- game
|
2017-12-10 22:52:41 +01:00
|
|
|
, wrap "<fn=1>" "</fn>" "\xF09C" -- password
|
|
|
|
, wrap "<fn=1>" "</fn>" "\xF16C" -- web work
|
|
|
|
, wrap "<fn=1>" "</fn>" "\xF025" -- sound
|
|
|
|
, wrap "<fn=1>" "</fn>" "\xF269" -- web perso
|
|
|
|
, wrap "<fn=1>" "</fn>" "\xF03D" -- movie
|
|
|
|
]
|
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
|
2017-12-11 12:30:50 +01:00
|
|
|
fullscreen = (noBorders Full)
|
|
|
|
tiled = smarts $ resizableTall ||| (Mirror resizableTall)
|
|
|
|
smarts = (smartSpacingWithEdge 5) . smartBorders
|
|
|
|
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
|
2017-12-10 01:14:39 +01:00
|
|
|
myManageHook = composeOne
|
|
|
|
[ className =? "mpv" -?> doFullFloat <+> (doShift $ last wkspcs)
|
2018-01-27 14:03:59 +01:00
|
|
|
, className =? "Pinentry" -?> doFloat
|
|
|
|
, className =? "Steam" -?> doFloat
|
|
|
|
, className =? "csgo_linux64" -?> doFullFloat
|
2017-12-10 01:14:39 +01:00
|
|
|
, className =? "Pavucontrol" -?> doShift $ wkspcs !! 7
|
|
|
|
, className =? "qutebrowser" -?> doShift $ wkspcs !! 5
|
|
|
|
, isDialog -?> doCenterFloat
|
|
|
|
|
|
|
|
-- Move transient windows to their parent:
|
|
|
|
, transience
|
|
|
|
]
|
|
|
|
|
2017-12-12 20:55:08 +01:00
|
|
|
------------ build the full config
|
|
|
|
withConfig =
|
|
|
|
Bar.modify -- Apply statusBar config
|
|
|
|
$ Keys.modify -- Apply keybindings config
|
|
|
|
$ Mouse.modify -- Apply mouse bindings config
|
|
|
|
$ desktopConfig -- on a default desktop config
|
|
|
|
{ manageHook = myManageHook <+> manageHook desktopConfig
|
|
|
|
, layoutHook = desktopLayoutModifiers layouts
|
|
|
|
, terminal = "/run/current-system/sw/bin/kitty"
|
|
|
|
, workspaces = wkspcs
|
|
|
|
, normalBorderColor = S.base03
|
|
|
|
, focusedBorderColor = S.violet
|
|
|
|
, 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
|