Guest User

Untitled

a guest
Jun 12th, 2022
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. myXmobarPP :: PP
  2. myXmobarPP =
  3.   def
  4.     { ppSep = white " • ",
  5.       ppTitleSanitize = xmobarStrip,
  6.       ppCurrent = invert3D lightGreen darkGreen medGreen 2,
  7.       ppHidden = djungle3D . white . xmobarBorder "Top" "#FFF" 1,
  8.       ppVisible = myPPVisible,
  9.       ppHiddenNoWindows = myPPNoWindows,
  10.       ppVisibleNoWindows = Just (const $ myPPNoWindows switcheroo),
  11.       ppUrgent = red . wrap (yellow "!") (yellow "!"),
  12.       ppOrder = \[ws, l, _, wins] -> [ws, l, wins],
  13.       ppExtras = [logTitles formatFocused formatUnfocused],
  14.       ppWsSep = "",
  15.       ppPrinters = isEmptyCurrent ?-> ppIsEmptyCurrent -- If I exhange the second argument (ppIs..) to e.g. "ppCurrent", it works but in this case the function is apparently missing a parameter "PP".
  16.     }
  17.   where
  18.     ppIsEmptyCurrent :: WorkspaceId -> String
  19.     ppIsEmptyCurrent = invert3D lightGreen darkGreen medGreen 2 . lowWhite
  20.     cond ?-> ppr = (asks cond >>= guard) *> asks (ppr . wsPP)
  21.  
  22.     djungle3D = create3D lightGreen darkGreen medGreen 2
  23.     myPPVisible = const $ djungle3D switcheroo
  24.     myPPNoWindows = djungle3D . lowWhite
  25.     formatFocused = wrap (white "[") (white "]") . magenta . ppWindow
  26.     formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow
  27.     create3D lc dc mc w = xmobarBorder "Right" dc w . xmobarBorder "Bottom" dc (w -1) . xmobarBorder "Top" lc w . xmobarBorder "Left" lc w . xmobarColor "white" mc . (' ' :) . (++ " ")
  28.     invert3D lc dc = create3D dc lc
  29.     switcheroo = "<fn=1>\61561</fn>"
  30.  
  31.     ppWindow :: String -> String
  32.     ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30
  33.  
  34.     -- colors
  35.     blue, lowWhite, magenta, red, white, yellow :: String -> String
  36.     magenta = xmobarColor "#ff79c6" ""
  37.     blue = xmobarColor "#bd93f9" ""
  38.     white = xmobarColor "#f8f8f2" ""
  39.     yellow = xmobarColor "#f1fa8c" ""
  40.     red = xmobarColor "#ff5555" ""
  41.     lowWhite = xmobarColor "#bbbbbb" ""
  42.     darkGreen = "#0c231e" -- "#2e4941"
  43.     lightGreen = "#597268" -- "#a7b6a3"
  44.     medGreen = "#2e4941" -- "#597268"
  45.  
  46. isEmptyCurrent :: WS -> Bool
  47. isEmptyCurrent WS {..} = isNothing $ W.peek wsWindowSet
  48.  
Advertisement
Add Comment
Please, Sign In to add comment