diff options
Diffstat (limited to 'suckless')
-rw-r--r-- | suckless/dwm/config.h | 1 | ||||
-rwxr-xr-x | suckless/dwm/dwm | bin | 0 -> 71584 bytes | |||
-rw-r--r-- | suckless/dwm/dwm.c | 17 |
3 files changed, 16 insertions, 2 deletions
diff --git a/suckless/dwm/config.h b/suckless/dwm/config.h index 9bbf981..84f3e4b 100644 --- a/suckless/dwm/config.h +++ b/suckless/dwm/config.h @@ -104,6 +104,7 @@ static const Key keys[] = { { MODKEY, XK_e, setlayout, {.v = &layouts[2]} }, { MODKEY, XK_space, setlayout, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, + { MODKEY, XK_p, togglepin, {0} }, { MODKEY, XK_0, view, {.ui = ~0 } }, { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, { MODKEY, XK_comma, focusmon, {.i = +1 } }, diff --git a/suckless/dwm/dwm b/suckless/dwm/dwm Binary files differnew file mode 100755 index 0000000..a134048 --- /dev/null +++ b/suckless/dwm/dwm diff --git a/suckless/dwm/dwm.c b/suckless/dwm/dwm.c index d99d6d5..e525220 100644 --- a/suckless/dwm/dwm.c +++ b/suckless/dwm/dwm.c @@ -49,7 +49,7 @@ #define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) #define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) -#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) +#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]) || C->ispinned) #define LENGTH(X) (sizeof X / sizeof X[0]) #define MOUSEMASK (BUTTONMASK|PointerMotionMask) #define WIDTH(X) ((X)->w + 2 * (X)->bw + gappx) @@ -92,7 +92,7 @@ struct Client { int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid; int bw, oldbw; unsigned int tags; - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; + int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, ispinned; int floatborderpx; int hasfloatbw; Client *next; @@ -217,6 +217,7 @@ static void tagmon(const Arg *arg); static void tile(Monitor *m); static void togglebar(const Arg *arg); static void togglefloating(const Arg *arg); +static void togglepin(const Arg *arg); static void togglescratch(const Arg *arg); static void toggletag(const Arg *arg); static void toggleview(const Arg *arg); @@ -759,6 +760,8 @@ drawbar(Monitor *m) drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); if (m->sel->isfloating) drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); + if (m->sel->ispinned) + drw_rect(drw, x + boxs + 2 * boxw, boxs, boxw, boxw, 1, 0); } else { drw_setscheme(drw, scheme[SchemeNorm]); drw_rect(drw, x, 0, w, bh, 1, 1); @@ -1079,6 +1082,7 @@ manage(Window w, XWindowAttributes *wa) c->x = MAX(c->x, c->mon->wx); c->y = MAX(c->y, c->mon->wy); c->bw = borderpx; + c->ispinned = 0; selmon->tagset[selmon->seltags] &= ~scratchtag; if (!strcmp(c->name, scratchpadname)) { @@ -1896,6 +1900,15 @@ togglescratch(const Arg *arg) } void +togglepin(const Arg *arg) +{ + if (!selmon->sel) + return; + selmon->sel->ispinned = !selmon->sel->ispinned; + arrange(selmon); +} + +void toggletag(const Arg *arg) { unsigned int newtags; |