blob: bbd949fd46f743428e8c334bc521259b25c3d858 [file] [log] [blame]
Skyler Greyb43ac6b2022-10-31 00:48:34 +00001-- spell-checker:words xmonad
2import XMonad
3
Skyler Greye2ec0de2022-11-02 08:07:25 +00004import System.Exit
Skyler Greyb43ac6b2022-10-31 00:48:34 +00005import XMonad.Util.EZConfig
6
Skyler Grey51a0c612022-11-05 09:59:04 +00007import XMonad.Hooks.EwmhDesktops
8import XMonad.Hooks.ManageDocks
9import XMonad.Config.Desktop
10
11import XMonadLog
12import XMonad.Hooks.DynamicLog
13import qualified DBus.Client as D
14
15import XMonad.Layout.Spacing
16import XMonad.Layout.Gaps
17
Skyler Greye2ec0de2022-11-02 08:07:25 +000018terminal = "kitty" -- Kitty, my beloved <3
19launcher = "pkill rofi; rofi -show combi"
20networkManager = "wpa_cli select_network $(wpa_cli list_networks | tail -n +3 | rofi -dmenu -window-title 'Select Network' | awk '{print $1;}')"
21modifierKey = mod4Mask -- Use Super as our mod key
22
Skyler Grey34021e32022-11-04 09:28:03 +000023statusBar = "pkill polybar; polybar"
Skyler Grey51a0c612022-11-05 09:59:04 +000024compositor = "pkill picom; picom"
25background = "feh --no-fehbg --bg-fill .xmonad/background.png"
Skyler Grey34021e32022-11-04 09:28:03 +000026
Skyler Greye2ec0de2022-11-02 08:07:25 +000027shift = shiftMask
28
Skyler Grey34021e32022-11-04 09:28:03 +000029startupHook = do
Skyler Grey51a0c612022-11-05 09:59:04 +000030 spawn Main.statusBar
31 spawn Main.compositor
32 spawn background
33
Skyler Grey34021e32022-11-04 09:28:03 +000034
Skyler Greyb43ac6b2022-10-31 00:48:34 +000035main :: IO ()
Skyler Grey51a0c612022-11-05 09:59:04 +000036main = XMonadLog.xmonadLog >>= main'
37
38main' :: D.Client -> IO ()
39main' dbus = xmonad $ docks $ ewmh . ewmhFullscreen $ def
Skyler Greye2ec0de2022-11-02 08:07:25 +000040 { modMask = modifierKey -- Use Super as our mod key
Skyler Grey51a0c612022-11-05 09:59:04 +000041 , borderWidth = 0
Skyler Greye2ec0de2022-11-02 08:07:25 +000042 , XMonad.terminal = Main.terminal
Skyler Grey51a0c612022-11-05 09:59:04 +000043 , XMonad.startupHook = Main.startupHook
44 , XMonad.logHook = dynamicLogWithPP (polybarHook dbus)
45 , XMonad.layoutHook = avoidStruts $
46 smartSpacing 5 $
47 gaps [(U, 5), (D, 5), (L, 5), (R, 5)] $
48 layoutHook def
Skyler Greye2ec0de2022-11-02 08:07:25 +000049 } `additionalKeys`
50 [ ((modifierKey, xK_d), spawn launcher)
51 , ((modifierKey, xK_n), spawn networkManager)
52 , ((modifierKey .|. shift, xK_q), kill)
53 , ((modifierKey, xK_q), spawn "xmonad --restart")
54 , ((modifierKey .|. shift, xK_c), io (exitWith ExitSuccess))
55 ]