Find a file
2020-10-03 16:02:07 +05:30
blocks Improved block colors and added battery_button 2020-07-27 01:01:24 +05:30
daemons Improved pulse_daemon.sh 2020-09-01 12:28:54 +05:30
patches Fixed a bug in dwm patches 2020-09-30 21:59:06 +05:30
.gitignore Added gitignore 2020-07-18 18:00:09 +05:30
blocks.h Corrected comments in blocks.h 2020-10-01 00:34:44 +05:30
dwmblocks.c Improved buttonhandler 2020-10-03 16:02:07 +05:30
GNUmakefile Renamed Makefile to GNUmakefile 2020-08-22 20:26:55 +05:30
LICENSE Added license 2020-07-13 14:44:52 +05:30
README.md Improved readme 2020-10-01 18:04:19 +05:30
sigdwmblocks.c Replaced tabs with spaces in macros 2020-08-22 23:13:56 +05:30
xgetrootname Did some cleanup 2020-07-07 01:58:41 +05:30
xgetrootname.c Did some cleanup 2020-07-07 01:58:41 +05:30

dwmblocks

Modular status monitor for dwm written in C with features including signaling, clickability, cursor hinting and color.

Usage

dwmblocks [-d <delimiter>]

Modifying blocks

Blocks are added and removed by editing the blocks.h file. Read it for more info.

Colored output and Clickability

The patches folder contains two patches for dwm, one for dwm already patched with systray patch and the other for dwm without systray. One of the patches, whichever appropriate, is essential for dwmblocks to function properly. It will add support for colored text, clickability and cursor hinting when hovering on clickable blocks (inspired by polybar).

Clickability is inspired by the statuscmd patch for dwm. On clicking on text corresponding to a clickable block, the program specified to handle clicks for that block is executed with the first argument specifying which button was clicked (1 for left, 2 for middle and 3 for right by default).

Colored output is inspired by the statuscolors patch for dwm. To add colors, have your programs for the blocks output raw characters from '\x0b' to '\x31'. '\x0b' in status text switches the active colorscheme to the first one in the scheme array in dwm and so on. See statuscolors patch for more info. Keep in mind that you have to start from '\x0b' instead of '\x01' as instructed on the page.

Signaling changes

To signal a specific block to update, run sigdwmblocks <signal> [<sigval>]. <sigval> is optional and must be an integer. If provided, it is passed as the first argument to the program specified for updating the block.

xgetrootname

It is a tiny program to get the current root name. May prove helpful in debugging.

Installation

Clone the repository and run make install clean after getting in the project directory. By default the program is installed in $HOME/.local/bin (see GNUmakefile). If xgetrootname is required run make xgetrootname.

Acknowledgements

Some ideas and code was taken from other projects. Credits for those go to -

See also

  • dsblocks - A clone of this project with the only difference being that C functions instead of external programs are used to update blocks and handle clicks.