DWM - How to customize status bar


rice bowl

DWM (Dynamic Window Manager) has a cool status-bar by default that you can customize (or ricing!).


Dependency

$ sudo pacman -S xorg-xsetroot

dwm/config.h

To change the color of the bar, you need to modify the static const colors defined inside dwm/config.h and then rebuild.

dwm (dynamic window manager) - status bar
// dwm/config.h
static const char *colors[][3]      = {
	/*              fg         bg     border   */
	[SchemeNorm] = { "#FFC94A", "#050505", "#050505" },
	[SchemeSel]  = { "#FFC94A", "#FFC94A", "#FFC94A" },
};
$ sudo make -C ./dwm clean install

shell-script

To recursively change the bar contents, you need to create a shell script and execute it on startup.

# ~/startup.sh
while true; do
  xsetroot -name "[$(whoami)][$(date +"%H:%M:%S %m/%d/%Y")]";
  sleep 1s;
done
$ chmod +x ~/statusbar.sh
# ~/.xinitrc
~/startup.sh
exec dwm

dwm-bar

A modular statusbar for dwm

https://github.com/joestandring/dwm-bar