Xresources

Runtime configuration using X resources.

Description

This patch adds X resources support to dwm. At startup, dwm reads the configured X resources and applies them.

This patch also adds a hotkey (Modkey + F5 by default) which reloads the configured resources during runtime.

Configuration

The resources array contains list of settings to load from X resources:

/* X resources to update */
static const XResPref resources[] = {
    /* name                type     address */
    { "dwm.font",          STRING,  &fonts[0] },
    { "dwm.foreground",    STRING,  &colors[SchemeNorm][ColFg] },
    { "dwm.borderpx",      INTEGER, &borderpx },
    { "dwm.mfact",         FLOAT,   &mfact },
};

Each entry contains the name of resource, the variable type, and the variable address.

Download

Author