dwm-flexipatch
dwm-flexipatch copied to clipboard
How do I implement dwmblocks and status cmd?
I'm confused about how do I make the individual modules in dwmblocks clickable. In config.h I only see one option,
{ ClkStatusText, 0, Button1, sigstatusbar, {.i = 1 } },
{ ClkStatusText, 0, Button2, sigstatusbar, {.i = 2 } },
{ ClkStatusText, 0, Button3, sigstatusbar, {.i = 3 } },
How do I let dwmblocks know which status module was clicked?
These are the related patches I enabled,
#define BAR_STATUSCMD_PATCH 1
#define BAR_DWMBLOCKS_PATCH 1
You need to configure this in dwmblocks, not in dwm.
What you'll need is:
- dwmblocks patched with click support (or use Luke Smith's build)
- set a unique update signal for each of your blocks (an update signal of 0 means no signal)
- handling of the $BUTTON environment variable in your block scripts
The values of 1, 2 and 3 sent to sigstatusbar as part of the click handling merely indicates the mouse button that was pressed. You may want to add 4 and 5 if you want mouse scroll wheel for example. Or you can send different values if shift is held down if you want your script to handle this differently.
You may also want to refer to #114 which goes more into depth with regards to how dwmblocks works.
NB:
- earlier versions of the dwmblocks patch to add click support used the $BLOCK_BUTTON environment variable, this was later changed to use the $BUTTON environment variable instead
- earlier versions of the dwmblocks patch and the patch for dwm relied on a user defined signal (SIGUSR1) for communicating which mouse button was clicked, this was later replaced with realtime signals (SIGRTMIN) - so if your dwmblocks happens to use an old patch then you may need to enable
BAR_DWMBLOCKS_SIGUSR1_PATCH
as well (less likely to be the case)