You are not logged in.

#1 2022-08-19 19:37:28

shako
Member
Registered: 2021-11-16
Posts: 50

colored dwmblocks statusbar in dwm

Hi everyone,

I just patched statuscolors statuscolors to my dwm build with the aim of bringing colors to my statusbar (I use dwmblocks). I want to achieve something aesthetically similar to bumblebee-status, with each statusbar block appearing in a different color. As explained in the patch documentation, I defined an array of colors in my dwm config, something like this:

static const char *colors[][3][8] = {

/*		  fg             bg              border   */

[SchemeWarn]     = { col_black, col_yellow, col_red },

[SchemeUrgent]  = { col_white, col_red,      col_red },

[SchemeNorm]    = { col_gray3, col_gray1,  col_gray2 },

[SchemeSel]     = { col_gray3, col_cyan,   col_cyan  },

...
};

where col_white, col_cyan ecc. are defined at the beginning of my config file, something like:

static const char col_cyan[] = "#005577";

My plan was to add multiple elements to the above array, each one consisting of 3 HEX color codes (foreground, background, border) and to use a different one for each of my statusbar elements. I thought I could output text in the chosen color palette by putting something like "echo -e "\x03 [statusbar element]" in my statusbar scripts (assuming array indices start from 0 as in python, the previous example should output gray text, cyan background and cyan borders, according to the array in my config.h I reported above). However, I found out this does not happen: for instance, I put \x03 in the script I use to output battery percentage to my statusbar, which now appears as black text on yellow background (!!!). This doesn't makes sense to me. What am I missing? Are color schemes "hard-coded" somewhere else, although I could not find any mention of "yellow" etc. in dwm's source code?

Thanks to anyone who will reply smile

Offline

Board footer

Powered by FluxBB