Status2d allows colors and rectangle drawing in your DWM status bar. See below an example of my status bar with multi-cpu and battery.
- ^rx,y,w,h^ Draw a rectangle of width w and height h, with its top left corner at (x,y) relative the X drawing cursor.
- ^c#FF0000^ Set foreground color.
- ^b#55cdfc^ Set background color, only applies to text, simply use the ^r^ command to change the background while drawing.
- ^f<px>^ Forward the X drawing cursor by <px> pixel. Please bear in mind that you have to move the cursor enough to display your drawing (by the with of your drawing).
- ^d^ Reset colors to SchemeNorm.
xsetroot -name "[status2d] ^c#FF0000^red text with blue
and white text on pink background "
Steps to draw a battery icon (ajust the values to fit your setup)
Draw the nose:
Draw the battery:
Fill it so that the border stays:
Fill it with the remaining capacaty:
Reset the colorscheme and forward the cursor:
Put it all together:
xsetroot -name "^r0,7,2,4^^r2,4,22,10^^c#000000^^r3,5,20,8^^c#ffffff^^r10,5,13,8^^d^^f24^"