blob: 660db50d334c1a2c24ca03ffc6c831e1925fd410 [file] [log] [blame]
Skyler Greyb43ac6b2022-10-31 00:48:34 +00001-- spell-checker:words xmonad
Skyler Greyf2c55ae2022-11-05 17:48:02 +00002import XMonad
Skyler Greyb43ac6b2022-10-31 00:48:34 +00003
Skyler Greyf2c55ae2022-11-05 17:48:02 +00004import System.Exit
5import XMonad.Util.EZConfig
Skyler Greyb43ac6b2022-10-31 00:48:34 +00006
Skyler Greyf2c55ae2022-11-05 17:48:02 +00007import XMonad.Config.Desktop
8import XMonad.Hooks.EwmhDesktops
9import XMonad.Hooks.ManageDocks
Skyler Grey51a0c612022-11-05 09:59:04 +000010
Skyler Greyf2c55ae2022-11-05 17:48:02 +000011import qualified DBus.Client as D
12import XMonad.Hooks.DynamicLog
13import XMonadLog
Skyler Grey51a0c612022-11-05 09:59:04 +000014
Skyler Greyf2c55ae2022-11-05 17:48:02 +000015import XMonad.Hooks.ManageHelpers (isInProperty, doLower)
16import XMonad.Layout.Gaps
17import XMonad.Layout.Spacing
18import Foreign.C
19import Blaze.ByteString.Builder (toByteString)
20import XMonad.Layout.Drawer (propertyToQuery)
Skyler Grey51a0c612022-11-05 09:59:04 +000021
Skyler Greye2ec0de2022-11-02 08:07:25 +000022terminal = "kitty" -- Kitty, my beloved <3
23launcher = "pkill rofi; rofi -show combi"
24networkManager = "wpa_cli select_network $(wpa_cli list_networks | tail -n +3 | rofi -dmenu -window-title 'Select Network' | awk '{print $1;}')"
25modifierKey = mod4Mask -- Use Super as our mod key
26
Skyler Grey34021e32022-11-04 09:28:03 +000027statusBar = "pkill polybar; polybar"
Skyler Grey51a0c612022-11-05 09:59:04 +000028compositor = "pkill picom; picom"
Skyler Greyf2c55ae2022-11-05 17:48:02 +000029background = "pkill show; show ~/.xmonad/wallpaper.glsl"
Skyler Grey34021e32022-11-04 09:28:03 +000030
Skyler Greye2ec0de2022-11-02 08:07:25 +000031shift = shiftMask
32
Skyler Grey34021e32022-11-04 09:28:03 +000033startupHook = do
Skyler Grey51a0c612022-11-05 09:59:04 +000034 spawn Main.statusBar
35 spawn Main.compositor
36 spawn background
Skyler Greyf2c55ae2022-11-05 17:48:02 +000037
Skyler Grey34021e32022-11-04 09:28:03 +000038
Skyler Greyb43ac6b2022-10-31 00:48:34 +000039main :: IO ()
Skyler Grey51a0c612022-11-05 09:59:04 +000040main = XMonadLog.xmonadLog >>= main'
41
42main' :: D.Client -> IO ()
Skyler Greyf2c55ae2022-11-05 17:48:02 +000043main' dbus = xmonad $ ewmh . ewmhFullscreen $ docks $ def
Skyler Greye2ec0de2022-11-02 08:07:25 +000044 { modMask = modifierKey -- Use Super as our mod key
Skyler Grey51a0c612022-11-05 09:59:04 +000045 , borderWidth = 0
Skyler Greye2ec0de2022-11-02 08:07:25 +000046 , XMonad.terminal = Main.terminal
Skyler Grey51a0c612022-11-05 09:59:04 +000047 , XMonad.startupHook = Main.startupHook
48 , XMonad.logHook = dynamicLogWithPP (polybarHook dbus)
49 , XMonad.layoutHook = avoidStruts $
50 smartSpacing 5 $
51 gaps [(U, 5), (D, 5), (L, 5), (R, 5)] $
52 layoutHook def
Skyler Greyf2c55ae2022-11-05 17:48:02 +000053 , XMonad.manageHook = composeAll
54 [ className =? "Show" --> doIgnore <+> doLower <+> doLower
55 -- You can't check if "Show" is a desktop window,
56 -- I believe it's because show doesn't instantly set
57 -- desktop. Do not try. It is not worth it.
58 ] <+> manageHook def
Skyler Greye2ec0de2022-11-02 08:07:25 +000059 } `additionalKeys`
60 [ ((modifierKey, xK_d), spawn launcher)
61 , ((modifierKey, xK_n), spawn networkManager)
62 , ((modifierKey .|. shift, xK_q), kill)
63 , ((modifierKey, xK_q), spawn "xmonad --restart")
Skyler Greyf2c55ae2022-11-05 17:48:02 +000064 , ((modifierKey .|. shift, xK_c), io exitSuccess)
Skyler Greye2ec0de2022-11-02 08:07:25 +000065 ]