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