1

So I just installed xmobar for the first time and I did some hacking on it with help of documentation and some YouTube videos. When I reload the xmonad wm i get the xmobar bar but it's stuck on Updating... I'll provide the config file. Thanks in advance!

Config
{ --APPERANCE

  --FONTS
  font = "xft=Ubuntu:weight=bold:pixelsize=12:antialias=true:hinting:true",
  --COLORS
  bgColor = "#282c34",
  fgColor = "#ff6c6b",
  --BAR POSITION
  position = Top,
  commands =
  [ --Get kernel version
    Run Com ".local/bin/kernel" [] "kernel" 3600,
    --CPU Usage
    Run Cpu ["-t", "<fn=2>\xf108</fn>  cpu: (<total>%)", "-H", "50", "--high", "red"] 20,
    --RAM Usage
    Run Memory ["-t", "<fn=2>\xf233</fn>  mem: <used>M (<usedratio>%)"] 20,
    --Free Disk Space
    Run DiskU [("/", "<fn=2>\xf0c7</fn>  hdd: <free> free")] [] 60,
    --Uptime
    Run Uptime ["-t", "uptime: <days>d <hours>h"] 360,
    --Battery
    Run BatteryP ["BAT0"] ["-t", "<acstatus><watts> (<left>%)"] 360,
    --Date & Time
    Run Date "<fn=2>\xf017</fn>  %b %d %Y - (%H:%M) " "date" 50,
    --Weather
    Run Weather "RJTT" ["--template", "<skyCondition> | <fc=#4682B4><tempC></fc>°C | <fc=#4682B4><rh></fc>% | <fc=#4682B4><pressure></fc>hPa"] 36000,
    --Network Activity Monitor
    Run DynNetwork
          [ "--template",
            "<dev>: <tx>kB/s|<rx>kB/s",
            "--Low",
            "1000", -- units: B/s
            "--High",
            "5000", -- units: B/s
            "--low",
            "darkgreen",
            "--normal",
            "darkorange",
            "--high",
            "darkred"
          ]
          10,
          -- Script that dynamically adjusts xmobar padding depending on number of trayer icons
          Run Com ".config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 20
    ]
}
wujovic
  • 67
  • 1
  • 1
  • 6

1 Answers1

2

You did not specify a top-level template in the configuration. When missing, it defaults to "%StdinReader% }{ <fc=#00FF00>%uname%</fc> * <fc=#FF0000>%theDate%</fc>". Which of these three items is still Updating...?

If it's StdinReader (which is most likely) and assuming you want data logged by XMonad to be displayed (i.e. not just the "external" items you have defined), check if the output of your XMonad instance is properly piped into xmobar. This may be either set in your .xsession (or similar) file, or from within XMonad using spawnPipe and hPutStrLn (from the XMonad.Util.Run module from the xmonad-contrib package).

For the latter, you would typically also import XMonad.Hooks.DynamicLog (also from the xmonad-contrib package) and for your logHook redefine the ppOutput field of your preferred pretty-printer (presumably xmobarPP) to direct its output to an instance of xmobar. Your xmonad.hs would then look something like this:

import XMonad.Util.Run -- for spawnPipe and hPutStrLn
import XMonad.Hooks.DynamicLog -- for dynamicLogWithPP, pp*, xmobar*
...
main = do
  ...
  barpipe <- spawnPipe "xmobar -with -your -preferred -options"
  ...
  xmonad $ def {
    ...
    logHook = dynamicLogWithPP $ xmobarPP {
      ...
      ppOutput = hPutStrLn barpipe
      ...
    }
    ...
  }

Regarding the rest of your xmobar configuration:

  • Consider adding your own top-level template, otherwise you won't be able to use (i.e. display) any of the items you have defined in it
  • Replace the second = with : in the font definition to get font = "xft:Ubuntu...
pmf
  • 24,478
  • 2
  • 22
  • 31
  • I got it figured out right now, I tired messing with it, found out I actually did not include the "template" like you said. I just copied over the default config from xmobar wiki page, tweaked it to my liking and it's working as it should now. Not really sure what was the real problem here, but anyways thank you for your time and help kind sir. – wujovic Oct 29 '21 at 22:04