summaryrefslogtreecommitdiff
path: root/xmonad.hs
diff options
context:
space:
mode:
authortom barrett <tom@tombarrett.xyz>2024-05-11 21:31:48 +0200
committerTom Barrett <tom@tombarrett.xyz>2024-05-12 12:00:27 +0200
commita642918e5d9df38ee172d37aefe42f40bad80309 (patch)
tree6e5c552c5b62fc77aa684957af5db6da751c8fc5 /xmonad.hs
good starting point
Diffstat (limited to 'xmonad.hs')
-rw-r--r--xmonad.hs95
1 files changed, 95 insertions, 0 deletions
diff --git a/xmonad.hs b/xmonad.hs
new file mode 100644
index 0000000..63ce88b
--- /dev/null
+++ b/xmonad.hs
@@ -0,0 +1,95 @@
+import System.Exit
+import XMonad
+import XMonad.Actions.CycleWS
+import XMonad.Hooks.EwmhDesktops
+import XMonad.Hooks.StatusBar
+import XMonad.Hooks.StatusBar.PP
+import XMonad.Layout.Renamed
+import XMonad.Layout.Spacing
+import XMonad.Prompt
+import XMonad.Prompt.FuzzyMatch
+import XMonad.Prompt.Pass
+import qualified XMonad.StackSet as W
+import XMonad.Util.EZConfig
+import XMonad.Util.SpawnOnce
+
+primary = "#a1b56c"
+grey0 = "#181818"
+grey1 = "#585858"
+grey2 = "#b8b8b8"
+grey3 = "#f8f8f8"
+
+main :: IO ()
+main =
+ xmonad
+ . ewmhFullscreen
+ . ewmh
+ . withEasySB
+ ( statusBarProp
+ "xmobar"
+ ( pure
+ def
+ { ppSep = ""
+ , ppWsSep = ""
+ , ppHiddenNoWindows = xmobarColor grey2 grey0 . pad
+ , ppCurrent = xmobarColor grey3 primary . pad
+ , ppHidden = xmobarBorder "Top" primary 2 . xmobarColor grey2 grey0 . pad
+ , ppTitle = const ""
+ , ppLayout = xmobarColor grey2 grey0 . pad
+ }
+ )
+ )
+ defToggleStrutsKey
+ $ let promptConfig =
+ def
+ { position = Top
+ , bgColor = grey0
+ , bgHLight = primary
+ , promptBorderWidth = 0
+ , fgHLight = grey3
+ , height = 25
+ , font = "xft:Hermit:size=12"
+ , searchPredicate = fuzzyMatch
+ , sorter = fuzzySort
+ , alwaysHighlight = True
+ }
+ in def
+ { borderWidth = 2
+ , layoutHook =
+ renamed
+ [Replace "[]="]
+ (spacingWithEdge 8 $ Tall 1 (5 / 100) (1 / 3))
+ ||| renamed [Replace "[M]"] Full
+ , normalBorderColor = grey1
+ , focusedBorderColor = primary
+ , keys = \c ->
+ mkKeymap c $
+ [ ("M-<Return>", spawn "alacritty")
+ , ("M-q", kill)
+ , ("M-d", spawn $ "bemenu-run -p ' ' --cw 2")
+ , ("M-r", spawn "xmonad --recompile && xmonad --restart")
+ , ("M-S-e", io exitSuccess)
+ , ("M-j", windows W.focusDown)
+ , ("M-k", windows W.focusUp)
+ , ("M-c", passPrompt promptConfig)
+ , ("M-x", passOTPPrompt promptConfig)
+ , ("M-i", sendMessage $ IncMasterN 1)
+ , ("M-u", sendMessage $ IncMasterN $ -1)
+ , ("M-h", sendMessage Shrink)
+ , ("M-l", sendMessage Expand)
+ , ("M-m", sendMessage $ JumpToLayout "[M]")
+ , ("M-t", sendMessage $ JumpToLayout "[]=")
+ , ("M-<Tab>", toggleWS)
+ , ("M-S-<Return>", windows W.swapMaster)
+ , ("M-S-<Space>", withFocused $ windows . W.sink)
+ ]
+ ++ concatMap
+ ( \n ->
+ [ ("M-" ++ n, windows $ W.greedyView n)
+ , ("M-S-" ++ n, windows $ W.shift n)
+ ]
+ )
+ (map show [1 .. 9])
+ , startupHook = do
+ spawnOnce "feh --bg-fill --no-fehbg --randomize /home/tom/src/nixos/wallpapers"
+ }