mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Experimenting with having more status indicators than just whether the client is floating or not
This commit is contained in:
parent
b8dc848918
commit
7275ca47ff
@ -60,8 +60,13 @@ static const char buttonbar[] = "<O>";
|
||||
static const unsigned int systrayspacing = 2; /* systray spacing */
|
||||
static const int showsystray = 1; /* 0 means no systray */
|
||||
#endif // BAR_SYSTRAY_PATCH
|
||||
static int tagindicatortype = INDICATOR_TOP_LEFT_SQUARE; // see patch/bar_indicators.h for options
|
||||
static int floatindicatortype = INDICATOR_TOP_LEFT_SQUARE; // see patch/bar_indicators.h for options
|
||||
/* Indicators: see patch/bar_indicators.h for options */
|
||||
static int tagindicatortype = INDICATOR_TOP_LEFT_SQUARE;
|
||||
static int floatindicatortype = INDICATOR_TOP_LEFT_SQUARE;
|
||||
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||
static int fakefsindicatortype = INDICATOR_PLUS;
|
||||
static int floatfakefsindicatortype = INDICATOR_PLUS_AND_LARGER_SQUARE;
|
||||
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||
#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
|
||||
|
@ -45,8 +45,7 @@ draw_awesomebar(Bar *bar, BarArg *a)
|
||||
|
||||
drw_setscheme(drw, scheme[scm]);
|
||||
drw_text(drw, x, a->y, tabw + (i < remainder ? 1 : 0), a->h, pad, c->name, 0, False);
|
||||
if (c->isfloating)
|
||||
drawindicator(c->mon, c, 1, x, a->y, w, a->h, 0, 0, c->isfixed, floatindicatortype);
|
||||
drawstateindicator(c->mon, c, 1, x, a->y, w, a->h, 0, 0, c->isfixed);
|
||||
x += tabw + (i < remainder ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
@ -53,8 +53,7 @@ draw_fancybar(Bar *bar, BarArg *a)
|
||||
drw_setscheme(drw, scheme[m->sel == c ? SchemeTitleSel : SchemeTitleNorm]);
|
||||
if (ftw > 0) /* trap special handling of 0 in drw_text */
|
||||
drw_text(drw, x, a->y, ftw, a->h, lrpad / 2, c->name, 0, False);
|
||||
if (c->isfloating)
|
||||
drawindicator(c->mon, c, 1, x, a->y, w, a->h, 0, 0, c->isfixed, floatindicatortype);
|
||||
drawstateindicator(c->mon, c, 1, x, a->y, w, a->h, 0, 0, c->isfixed);
|
||||
x += ftw;
|
||||
w -= ftw;
|
||||
}
|
||||
|
@ -190,8 +190,7 @@ flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Ar
|
||||
#endif // BAR_CENTEREDWINDOWNAME_PATCH
|
||||
|
||||
drw_text(drw, x, barg->y, w, barg->h, pad, c->name, 0, False);
|
||||
if (c->isfloating)
|
||||
drawindicator(m, c, 1, x + 2, barg->y, w, barg->h, 0, 0, 0, floatindicatortype);
|
||||
drawstateindicator(m, c, 1, x + 2, barg->y, w, barg->h, 0, 0, 0);
|
||||
|
||||
if (FLEXWINTITLE_BORDERS) {
|
||||
XSetForeground(drw->dpy, drw->gc, scheme[SchemeSel][ColBorder].pixel);
|
||||
|
@ -77,5 +77,32 @@ drawindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int
|
||||
);
|
||||
}
|
||||
break;
|
||||
case INDICATOR_PLUS_AND_LARGER_SQUARE:
|
||||
boxs += 2;
|
||||
boxw += 2;
|
||||
/* falls through */
|
||||
case INDICATOR_PLUS_AND_SQUARE:
|
||||
drw_rect(drw, x + boxs, y + boxs, boxw % 2 ? boxw : boxw + 1, boxw % 2 ? boxw : boxw + 1, filled, invert);
|
||||
/* falls through */
|
||||
case INDICATOR_PLUS:
|
||||
if (!(boxw % 2))
|
||||
boxw += 1;
|
||||
drw_rect(drw, x + boxs + boxw / 2, y + boxs, 1, boxw, filled, invert); // |
|
||||
drw_rect(drw, x + boxs, y + boxs + boxw / 2, boxw + 1, 1, filled, invert); // ‒
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
drawstateindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert)
|
||||
{
|
||||
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||
if (c->fakefullscreen && c->isfloating)
|
||||
drawindicator(m, c, occ, x, y, w, h, tag, filled, invert, floatfakefsindicatortype);
|
||||
else if (c->fakefullscreen)
|
||||
drawindicator(m, c, occ, x, y, w, h, tag, filled, invert, fakefsindicatortype);
|
||||
else
|
||||
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||
if (c->isfloating)
|
||||
drawindicator(m, c, occ, x, y, w, h, tag, filled, invert, floatindicatortype);
|
||||
}
|
@ -10,7 +10,11 @@ enum {
|
||||
INDICATOR_BOX_WIDER,
|
||||
INDICATOR_BOX_FULL,
|
||||
INDICATOR_CLIENT_DOTS,
|
||||
INDICATOR_RIGHT_TAGS
|
||||
INDICATOR_RIGHT_TAGS,
|
||||
INDICATOR_PLUS,
|
||||
INDICATOR_PLUS_AND_SQUARE,
|
||||
INDICATOR_PLUS_AND_LARGER_SQUARE,
|
||||
};
|
||||
|
||||
static void drawindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert, int type);
|
||||
static void drawindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert, int type);
|
||||
static void drawstateindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert);
|
@ -60,8 +60,7 @@ bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg
|
||||
#endif // BAR_CENTEREDWINDOWNAME_PATCH
|
||||
|
||||
drw_text(drw, x, barg->y, w, barg->h, pad, c->name, 0, False);
|
||||
if (c->isfloating)
|
||||
drawindicator(m, c, 1, x, barg->y, w, barg->h, 0, 0, c->isfixed, floatindicatortype);
|
||||
drawstateindicator(m, c, 1, x, barg->y, w, barg->h, 0, 0, c->isfixed);
|
||||
|
||||
if (BARTAB_BORDERS) {
|
||||
XSetForeground(drw->dpy, drw->gc, scheme[SchemeSel][ColBorder].pixel);
|
||||
|
@ -38,8 +38,7 @@ draw_wintitle(Bar *bar, BarArg *a)
|
||||
XSync(dpy, False);
|
||||
XSetErrorHandler(xerror);
|
||||
#endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
|
||||
if (m->sel->isfloating)
|
||||
drawindicator(m, m->sel, 1, x, a->y, w, a->h, 0, 0, m->sel->isfixed, floatindicatortype);
|
||||
drawstateindicator(m, m->sel, 1, x, a->y, w, a->h, 0, 0, m->sel->isfixed);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -15,4 +15,4 @@ togglefakefullscreen(const Arg *arg)
|
||||
c->fakefullscreen = 1;
|
||||
setfullscreen(c, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user