bakkeby / dwm-flexipatch

A dwm build with preprocessor directives to decide which patches to include during build time
MIT License
1.18k stars 238 forks source link

draw underline under statusbar elements with status2d patch #87

Closed plasmoduck closed 3 years ago

plasmoduck commented 3 years ago

Hi again, is it possible to draw an underline under my statusbar elements using the status2d patch like the tag indicator underlines to match? If so then how? I know you can draw shapes with it. combined

bakkeby commented 3 years ago

I haven't tested this, but before returning from the draw_status2d function ref. https://github.com/plasmoduck/modwm2/blob/main/patch/bar_status2d.c#L50-L58

try adding a line like this:

drawindicator(bar->mon, NULL, 1, a->x, a->y, a->w, a->h, 0, 1, 0, tiledindicatortype);
plasmoduck commented 3 years ago

I tried this but it didnt work.

draw_status2d(Bar bar, BarArg a) {

if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH

   drawindicator(bar->mon, NULL, 1, a->x, a->y, a->w, a->h, 0, 1, 0, tiledindicatortype);
   return drawstatusbar(a, rawstext);
   #else
   drawindicator(bar->mon, NULL, 1, a->x, a->y, a->w, a->h, 0, 1, 0, tiledindicatortype);
   return drawstatusbar(a, stext);
   #endif // #if BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH

}

bakkeby commented 3 years ago

In what way did it not work?

I believe you would have to draw the line after the status has drawn, something like this:

draw_status2d(Bar *bar, BarArg *a)
{
    int ret;
    #if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH
    ret = drawstatusbar(a, rawstext);
    #else
    ret = drawstatusbar(a, stext);
    #endif // #if BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH
    drawindicator(bar->mon, NULL, 1, a->x, a->y, a->w, a->h, 0, 1, 0, tiledindicatortype);
    return ret;
}
plasmoduck commented 3 years ago

I tried that too and no underline on my statusbar

bakkeby commented 3 years ago

I don't know, I tried the above and I got a line.

image

plasmoduck commented 3 years ago

Okay it worked, sorry my fault. Is it possible to get broken lines _ etc under the statusbar? Or only a solid line like that?

bakkeby commented 3 years ago

It's only a solid line. As far as dwm is concerned the status is just a single string.

I am not sure how you'd go about making a line for each "block" as it is not straightforward to differentiate between when one block starts and another one begins.

plasmoduck commented 3 years ago

I thought it might be tricky, fair enough. Thanks mate

plasmoduck commented 3 years ago

Btw, someone reported a memory leak bug with my fork, not sure if you patched yours but here is the comment https://github.com/plasmoduck/modwm/issues/2

plasmoduck commented 1 year ago

Jetbrains Mono

On Tue, 14 Feb 2023, 11:45 pm raxchaPanceps, @.***> wrote:

what's the name of this font?

— Reply to this email directly, view it on GitHub https://github.com/bakkeby/dwm-flexipatch/issues/87#issuecomment-1429691002, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJJMIYF3N7Y3B5QI2JAVXA3WXN46DANCNFSM4VPHRSKQ . You are receiving this because you modified the open/close state.Message ID: @.***>