Created
February 3, 2022 07:19
-
-
Save nekolinuxblog/7264d5893bc7515e9dcd61b048c1514e 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
------------------------------------------------------------------------------ | |
-- shunsk's xmonad.hs file for 0.17.0 | |
-- https://ok-xmonad.blogspot.com | |
-- | |
-- base config with polybar | |
-- v001 | |
------------------------------------------------------------------------------ | |
{-# LANGUAGE NoMonomorphismRestriction #-} | |
import XMonad | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Hooks.EwmhDesktops | |
import XMonad.Hooks.StatusBar | |
import XMonad.Hooks.StatusBar.PP | |
--------------------------------------------------------------- | |
-- MAIN | |
--------------------------------------------------------------- | |
main = xmonad | |
$ withSB myPolybarConf | |
$ ewmh | |
$ docks | |
$ def { terminal = "xterm" | |
, modMask = mod4Mask | |
, layoutHook = avoidStruts (layoutHook def) | |
} | |
--------------------------------------------------------------- | |
-- Polybar Setting | |
--------------------------------------------------------------- | |
myPolybarConf | |
= def { sbLogHook | |
= xmonadPropLog | |
=<< dynamicLogString polybarPPdef | |
, sbStartupHook = spawn "~/.config/polybar/launch.sh --blocks" | |
, sbCleanupHook = spawn "killall polybar" | |
} | |
polybarPPdef | |
= def { ppCurrent | |
= polybarFgColor "#FF9F1C" . wrap "[" "]" | |
, ppTitle = const "" | |
} | |
polybarFgColor :: String -> String -> String | |
polybarFgColor fore_color contents | |
= wrap ("%{F" <> fore_color <> "} ") " %{F-}" contents | |
polybarBgColor :: String -> String -> String | |
polybarBgColor back_color contents | |
= wrap ("%{B" <> back_color <> "} ") " %{B-}" contents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment