t* dwm + patches URI git clone git://git.codevoid.de/dwm-sdk DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit 35a1bd478d5d01cd97af1b840d561ae46de2687c DIR parent 53ab4b1968efbf94b7bf93a20b70a48fefc4c3e9 URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de> Date: Mon, 12 Nov 2018 22:11:48 +0100 OpenBSD Update Diffstat: M config.h | 14 ++------------ M config.mk | 6 +++--- A dwm | 0 M dwm.c | 32 ++++++++++++++++++++++++++++--- 4 files changed, 34 insertions(+), 18 deletions(-) --- DIR diff --git a/config.h b/config.h t@@ -11,8 +11,7 @@ static const int showsystray = 1; /* 0 means no systray */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ -static const char font_normal[] = "Fira Mono:size=10"; -static const char font_bigger[] = "Fira Mono:size=16"; +static const char font_normal[] = "-misc-tamzenforpowerline-medium-r-normal--20-145-100-100-c-100-iso8859-1"; static const char *fonts[] = { font_normal }; static const char col_vdark[] = "#111111"; t@@ -80,33 +79,24 @@ static const char scratchpadname[] = "scratchpad"; static const char *termcmd[] = { "st", "-f", font_normal, NULL }; static const char *mailcmd[] = { "st", "-f", font_normal, "-e", "mutt", NULL }; -static const char *bigtermcmd[] = { "st", "-f", font_bigger, NULL }; static const char *notescmd[] = { "st", "-f", font_normal, "-e", "vim", "Seafile/NotesSync/notes.otl", NULL }; -static const char *scratchpadcmd[] = { "st", "-f", font_normal, "-t", scratchpadname, "-g", "145x38", NULL }; -static const char *bigscratchpadcmd[] = { "st", "-f", font_bigger, "-t", scratchpadname, "-g", "95x25", NULL }; +static const char *scratchpadcmd[] = { "st", "-f", font_normal, "-t", scratchpadname, "-g", "100x25", NULL }; static const char *dmenucmd[] = { "dmenu_run", DMENUOPTS, NULL }; static const char *browsercmd[] = { ".dwm/browser", DMENUOPTS, NULL }; static const char *passmenucmd[] = { ".dwm/passmenu", DMENUOPTS, NULL }; static const char *browserpaste[] = { ".dwm/browserpaste", NULL }; -static const char *volumeupcmd[] = { ".dwm/mixer", "+2", NULL }; -static const char *volumedowncmd[] = { ".dwm/mixer", "-2", NULL }; - static Key keys[] = { /* modifier key function argument */ // application launcher { MODKEY, XK_d, spawn, {.v = dmenucmd } }, { MODKEY, XK_Return, spawn, {.v = termcmd } }, - { MODKEY|ShiftMask, XK_Return, spawn, {.v = bigtermcmd } }, { MODKEY|ShiftMask, XK_f, spawn, {.v = browsercmd } }, { MODKEY|ShiftMask, XK_p, spawn, {.v = passmenucmd } }, { MODKEY|ShiftMask, XK_m, spawn, {.v = mailcmd } }, { MODKEY, XK_minus, togglescratch, {.v = scratchpadcmd } }, - { MODKEY|ShiftMask, XK_minus, togglescratch, {.v = bigscratchpadcmd } }, - { 0, 0x1008ff13,spawn, {.v = volumeupcmd } }, - { 0, 0x1008ff11,spawn, {.v = volumedowncmd } }, { MODKEY, XK_p, spawn, {.v = browserpaste } }, { MODKEY|ShiftMask, XK_o, spawn, {.v = notescmd } }, DIR diff --git a/config.mk b/config.mk t@@ -18,15 +18,15 @@ XINERAMAFLAGS = -DXINERAMA FREETYPELIBS = -lfontconfig -lXft FREETYPEINC = /usr/include/freetype2 # OpenBSD (uncomment) -#FREETYPEINC = ${X11INC}/freetype2 +FREETYPEINC = ${X11INC}/freetype2 # includes and libs INCS = -I${X11INC} -I${FREETYPEINC} LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} # FreeBSD (uncomment)¬ -LIBS = -L/usr/local/lib -lc -lm -L${X11LIB} -lXft -lfontconfig -lX11 -lX11 ${XINERAMALIBS} -INCS = -I. -I/usr/local/include -I/usr/local/include/freetype2 -I${X11INC} +#LIBS = -L/usr/local/lib -lc -lm -L${X11LIB} -lXft -lfontconfig -lX11 -lX11 ${XINERAMALIBS} +#INCS = -I. -I/usr/local/include -I/usr/local/include/freetype2 -I${X11INC} # flags CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} DIR diff --git a/dwm b/dwm Binary files differ. DIR diff --git a/dwm.c b/dwm.c t@@ -49,7 +49,8 @@ #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 ISVISIBLEONTAG(C, T) ((C->tags & T)) +#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags]) #define LENGTH(X) (sizeof X / sizeof X[0]) #define MOUSEMASK (BUTTONMASK|PointerMotionMask) #define WIDTH(X) ((X)->w + 2 * (X)->bw) t@@ -171,6 +172,7 @@ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interac static void arrange(Monitor *m); static void arrangemon(Monitor *m); static void attach(Client *c); +static void attachaside(Client *c); static void attachstack(Client *c); static void buttonpress(XEvent *e); static void checkotherwm(void); t@@ -209,6 +211,7 @@ static void maprequest(XEvent *e); static void monocle(Monitor *m); static void motionnotify(XEvent *e); static void movemouse(const Arg *arg); +static Client *nexttagged(Client *c); static Client *nexttiled(Client *c); static void pop(Client *); static void propertynotify(XEvent *e); t@@ -446,6 +449,18 @@ attach(Client *c) } void +attachaside(Client *c) { + Client *at = nexttagged(c); + if(!at) { + attach(c); + return; + } + c->next = at->next; + at->next = c; +} + + +void attachstack(Client *c) { c->snext = c->mon->stack; t@@ -1185,7 +1200,7 @@ manage(Window w, XWindowAttributes *wa) c->isfloating = c->oldstate = trans != None || c->isfixed; if (c->isfloating) XRaiseWindow(dpy, c->win); - attach(c); + attachaside(c); attachstack(c); XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, (unsigned char *) &(c->win), 1); t@@ -1321,6 +1336,16 @@ movemouse(const Arg *arg) } } + Client * +nexttagged(Client *c) { + Client *walked = c->mon->clients; + for(; + walked && (walked->isfloating || !ISVISIBLEONTAG(walked, c->tags)); + walked = walked->next + ); + return walked; +} + Client * nexttiled(Client *c) { t@@ -1591,7 +1616,7 @@ sendmon(Client *c, Monitor *m) detachstack(c); c->mon = m; c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ - attach(c); + attachaside(c); attachstack(c); focus(NULL); arrange(NULL); t@@ -2110,6 +2135,7 @@ updategeom(void) detachstack(c); c->mon = mons; attach(c); + attachaside(c); attachstack(c); } if (m == selmon)