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