|
|
|
@ -60,7 +60,7 @@ |
|
|
|
|
|
|
|
|
|
/* enums */ |
|
|
|
|
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ |
|
|
|
|
enum { SchemeNorm, SchemeSel, SchemeStatus, SchemeTagsSel, SchemeTagsNorm, SchemeInfoSel, SchemeInfoNorm }; /* color schemes */ |
|
|
|
|
enum { SchemeNorm, SchemeSel, SchemeStatus, SchemeTagsSel, SchemeTagsNorm, SchemeInfoSel, SchemeInfoNorm, SchemeMenu }; /* color schemes */ |
|
|
|
|
enum { NetSupported, NetWMName, NetWMState, NetWMCheck, |
|
|
|
|
NetWMFullscreen, NetActiveWindow, NetWMWindowType, |
|
|
|
|
NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ |
|
|
|
@ -142,6 +142,11 @@ typedef struct { |
|
|
|
|
int monitor; |
|
|
|
|
} Rule; |
|
|
|
|
|
|
|
|
|
typedef struct { |
|
|
|
|
const char **command; |
|
|
|
|
const char **name; |
|
|
|
|
} Launcher; |
|
|
|
|
|
|
|
|
|
/* function declarations */ |
|
|
|
|
static void applyrules(Client *c); |
|
|
|
|
static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact); |
|
|
|
@ -439,9 +444,23 @@ buttonpress(XEvent *e) |
|
|
|
|
if (i < LENGTH(tags)) { |
|
|
|
|
click = ClkTagBar; |
|
|
|
|
arg.ui = 1 << i; |
|
|
|
|
} else if (ev->x < x + blw) |
|
|
|
|
goto execute_handler; |
|
|
|
|
} else if (ev->x < x + blw) { |
|
|
|
|
click = ClkLtSymbol; |
|
|
|
|
else if (ev->x > selmon->ww - TEXTW(stext)) |
|
|
|
|
goto execute_handler; |
|
|
|
|
} |
|
|
|
|
x += blw; |
|
|
|
|
for (i = 0; i < LENGTH(launchers); i++) { |
|
|
|
|
x += TEXTW(launchers[i].name); |
|
|
|
|
if (ev->x < x) { |
|
|
|
|
Arg a; |
|
|
|
|
a.v = launchers[i].command; |
|
|
|
|
spawn(&a); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (ev->x > selmon->ww - TEXTW(stext)) |
|
|
|
|
click = ClkStatusText; |
|
|
|
|
else |
|
|
|
|
click = ClkWinTitle; |
|
|
|
@ -451,6 +470,9 @@ buttonpress(XEvent *e) |
|
|
|
|
XAllowEvents(dpy, ReplayPointer, CurrentTime); |
|
|
|
|
click = ClkClientWin; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
execute_handler: |
|
|
|
|
|
|
|
|
|
for (i = 0; i < LENGTH(buttons); i++) |
|
|
|
|
if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button |
|
|
|
|
&& CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) |
|
|
|
@ -732,6 +754,14 @@ drawbar(Monitor *m) |
|
|
|
|
drw_setscheme(drw, scheme[SchemeTagsNorm]); |
|
|
|
|
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); |
|
|
|
|
|
|
|
|
|
/* Draw launchers */ |
|
|
|
|
for (i = 0; i < LENGTH(launchers); i++) { |
|
|
|
|
w = TEXTW(launchers[i].name); |
|
|
|
|
drw_setscheme(drw, scheme[SchemeMenu]); |
|
|
|
|
drw_text(drw, x, 0, w, bh, lrpad / 2, launchers[i].name, urg & 1 << i); |
|
|
|
|
x += w; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ((w = m->ww - tw - x) > bh) { |
|
|
|
|
if (n > 0) { |
|
|
|
|
tw = TEXTW(m->sel->name) + lrpad; |
|
|
|
|