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