Created
December 2, 2024 05:03
-
-
Save sameerkrmishra/ba9ba47ee5b288d7f483e70338cf866d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XMonad | |
import XMonad.Util.SpawnOnce (spawnOnce) | |
import XMonad.Util.EZConfig (additionalKeysP) | |
import XMonad.Util.Loggers | |
import XMonad.Hooks.EwmhDesktops | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.StatusBar | |
import XMonad.Hooks.StatusBar.PP | |
main = xmonad | |
$ ewmhFullscreen | |
$ ewmh | |
$ withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey | |
$ docks | |
$ defaults | |
defaults = def { | |
terminal = "kitty", | |
layoutHook = avoidStruts $ layoutHook def, | |
manageHook = manageHook def <+> myManageHook, | |
startupHook = startup | |
} `additionalKeysP` additionalKeyBindings | |
startup :: X () | |
startup = do | |
spawnOnce "picom -b" | |
spawnOnce "trayer --edge top --align right --SetDockType true \ | |
\--SetPartialStrut true --expand true --width 10 \ | |
\--transparent true --tint 0x5f5f5f --height 18" | |
myManageHook :: ManageHook | |
myManageHook = composeAll [ | |
-- resource =? "kdesktop" --> doIgnore, | |
-- title =? "plasmashell" --> doIgnore, | |
manageDocks ] | |
additionalKeyBindings = [ | |
("M-S-p", spawn "rofi -show drun")] | |
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 "]") . magenta . ppWindow | |
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . 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 30 | |
blue, lowWhite, magenta, red, white, yellow :: String -> String | |
magenta = xmobarColor "#ff79c6" "" | |
blue = xmobarColor "#bd93f9" "" | |
white = xmobarColor "#f8f8f2" "" | |
yellow = xmobarColor "#f1fa8c" "" | |
red = xmobarColor "#ff5555" "" | |
lowWhite = xmobarColor "#bbbbbb" "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment