DWM - How to customize status bar
DWM (Dynamic Window Manager) has a cool status-bar by default that you can customize (or ricing!).
Dependency
- xorg-xsetroot - Classic X utility to set your root window background to a given pattern or color.
$ 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/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