koldfront

Improvements in bling #x #ui

🕦︎ - 2023-02-18

My desktop is almost austere - I use XMonad with XMobar and very little decoration.

A while back I noticed that XMobar would crash when showing the title of the active window when it included emoji - yes, some websites do this.

But recently XMobar started using Cairo/Pango for rendering, and now it doesn't crash. That also means that unicode characters are supported, so I can add some icons easily.

Here is what the left part of XMobar looks like now:

I added the number of the virtual screen in front of the active window title by adding this to my ~/.config/xmonad/xmonad.hs:

myXmobarPP :: PP
myXmobarPP = def
             { ppOrder  = \(ws:_:t:_) -> [ws, t]
             , ppHidden = \_ -> ""
             , ppCurrent = displayWorkspace
             , ppSep = " → "
             , ppTitle  = xmobarColor "#666666" "" . shorten 200
             }
  where
    displayWorkspace "1" = "①"
    displayWorkspace "2" = "②"
    displayWorkspace "3" = "③"
    displayWorkspace "4" = "④"
    displayWorkspace "5" = "⑤"
    displayWorkspace "6" = "⑥"
    displayWorkspace "7" = "⑦"
    displayWorkspace "8" = "⑧"
    displayWorkspace "9" = "⑨"
    displayWorkspace ws = ws

The right side of the bar also got a face lift:

The icon in front of the window status now reflects whether it is running on battery, charging, or charged. The two other icons for wifi and time are just static, however I did setup up different colors for wireless quality. Here is the configuration I changed in ~/.xmobarrc:

    , Run Wireless "wlp82s0" [ "-t", "<essid> (<quality>)"
                             , "-l", "#886666"
                             , "-n", "#666666"
                             , "-h", "#667766"] 100
    , Run Battery [ "-t", "<acstatus>"
                  , "-l", "#886666"
                  , "-n", "#666666"
                  , "-h", "#667766"
                  , "--" -- battery specific options
                  , "-o", "🔋︎ <left>% (<timeleft>)" -- discharging
                  , "-O", "⚡︎ <fc=#666666><left>% (<timeleft>)</fc>" -- AC on
                  , "-i", "🔌︎ <fc=#667766><left>% (<timeleft>)</fc>" -- charged
                  ] 100

and:

  , template = "%XMonadLog% }{ %battery%  📶︎ %wlp82s0wi%  🕒︎ %date% "

Sometimes small improvements are pleasing.

Add comment

To avoid spam many websites make you fill out a CAPTCHA, or log in via an account at a corporation such as Twitter, Facebook, Google or even Microsoft GitHub.

I have chosen to use a more old school method of spam prevention.

To post a comment here, you need to:

¹ Such as Thunderbird, Pan, slrn, tin or Gnus (part of Emacs).

Or, you can fill in this form:

+=