Extrabar --> extrastatus

pull/48/head
bakkeby 4 years ago
parent 250fbbd2c7
commit 6961418d63

@ -49,9 +49,9 @@ static const int showsystray = 1; /* 0 means no systray */
#if ONLYQUITONEMPTY_PATCH
static const int quit_empty_window_count = 2; /* only allow dwm to quit if no windows are open, value here represents number of deamons */
#endif // ONLYQUITONEMPTY_PATCH
#if BAR_EXTRABAR_PATCH
#if BAR_EXTRASTATUS_PATCH
static const char statussep = ';'; /* separator between status bars */
#endif // BAR_EXTRABAR_PATCH
#endif // BAR_EXTRASTATUS_PATCH
#if BAR_PANGO_PATCH
static const char font[] = "monospace 10";
#else
@ -405,17 +405,17 @@ static const BarRule barrules[] = {
#elif BAR_WINTITLE_PATCH
{ -1, 0, BAR_ALIGN_NONE, width_wintitle, draw_wintitle, click_wintitle, "wintitle" },
#endif // BAR_AWESOMEBAR_PATCH | BAR_FANCYBAR_PATCH BAR_WINTITLE_PATCH
#if BAR_EXTRABAR_PATCH
#if BAR_EXTRASTATUS_PATCH
#if BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH
{ 'A', 1, BAR_ALIGN_CENTER, width_status2d_eb, draw_status2d_eb, click_statuscmd_eb, "status2d_eb" },
{ 'A', 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_statuscmd_es, "status2d_es" },
#elif BAR_STATUS2D_PATCH
{ 'A', 1, BAR_ALIGN_CENTER, width_status2d_eb, draw_status2d_eb, click_status2d, "status2d_eb" },
{ 'A', 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_status2d, "status2d_es" },
#elif BAR_STATUSCMD_PATCH
{ 'A', 1, BAR_ALIGN_CENTER, width_status_eb, draw_status_eb, click_statuscmd_eb, "status_eb" },
{ 'A', 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_statuscmd_es, "status_es" },
#elif BAR_STATUS_PATCH
{ 'A', 1, BAR_ALIGN_CENTER, width_status_eb, draw_status_eb, click_status, "status_eb" },
{ 'A', 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_status, "status_es" },
#endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH
#endif // BAR_EXTRABAR_PATCH
#endif // BAR_EXTRASTATUS_PATCH
};
#if DWMC_PATCH

12
dwm.c

@ -564,14 +564,14 @@ static char stext[1024];
#else
static char stext[512];
#endif // BAR_STATUS2D_PATCH
#if BAR_EXTRABAR_PATCH || BAR_STATUSCMD_PATCH
#if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH
#if BAR_STATUS2D_PATCH
static char rawstext[1024];
#else
static char rawstext[512];
#endif // BAR_STATUS2D_PATCH
#endif // BAR_EXTRABAR_PATCH | BAR_STATUSCMD_PATCH
#if BAR_EXTRABAR_PATCH
#endif // BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH
#if BAR_EXTRASTATUS_PATCH
#if BAR_STATUS2D_PATCH && !BAR_STATUSCOLORS_PATCH
static char estext[1024];
#else
@ -582,7 +582,7 @@ static char rawestext[1024];
#else
static char rawestext[512];
#endif // BAR_STATUSCMD_PATCH
#endif // BAR_EXTRABAR_PATCH
#endif // BAR_EXTRASTATUS_PATCH
static int screen;
static int sw, sh; /* X display screen geometry width, height */
@ -3667,7 +3667,7 @@ void
updatestatus(void)
{
Monitor *m;
#if BAR_EXTRABAR_PATCH
#if BAR_EXTRASTATUS_PATCH
if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext))) {
strcpy(stext, "dwm-"VERSION);
estext[0] = '\0';
@ -3698,7 +3698,7 @@ updatestatus(void)
#else
if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
strcpy(stext, "dwm-"VERSION);
#endif // BAR_EXTRABAR_PATCH
#endif // BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH
for (m = mons; m; m = m->next)
drawbar(m);
}

@ -8,6 +8,18 @@ width_status(Bar *bar, BarWidthArg *a)
#endif // BAR_PANGO_PATCH
}
#if BAR_EXTRASTATUS_PATCH
int
width_status_es(Bar *bar, BarWidthArg *a)
{
#if BAR_PANGO_PATCH
return TEXTWM(estext) - lrpad;
#else
return TEXTW(estext) - lrpad;
#endif // BAR_PANGO_PATCH
}
#endif // BAR_EXTRASTATUS_PATCH
int
draw_status(Bar *bar, BarDrawArg *a)
{
@ -18,6 +30,18 @@ draw_status(Bar *bar, BarDrawArg *a)
#endif // BAR_PANGO_PATCH
}
#if BAR_EXTRASTATUS_PATCH
int
draw_status_es(Bar *bar, BarDrawArg *a)
{
#if BAR_PANGO_PATCH
return drw_text(drw, a->x, 0, a->w, bh, 0, estext, 0, True);
#else
return drw_text(drw, a->x, 0, a->w, bh, 0, estext, 0);
#endif // BAR_PANGO_PATCH
}
#endif // BAR_EXTRASTATUS_PATCH
int
click_status(Bar *bar, Arg *arg, BarClickArg *a)
{

@ -1,3 +1,9 @@
static int width_status(Bar *bar, BarWidthArg *a);
#if BAR_EXTRASTATUS_PATCH
static int width_status_es(Bar *bar, BarWidthArg *a);
#endif // BAR_EXTRASTATUS_PATCH
static int draw_status(Bar *bar, BarDrawArg *a);
#if BAR_EXTRASTATUS_PATCH
static int draw_status_es(Bar *bar, BarDrawArg *a);
#endif // BAR_EXTRASTATUS_PATCH
static int click_status(Bar *bar, Arg *arg, BarClickArg *a);

@ -4,12 +4,28 @@ width_status2d(Bar *bar, BarWidthArg *a)
return status2dtextlength(rawstext) + lrpad;
}
#if BAR_EXTRASTATUS_PATCH
int
width_status2d_es(Bar *bar, BarWidthArg *a)
{
return status2dtextlength(rawestext);
}
#endif // BAR_EXTRASTATUS_PATCH
int
draw_status2d(Bar *bar, BarDrawArg *a)
{
return drawstatusbar(a->x, rawstext);
}
#if BAR_EXTRASTATUS_PATCH
int
draw_status2d_es(Bar *bar, BarDrawArg *a)
{
return drawstatusbar(a->x, rawestext);
}
#endif // BAR_EXTRASTATUS_PATCH
#if !BAR_STATUSCMD_PATCH
int
click_status2d(Bar *bar, Arg *arg, BarClickArg *a)

@ -1,5 +1,11 @@
static int width_status2d(Bar *bar, BarWidthArg *a);
#if BAR_EXTRASTATUS_PATCH
static int width_status2d_es(Bar *bar, BarWidthArg *a);
#endif // BAR_EXTRASTATUS_PATCH
static int draw_status2d(Bar *bar, BarDrawArg *a);
#if BAR_EXTRASTATUS_PATCH
static int draw_status2d_es(Bar *bar, BarDrawArg *a);
#endif // BAR_EXTRASTATUS_PATCH
#if !BAR_STATUSCMD_PATCH
static int click_status2d(Bar *bar, Arg *arg, BarClickArg *a);
#endif // BAR_STATUSCMD_PATCH

@ -1,11 +0,0 @@
int
width_status2d_eb(Bar *bar, BarWidthArg *a)
{
return status2dtextlength(rawestext);
}
int
draw_status2d_eb(Bar *bar, BarDrawArg *a)
{
return drawstatusbar(a->x, rawestext);
}

@ -1,19 +0,0 @@
int
width_status_eb(Bar *bar, BarWidthArg *a)
{
#if BAR_PANGO_PATCH
return TEXTWM(estext) - lrpad;
#else
return TEXTW(estext) - lrpad;
#endif // BAR_PANGO_PATCH
}
int
draw_status_eb(Bar *bar, BarDrawArg *a)
{
#if BAR_PANGO_PATCH
return drw_text(drw, a->x, 0, a->w, bh, 0, estext, 0, True);
#else
return drw_text(drw, a->x, 0, a->w, bh, 0, estext, 0);
#endif // BAR_PANGO_PATCH
}

@ -1,2 +0,0 @@
static int width_status_eb(Bar *bar, BarWidthArg *a);
static int draw_status_eb(Bar *bar, BarDrawArg *a);

@ -10,13 +10,13 @@ click_statuscmd(Bar *bar, Arg *arg, BarClickArg *a)
return click_statuscmd_text(arg, a->rel_x, rawstext);
}
#if BAR_EXTRABAR_PATCH
#if BAR_EXTRASTATUS_PATCH
int
click_statuscmd_eb(Bar *bar, Arg *arg, BarClickArg *a)
click_statuscmd_es(Bar *bar, Arg *arg, BarClickArg *a)
{
return click_statuscmd_text(arg, a->rel_x, rawestext);
}
#endif // BAR_EXTRABAR_PATCH
#endif // BAR_EXTRASTATUS_PATCH
int
click_statuscmd_text(Arg *arg, int rel_x, char *text)

@ -1,6 +1,6 @@
static int click_statuscmd(Bar *bar, Arg *arg, BarClickArg *a);
#if BAR_EXTRABAR_PATCH
static int click_statuscmd_eb(Bar *bar, Arg *arg, BarClickArg *a);
#endif // BAR_EXTRABAR_PATCH
#if BAR_EXTRASTATUS_PATCH
static int click_statuscmd_es(Bar *bar, Arg *arg, BarClickArg *a);
#endif // BAR_EXTRASTATUS_PATCH
static int click_statuscmd_text(Arg *arg, int rel_x, char *text);
static void copyvalidchars(char *text, char *rawtext);

@ -22,15 +22,9 @@
#endif
#if BAR_STATUS_PATCH
#include "bar_status.c"
#if BAR_EXTRABAR_PATCH
#include "bar_status_eb.c"
#endif // BAR_EXTRABAR_PATCH
#endif
#if BAR_STATUS2D_PATCH
#include "bar_status2d.c"
#if BAR_EXTRABAR_PATCH
#include "bar_status2d_eb.c"
#endif // BAR_EXTRABAR_PATCH
#endif
#if BAR_STATUSBUTTON_PATCH
#include "bar_statusbutton.c"

@ -22,15 +22,9 @@
#endif
#if BAR_STATUS_PATCH
#include "bar_status.h"
#if BAR_EXTRABAR_PATCH
#include "bar_status_eb.h"
#endif // BAR_EXTRABAR_PATCH
#endif
#if BAR_STATUS2D_PATCH
#include "bar_status2d.h"
#if BAR_EXTRABAR_PATCH
#include "bar_status2d_eb.h"
#endif // BAR_EXTRABAR_PATCH
#endif
#if BAR_STATUSBUTTON_PATCH
#include "bar_statusbutton.h"

@ -136,12 +136,12 @@
*/
#define BAR_DMENUMATCHTOP_PATCH 0
/* This patch will enable an extra status bar in dwm in a similar manner to the dualstatus
* patch. If the primary status is at the top via topbar then the extra status bar will be
* placed at the bottom and vice versa.
/* Originally this was the extrabar patch, but as the handling of extra bars is now built-in
* only the splitting of the status by a designated separator remains. As such this has been
* renamed to more accurately reflect what it does - creating an extra status.
* https://dwm.suckless.org/patches/extrabar/
*/
#define BAR_EXTRABAR_PATCH 0
#define BAR_EXTRASTATUS_PATCH 0
/* Adds EWMH support for _NET_NUMBER_OF_DESKTOPS, _NET_CURRENT_DESKTOP, _NET_DESKTOP_NAMES
* and _NET_DESKTOP_VIEWPORT, which allows for compatibility with other bars and programs

Loading…
Cancel
Save