aboutsummaryrefslogtreecommitdiff
path: root/xmonad
diff options
context:
space:
mode:
authorBryson Steck <me@brysonsteck.xyz>2023-10-13 16:15:12 -0600
committerBryson Steck <me@brysonsteck.xyz>2023-10-13 16:15:12 -0600
commit5b41f4664acf3ea786295e244b9524ef62b0be38 (patch)
tree79baf7f1792b4d590a60053389710b6ee69e4ac0 /xmonad
parent8ea71ee2baf86d32f810bc6f6c560e6677cc2e09 (diff)
downloaddotfiles-5b41f4664acf3ea786295e244b9524ef62b0be38.tar
dotfiles-5b41f4664acf3ea786295e244b9524ef62b0be38.tar.gz
dotfiles-5b41f4664acf3ea786295e244b9524ef62b0be38.tar.bz2
experimenting with xmonad/xmobar
Diffstat (limited to 'xmonad')
-rw-r--r--xmonad/xmonad.hs99
1 files changed, 99 insertions, 0 deletions
diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs
new file mode 100644
index 0000000..bde627c
--- /dev/null
+++ b/xmonad/xmonad.hs
@@ -0,0 +1,99 @@
+import XMonad
+import System.Exit (exitSuccess)
+
+import XMonad.Hooks.DynamicLog
+import XMonad.Hooks.ManageHelpers
+import XMonad.Hooks.StatusBar
+import XMonad.Hooks.EwmhDesktops
+import XMonad.Util.Cursor
+
+import XMonad.Util.EZConfig
+import XMonad.Util.Loggers
+import XMonad.Util.Ungrab
+
+import XMonad.Layout.ThreeColumns
+import XMonad.Layout.Spacing
+import XMonad.Actions.CycleWS
+import XMonad.Layout.Renamed
+import XMonad.Layout.Spacing
+
+main :: IO ()
+main = xmonad
+ . ewmh
+ . ewmhFullscreen
+ . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey
+ $ myConfig
+
+myConfig = def
+ { modMask = mod4Mask -- Rebind Mod to the Super key
+ , layoutHook = myLayout
+ , manageHook = myManageHook
+ , startupHook = setDefaultCursor xC_left_ptr
+ , workspaces = myWorkspaces
+ , borderWidth = 2
+ , normalBorderColor = "#3c3836"
+ , focusedBorderColor = "#928374"
+ }
+ `additionalKeysP`
+ [ ("M-S-<Escape>", spawn "slock")
+ , ("M-<PrintScreen>", unGrab *> spawn "screenshot" )
+ , ("M-S-f", spawn "librewolf-bin" )
+ , ("M-S-k", spawn "keepassxc" )
+ , ("M-S-<Return>", spawn "spawn-alacritty")
+ , ("M-p", spawn "dmenu_run_history" )
+ , ("M-<F1>", spawn "volmute")
+ , ("M-<F2>", spawn "voldown")
+ , ("M-<F3>", spawn "volup")
+ , ("M-<F7>", spawn "brightness-down")
+ , ("M-<F8>", spawn "brightness-up")
+ , ("M-<F11>", spawn "screenshot")
+ , ("M-<Tab>", toggleWS)
+ , ("M-S-<Backspace>", io exitSuccess)
+ , ("M-S-q", spawn "true")
+ ]
+
+myWorkspaces = [ "!", "@", "#", "$", "%", "^", "&", "*", "(" ]
+
+myLayout = tiled ||| full ||| threeCol
+ where
+ threeCol = renamed [Replace "ThreeCol"] $ spacing 2 $ ThreeColMid nmaster delta ratio
+ tiled = renamed [Replace "Tall"] $ spacing 2 $ Tall nmaster delta ratio
+ full = renamed [Replace "Full"] $ spacing 2 $ Full
+ nmaster = 1 -- Default number of windows in the master pane
+ ratio = 6/10 -- Default proportion of screen occupied by master pane
+ delta = 2/100 -- Percent of screen to increment by when resizing panes
+
+myManageHook :: ManageHook
+myManageHook = composeAll
+ [ className =? "Gimp" --> doFloat
+ , isDialog --> doFloat
+ ]
+
+myXmobarPP :: PP
+myXmobarPP = def
+ { ppSep = magenta " • "
+ , ppTitleSanitize = xmobarStrip
+ , ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2
+ , ppHidden = white . wrap " " ""
+ , ppHiddenNoWindows = lowWhite . wrap " " ""
+ , ppUrgent = red . wrap (yellow "!") (yellow "!")
+ , ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
+ , ppExtras = [logTitles formatFocused formatUnfocused]
+ }
+ where
+ formatFocused = wrap (white "[") (white "]") . green . ppWindow
+ formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . lowWhite . ppWindow
+
+ -- | Windows should have *some* title, which should not not exceed a
+ -- sane length.
+ ppWindow :: String -> String
+ ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 80
+
+ blue, lowWhite, magenta, red, white, yellow :: String -> String
+ magenta = xmobarColor "#d3869b" ""
+ blue = xmobarColor "#83a598" ""
+ white = xmobarColor "#ebdbb2" ""
+ yellow = xmobarColor "#fabd2f" ""
+ red = xmobarColor "#fb4934" ""
+ green = xmobarColor "#b8bb26" ""
+ lowWhite = xmobarColor "#a89984" "" \ No newline at end of file