index.md (3673B)
1 status2d 2 ======== 3 4 Description 5 ----------- 6 Status2d allows colors and rectangle drawing in your DWM status bar. See below 7 an example of my status bar with multi-cpu and battery. 8 9 ![Status2d screenshot](status2d.png) 10 11 Download 12 -------- 13 14 * [dwm-status2d-6.2.diff](dwm-status2d-6.2.diff) 15 * [dwm-status2d-6.3.diff](dwm-status2d-6.3.diff) 16 17 This patch embeds systray patch. 18 19 * [dwm-status2d-systray-6.3.diff](dwm-status2d-systray-6.3.diff) 20 * [dwm-status2d-systray-6.4.diff](dwm-status2d-systray-6.4.diff) 21 22 This patch embeds barpadding patch. 23 24 * [dwm-status2d-barpadding-20241018-44e9799.diff](dwm-status2d-barpadding-20241018-44e9799.diff) 25 26 This patch embeds systray and barpadding patches. 27 28 * [dwm-status2d-barpadding-systray-20241014-b663875.diff](dwm-status2d-barpadding-systray-20241014-b663875.diff) 29 30 Use this patch if you want to include the extrabar patch 31 32 * [dwm-status2d-extrabar-6.2.diff](dwm-status2d-extrabar-6.2.diff) 33 34 This patch adds the ability to use terminal colors from xrdb, allowing programs like pywal to change statusbar colors. Requires [xrdb patch](../xrdb/) as well. 35 36 * [dwm-status2d-xrdb-6.2.diff](dwm-status2d-xrdb-6.2.diff) 37 38 This patch adds some extra tags for managing colors described below 39 40 * [dwm-status2d-swap-save-restore-6.2.diff](dwm-status2d-swap-save-restore-6.2.diff) 41 42 * [dwm-status2d-20200508-60bb3df.diff](dwm-status2d-20200508-60bb3df.diff) 43 44 Usage 45 ----- 46 * __^rx,y,w,h^__ 47 Draw a rectangle of width w and height h, with its top left corner at (x,y) relative the X drawing cursor. 48 49 50 * __^c#FF0000^__ 51 Set foreground color. 52 53 54 * __^b#55cdfc^__ 55 Set background color, only applies to text, simply use the ^r^ command to change the background while drawing. 56 57 58 * __^f<px>^__ 59 Forward the X drawing cursor by <px> pixel. Please bear in mind that you have to move the cursor enough to 60 display your drawing (by the with of your drawing). 61 62 63 * __^d^__ 64 Reset colors to SchemeNorm. 65 66 67 * __^C<num>^__ 68 Set foreground color to terminal color 0-15. Requires the xrdb sub-patch above. 69 70 71 * __^B<num>^__ 72 Set background color to terminal color 0-15. Requires the xrdb sub-patch above. 73 74 75 * __^w^__ 76 Swaps the current foreground/background colors. Useful when drawing multiple rectangles on top of one another. Requires the swap-save-restore sub-patch above. 77 78 79 * __^v^__ 80 Saves the current color scheme so it can be restored later with the __^t^__ tag. This way a script can modify color in the middle of the bar agnostic to what color was set previously. Requires the swap-save-restore sub-patch above. 81 82 83 * __^t^__ 84 Restores the last color scheme saved by the __^v^__ tag. Requires the swap-save-restore sub-patch above. 85 86 87 Example 88 ------- 89 `xsetroot -name "[status2d] ^c#FF0000^red text with blue 90 rectangle^c#55cdfc^^r3,3,14,14^^f20^^c#FFFFFF^^b#f7a8b8^ 91 and white text on pink background "` 92 93 94 ### Steps to draw a battery icon (ajust the values to fit your setup) 95 Draw the nose: `"^r00,07,02,04^"` 96 Draw the battery: `"^r02,04,22,10^"` 97 Fill it so that the border stays: `"^c#000000^^r03,05,20,08^"` 98 Fill it with the remaining capacaty: `"^c#ffffff^^r10,05,13,08^"` 99 Reset the colorscheme and forward the cursor: `"^d^^f24^"` 100 101 Put it all together: 102 `xsetroot -name "^r0,7,2,4^^r2,4,22,10^^c#000000^^r3,5,20,8^^c#ffffff^^r10,5,13,8^^d^^f24^"` 103 104 Authors 105 ------- 106 * [sipi](https://github.com/sipi) 107 * lhark - <lhark@ntymail.com> (6.2 port, ^b^ command) 108 * [tdu](https://github.com/tdukv) (xrdb colors, ^w^, ^v^, ^t^ commands) 109 * [El Bachir](https://github.com/elbachir-one) (barpadding+systray) 110 111 Repo 112 ---- 113 [https://github.com/sipi/dwm-status2d](https://github.com/sipi/dwm-status2d)