dwm

Luke's build of suckless's dwm
Log | Files | Refs | README | LICENSE

commit cf59ac74328dd8140cc5ab88c6234d2437f4d341
parent 35e3d2a73c1fd0bc5a2439268fb3ca184d82e95a
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sat, 12 Sep 2020 09:32:09 -0400

Merge branch 'master' of github.com:LukeSmithxyz/dwm into master

Diffstat:
Mconfig.h | 5++++-
Mdwm.c | 23++++++++++++++++++-----
Mvanitygaps.c | 4++--
3 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/config.h b/config.h @@ -213,7 +213,7 @@ static Key keys[] = { { MODKEY, XK_F5, xrdb, {.v = NULL } }, { MODKEY, XK_F6, spawn, SHCMD("torwrap") }, { MODKEY, XK_F7, spawn, SHCMD("td-toggle") }, - { MODKEY, XK_F8, spawn, SHCMD("mailsync") }, + { MODKEY, XK_F8, spawn, SHCMD("mw sync") }, { MODKEY, XK_F9, spawn, SHCMD("dmenumount") }, { MODKEY, XK_F10, spawn, SHCMD("dmenuumount") }, { MODKEY, XK_F11, spawn, SHCMD("mpv --no-cache --no-osc --no-input-default-bindings --input-conf=/dev/null --title=webcam $(ls /dev/video[0,2,4,6,8] | tail -n 1)") }, @@ -239,6 +239,7 @@ static Key keys[] = { { 0, XF86XK_AudioRewind, spawn, SHCMD("mpc seek -10") }, { 0, XF86XK_AudioForward, spawn, SHCMD("mpc seek +10") }, { 0, XF86XK_AudioMedia, spawn, SHCMD("st -e ncmpcpp") }, + { 0, XF86XK_AudioMicMute, spawn, SHCMD("pactl set-source-mute @DEFAULT_SOURCE@ toggle") }, { 0, XF86XK_PowerOff, spawn, SHCMD("sysact") }, { 0, XF86XK_Calculator, spawn, SHCMD("st -e bc -l") }, { 0, XF86XK_Sleep, spawn, SHCMD("sudo -A zzz") }, @@ -278,6 +279,7 @@ static Key keys[] = { /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ static Button buttons[] = { /* click event mask button function argument */ +#ifndef __OpenBSD__ { ClkWinTitle, 0, Button2, zoom, {0} }, { ClkStatusText, 0, Button1, sigdwmblocks, {.i = 1} }, { ClkStatusText, 0, Button2, sigdwmblocks, {.i = 2} }, @@ -285,6 +287,7 @@ static Button buttons[] = { { ClkStatusText, 0, Button4, sigdwmblocks, {.i = 4} }, { ClkStatusText, 0, Button5, sigdwmblocks, {.i = 5} }, { ClkStatusText, ShiftMask, Button1, sigdwmblocks, {.i = 6} }, +#endif { ClkStatusText, ShiftMask, Button3, spawn, SHCMD("st -e nvim ~/.local/src/dwmblocks/config.h") }, { ClkClientWin, MODKEY, Button1, movemouse, {0} }, { ClkClientWin, MODKEY, Button2, defaultgaps, {0} }, diff --git a/dwm.c b/dwm.c @@ -206,7 +206,6 @@ static void focusin(XEvent *e); static void focusmon(const Arg *arg); static void focusstack(const Arg *arg); static Atom getatomprop(Client *c, Atom prop); -static int getdwmblockspid(); static int getrootptr(int *x, int *y); static long getstate(Window w); static int gettextprop(Window w, Atom atom, char *text, unsigned int size); @@ -246,7 +245,10 @@ static void setup(void); static void seturgent(Client *c, int urg); static void showhide(Client *c); static void sigchld(int unused); +#ifndef __OpenBSD__ +static int getdwmblockspid(); static void sigdwmblocks(const Arg *arg); +#endif static void sighup(int unused); static void sigterm(int unused); static void spawn(const Arg *arg); @@ -1016,6 +1018,7 @@ getatomprop(Client *c, Atom prop) return atom; } +#ifndef __OpenBSD__ int getdwmblockspid() { @@ -1027,6 +1030,7 @@ getdwmblockspid() dwmblockspid = pid; return pid != 0 ? 0 : -1; } +#endif int getrootptr(int *x, int *y) @@ -1908,6 +1912,7 @@ sigterm(int unused) quit(&a); } +#ifndef __OpenBSD__ void sigdwmblocks(const Arg *arg) { @@ -1924,6 +1929,7 @@ sigdwmblocks(const Arg *arg) } } } +#endif void spawn(const Arg *arg) @@ -2406,18 +2412,25 @@ getparentprocess(pid_t p) { unsigned int v = 0; -#ifdef __linux__ +#if defined(__linux__) FILE *f; char buf[256]; snprintf(buf, sizeof(buf) - 1, "/proc/%u/stat", (unsigned)p); if (!(f = fopen(buf, "r"))) - return 0; + return (pid_t)0; - fscanf(f, "%*u %*s %*c %u", &v); + if (fscanf(f, "%*u %*s %*c %u", (unsigned *)&v) != 1) + v = (pid_t)0; fclose(f); -#endif /* __linux__ */ +#elif defined(__FreeBSD__) + struct kinfo_proc *proc = kinfo_getproc(p); + if (!proc) + return (pid_t)0; + v = proc->ki_ppid; + free(proc); +#endif return (pid_t)v; } diff --git a/vanitygaps.c b/vanitygaps.c @@ -343,13 +343,13 @@ centeredfloatingmaster(Monitor *m) /* go mfact box in the center if more than nmaster clients */ if (m->ww > m->wh) { mw = m->ww * m->mfact - iv*mivf*(MIN(n, m->nmaster) - 1); - mh = m->wh * 0.9; + mh = m->wh * 0.9 - 2*oh; } else { mw = m->ww * 0.9 - iv*mivf*(MIN(n, m->nmaster) - 1); mh = m->wh * m->mfact; } mx = m->wx + (m->ww - mw) / 2; - my = m->wy + (m->wh - mh - 2*oh) / 2; + my = m->wy + (m->wh - mh) / 2; sx = m->wx + ov; sy = m->wy + oh;