Bloggings

Back

DWM slstatus

2025-04-25

KISS

slstatus bar image

https://tools.suckless.org/slstatus/

After fiddling with dwm-blocks and dwm-bar, I decided that the only thing I want to see in my status bar is battery info and date/time. The rest can be done with btop and alerts.

So I cloned the slstatus source code from suckless.org and added the following in slstatus/config.h

static const struct arg args[] = {
        /* function format          argument */
        { battery_remaining, "%s",           "BAT0" },
        { battery_state,     " %s",          "BAT0" },
        { battery_perc,      " %s%%",        "BAT0" },
        { datetime,          " | %s", "%a %d-%m %T" },
};

As I'm using the Jetbrains mono nerdfont in DWM I added some icons in slstatus/components/battery.c

battery code

 


ยง