Skip to content
godknowsthetruth edited this page Sep 27, 2024 · 5 revisions

IMPORTANT: Using these modules requires patching dwl with the IPC patch.


Tags

The tags module displays the current tag state of dwl.

Config

Addressed by dwl/tags

option typeof default description
num-tags integer 9 The number of tags that configured in dwl. (Must match!).
tag-labels array The label to display for each tag.
disable-click bool false If set to false, you can left click to set focused tag. Right click to toggle tag focus. If set to true this behavior is disabled.

Style

  • #tags button
  • #tags button.occupied
  • #tags button.focused
  • #tags button.urgent

Note that occupied/focused/urgent status may overlap. That is, a tag may be both occupied and focused at the same time.

Window

Addressed by dwl/window

option typeof default description
format string {title} The format, how information should be displayed.
rotate integer Positive value to rotate the text label.
max-length integer The maximum length in character the module should display.
on-click string Command to execute when clicked on the module.
on-click-right string Command to execute when you right clicked on the module.
on-scroll-up string Command to execute when scrolling up on the module.
on-scroll-down string Command to execute when scrolling down on the module.
smooth-scrolling-threshold double Threshold to be used when scrolling.
tooltip bool true Option to disable tooltip on hover.
rewrite object {} Rules to rewrite the module format output. See rewrite rules.
all-outputs bool false If set to false, displays only title of the window on the same output as bar
offscreen-css bool false Only effective when all-outputs is true. Adds style according to present windows on unfocused outputs instead of showing the focused window and style.
offscreen-css-text bool Only effective when both all-outputs and offscreen-css are true. On screens currently not focused, show the given text along with that workspaces styles.
icon bool false Option to disable application icon.
icon-size integer 24 Set the size of application icon.

Format Replacements:

string replacement
{title} The title of the focused window.
{app_id} The app_id of the focused window.
{layout} The layout of the focused window.

title: The title of the focused window.

app_id: The app_id of the focused window.

layout: The layout of the focused window.

Rewrite Rules:

rewrite is an object where keys are regular expressions and values are rewrite rules if the expression matches. Rules may contain references to captures of the expression.

Regular expression and replacement follow ECMAScript rules (formal definition).

An expression must match fully to trigger the replacement; if no expression matches, the format output is left unchanged.

Invalid expressions (e.g., mismatched parentheses) are ignored.

Example 1:

"dwl/window": {
    "format": "{title}",
    "max-length": 50,
    "rewrite": {
       "(.*) - Mozilla Firefox": "🌎 $1",
       "(.*) - vim": " $1",
       "(.*) - zsh": " [$1]"
    }
}
Clone this wiki locally