From 12c731865e92d524f91163fa0dd54bd96aa9e6ab Mon Sep 17 00:00:00 2001 From: aajonusonline <62964550+aajonusonline@users.noreply.github.com> Date: Mon, 18 May 2020 23:30:49 +0300 Subject: [PATCH 1/5] swallow patch: add FreeBSD support patch from this commit: https://github.com/deadpixi/deadpixi-dwm/commit/42a798c34b4a4182599fc09f661c3b826a77bd54 --- dwm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dwm.c b/dwm.c index c58300f..11dd32b 100644 --- a/dwm.c +++ b/dwm.c @@ -2405,18 +2405,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; } From d8cc17eaac20cf6b15316b71813237f99b17fa81 Mon Sep 17 00:00:00 2001 From: Johannes Bensmann Date: Mon, 1 Jun 2020 22:27:56 +0200 Subject: [PATCH 2/5] fixed gaps in centeredfloatingmaster layout the master area moved up when increasing outer gaps --- vanitygaps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vanitygaps.c b/vanitygaps.c index 2b438be..7245e74 100644 --- 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; From 58a2f00268a072f3a8e9abc77b8b13829b2644ba Mon Sep 17 00:00:00 2001 From: hamidout Date: Sun, 26 Jul 2020 16:18:05 +0100 Subject: [PATCH 3/5] added binding to Mic-Mute key(mutes mic, duh) --- config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/config.h b/config.h index ab4026c..c872b8b 100644 --- a/config.h +++ b/config.h @@ -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") }, From dbad3534f330ac0c3019b90556f70fabfe483e00 Mon Sep 17 00:00:00 2001 From: skeletal738 Date: Sun, 9 Aug 2020 15:32:51 +0100 Subject: [PATCH 4/5] dwmblocks doesn't receive signals on OpenBSD, OpenBSD doesn't implement sigqueue. Got rid of these. --- config.h | 2 ++ dwm.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config.h b/config.h index ab4026c..d06e6ec 100644 --- a/config.h +++ b/config.h @@ -278,6 +278,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 +286,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 index 47e099c..f3a0705 100644 --- 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) From 92fc0c14032d27a1a445eefa094551aa30b1f9ea Mon Sep 17 00:00:00 2001 From: Axel Baker-Bates <58554967+asparagusfox@users.noreply.github.com> Date: Tue, 8 Sep 2020 18:02:25 +0100 Subject: [PATCH 5/5] "mw sync" is the new command to sync mail --- config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.h b/config.h index 771e7a1..3951f8e 100644 --- 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)") },