Skyler Grey | b43ac6b | 2022-10-31 00:48:34 +0000 | [diff] [blame] | 1 | -- spell-checker:words xmonad |
| 2 | import XMonad |
| 3 | |
Skyler Grey | e2ec0de | 2022-11-02 08:07:25 +0000 | [diff] [blame] | 4 | import System.Exit |
Skyler Grey | b43ac6b | 2022-10-31 00:48:34 +0000 | [diff] [blame] | 5 | import XMonad.Util.EZConfig |
| 6 | |
Skyler Grey | 51a0c61 | 2022-11-05 09:59:04 +0000 | [diff] [blame] | 7 | import XMonad.Hooks.EwmhDesktops |
| 8 | import XMonad.Hooks.ManageDocks |
| 9 | import XMonad.Config.Desktop |
| 10 | |
| 11 | import XMonadLog |
| 12 | import XMonad.Hooks.DynamicLog |
| 13 | import qualified DBus.Client as D |
| 14 | |
| 15 | import XMonad.Layout.Spacing |
| 16 | import XMonad.Layout.Gaps |
| 17 | |
Skyler Grey | e2ec0de | 2022-11-02 08:07:25 +0000 | [diff] [blame] | 18 | terminal = "kitty" -- Kitty, my beloved <3 |
| 19 | launcher = "pkill rofi; rofi -show combi" |
| 20 | networkManager = "wpa_cli select_network $(wpa_cli list_networks | tail -n +3 | rofi -dmenu -window-title 'Select Network' | awk '{print $1;}')" |
| 21 | modifierKey = mod4Mask -- Use Super as our mod key |
| 22 | |
Skyler Grey | 34021e3 | 2022-11-04 09:28:03 +0000 | [diff] [blame] | 23 | statusBar = "pkill polybar; polybar" |
Skyler Grey | 51a0c61 | 2022-11-05 09:59:04 +0000 | [diff] [blame] | 24 | compositor = "pkill picom; picom" |
| 25 | background = "feh --no-fehbg --bg-fill .xmonad/background.png" |
Skyler Grey | 34021e3 | 2022-11-04 09:28:03 +0000 | [diff] [blame] | 26 | |
Skyler Grey | e2ec0de | 2022-11-02 08:07:25 +0000 | [diff] [blame] | 27 | shift = shiftMask |
| 28 | |
Skyler Grey | 34021e3 | 2022-11-04 09:28:03 +0000 | [diff] [blame] | 29 | startupHook = do |
Skyler Grey | 51a0c61 | 2022-11-05 09:59:04 +0000 | [diff] [blame] | 30 | spawn Main.statusBar |
| 31 | spawn Main.compositor |
| 32 | spawn background |
| 33 | |
Skyler Grey | 34021e3 | 2022-11-04 09:28:03 +0000 | [diff] [blame] | 34 | |
Skyler Grey | b43ac6b | 2022-10-31 00:48:34 +0000 | [diff] [blame] | 35 | main :: IO () |
Skyler Grey | 51a0c61 | 2022-11-05 09:59:04 +0000 | [diff] [blame] | 36 | main = XMonadLog.xmonadLog >>= main' |
| 37 | |
| 38 | main' :: D.Client -> IO () |
| 39 | main' dbus = xmonad $ docks $ ewmh . ewmhFullscreen $ def |
Skyler Grey | e2ec0de | 2022-11-02 08:07:25 +0000 | [diff] [blame] | 40 | { modMask = modifierKey -- Use Super as our mod key |
Skyler Grey | 51a0c61 | 2022-11-05 09:59:04 +0000 | [diff] [blame] | 41 | , borderWidth = 0 |
Skyler Grey | e2ec0de | 2022-11-02 08:07:25 +0000 | [diff] [blame] | 42 | , XMonad.terminal = Main.terminal |
Skyler Grey | 51a0c61 | 2022-11-05 09:59:04 +0000 | [diff] [blame] | 43 | , 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 Grey | e2ec0de | 2022-11-02 08:07:25 +0000 | [diff] [blame] | 49 | } `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 | ] |