commit 18ef4be6d32014d95497dc41f24c5de9accb7141
parent e7f9fe5edd98e5143541962636b3e35657438637
Author: Jacob R. Edwards <n/a>
Date: Mon, 7 Feb 2022 15:50:43 -0800
Add dwm fork
Diffstat:
6 files changed, 342 insertions(+), 0 deletions(-)
diff --git a/local/src/src/fork/dwm/Makefile b/local/src/src/fork/dwm/Makefile
@@ -0,0 +1,7 @@
+dir = dwm-6.3
+arc = ${dir}.tar.gz
+url = http://dl.suckless.org/dwm/${arc}
+
+.include "../common.mk"
+.include "../http.mk"
+.include "../suckless.mk"
diff --git a/local/src/src/fork/dwm/patches/config.diff b/local/src/src/fork/dwm/patches/config.diff
@@ -0,0 +1,174 @@
+--- /dev/null Mon Feb 7 15:46:52 2022
++++ config.h Mon Feb 7 15:45:31 2022
+@@ -0,0 +1,171 @@
++/* See LICENSE file for copyright and license details. */
++
++#include <X11/XF86keysym.h>
++
++/* appearence */
++static const int showbar = 1;
++static const int topbar = 1;
++static const unsigned int borderpx = 4;
++static const unsigned int snap = 16; /* window snap margin in floating mode */
++
++static const char dmenufont[] = "monospace:size=8";
++static const char *fonts[] = { dmenufont };
++
++static const char cdull[] = "#222";
++static const char cemph[] = "#5AF";
++static const char cprimary[] = "black";
++static const char csecondary[] = "white";
++static const char *colors[][3] = {
++ /* fg, bg, border */
++ [SchemeNorm] = { csecondary, cprimary, cdull },
++ [SchemeSel] = { cprimary, csecondary, cemph }
++};
++
++/* tagging */
++static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
++
++static const Rule rules[] = {
++ /* xprop(1):
++ * WM_CLASS(STRING) = instance, class
++ * WM_NAME(STRING) = title
++ */
++ /* class, instance, title, tags, mask, isfloating, monitor */
++ { NULL, NULL, NULL, 0, 0, -1 }
++};
++
++/* layout(s) */
++static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
++static const float mfact = 0.6; /* factor of master area size [0.05..0.95] */
++static const int nmaster = 1; /* number of clients in master area */
++static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
++
++static const Layout layouts[] = {
++ /* symbol, arrange function */
++ { "tile", tile },
++ { "mono", monocle },
++ { "none", NULL }
++};
++
++/* key definitions */
++#define MODKEY Mod4Mask
++#define TAGKEYS(KEY, TAG) \
++ { MODKEY, KEY, view, { .ui = 1 << TAG } }, \
++ { MODKEY|ControlMask, KEY, toggleview, { .ui = 1 << TAG } }, \
++ { MODKEY|ShiftMask, KEY, tag, { .ui = 1 << TAG } }, \
++ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, { .ui = 1 << TAG } }
++
++/* helper for spawning shell commands in the pre dwm-5.0 fashion */
++#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", "exec " cmd, NULL } }
++
++/* create argument array */
++#define ARGV(...) { .v = (const char*[]){ __VA_ARGS__, NULL } }
++
++/* commands */
++static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
++static const char *dmenucmd[] = {
++ "dmenu_run", "-m", dmenumon, "-l", "0", "-fn", dmenufont,
++ "-nb", cprimary, "-nf", csecondary, "-sb", csecondary,
++ "-sf", cprimary, NULL
++};
++
++static char *audio_next[] = { "apc", "next", NULL };
++static char *audio_pause[] = { "apc", "pause", NULL };
++static char *audio_play[] = { "apc", "play", NULL };
++static char *audio_previous[] = { "apc", "previous", NULL };
++static char *audio_stop[] = { "apc", "stop", NULL };
++static char *audio_toggle[] = { "apc", "toggle", NULL };
++static char *volume_lower[] = { "sndioctl", "output.level=-0.05", NULL };
++static char *volume_mute[] = { "sndioctl", "output.mute=!", NULL };
++static char *volume_raise[] = { "sndioctl", "output.level=+0.05", NULL };
++
++static Key keys[] = {
++ /* modifier, key, function, argument */
++
++ /* global */
++ { MODKEY, XK_b, togglebar, { 0 } },
++ { MODKEY|ShiftMask, XK_q, quit, { 0 } },
++
++ /* client */
++ { MODKEY, XK_h, setmfact, { .f = -0.05 } },
++ { MODKEY, XK_i, incnmaster, { .i = +1 } },
++ { MODKEY, XK_j, focusstack, { .i = +1 } },
++ { MODKEY, XK_k, focusstack, { .i = -1 } },
++ { MODKEY, XK_l, setmfact, { .f = +0.05 } },
++ { MODKEY, XK_o, incnmaster, { .i = -1 } },
++ { MODKEY, XK_t, zoom, { 0 } },
++ { MODKEY, XK_v, togglefullscr, { 0 } },
++ { MODKEY, XK_w, killclient, { 0 } },
++
++ /* tag */
++ TAGKEYS(XK_1, 0),
++ TAGKEYS(XK_2, 1),
++ TAGKEYS(XK_3, 2),
++ TAGKEYS(XK_4, 3),
++ TAGKEYS(XK_5, 4),
++ TAGKEYS(XK_6, 5),
++ TAGKEYS(XK_7, 6),
++ TAGKEYS(XK_8, 7),
++ TAGKEYS(XK_9, 8),
++ { MODKEY, XK_0, view, { .i = ~0 } },
++ { MODKEY, XK_Tab, view, { 0 } },
++
++ /* layout */
++ { MODKEY, XK_a, setlayout, { .v = &layouts[0] } },
++ { MODKEY, XK_s, setlayout, { .v = &layouts[1] } },
++ { MODKEY, XK_d, setlayout, { .v = &layouts[2] } },
++
++ /* monitor */
++ { MODKEY, XK_comma, focusmon, { .i = -1 } },
++ { MODKEY, XK_period, focusmon, { .i = +1 } },
++ { MODKEY|ShiftMask, XK_comma, tagmon, { .i = -1 } },
++ { MODKEY|ShiftMask, XK_period, tagmon, { .i = +1 } },
++
++ /* audio player */
++ { 0, XF86XK_AudioNext, spawn, { .v = audio_next } },
++ { 0, XF86XK_AudioPause, spawn, { .v = audio_pause } },
++ { 0, XF86XK_AudioPlay, spawn, { .v = audio_play } },
++ { 0, XF86XK_AudioPrev, spawn, { .v = audio_previous } },
++ { 0, XF86XK_AudioStop, spawn, { .v = audio_stop } },
++ { MODKEY, XK_g, spawn, { .v = audio_toggle } },
++ { MODKEY, XK_n, spawn, { .v = audio_next } },
++ { MODKEY, XK_p, spawn, { .v = audio_previous } },
++
++ /* audio output */
++ { 0, XF86XK_AudioLowerVolume, spawn, { .v = volume_lower } },
++ { 0, XF86XK_AudioMute, spawn, { .v = volume_mute } },
++ { 0, XF86XK_AudioRaiseVolume, spawn, { .v = volume_raise } },
++ { MODKEY, XK_m, spawn, { .v = volume_mute } },
++ { MODKEY, XK_u, spawn, { .v = volume_raise } },
++ { MODKEY, XK_y, spawn, { .v = volume_lower } },
++
++ /* backlight */
++ { 0, XF86XK_MonBrightnessDown, spawn, ARGV("xbacklight", "-steps", "1", "-time", "0", "-dec", "10") },
++ { 0, XF86XK_MonBrightnessUp, spawn, ARGV("xbacklight", "-steps", "1", "-time", "0", "-inc", "10") },
++
++ /* idle */
++ { MODKEY, XK_z, spawn, ARGV("idle") },
++ { MODKEY, XK_x, spawn, ARGV("away") },
++
++ /* etc */
++ { MODKEY, XK_c, spawn, ARGV("xnetquery") },
++ { MODKEY, XK_e, spawn, { .v = dmenucmd } },
++ /* /bin/sh removes rc(1) functions...
++ * { MODKEY, XK_f, spawn, SHCMD("${TERMINAL:-st}") },
++ */
++ { MODKEY, XK_f, spawn, ARGV("9term", NULL) },
++ { MODKEY, XK_r, spawn, SHCMD("${BROWSER:-surf}") }
++};
++
++/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
++static Button buttons[] = {
++ /* click, event mask, button, function, argument */
++ { ClkClientWin, MODKEY, Button1, movemouse, { 0 } },
++ { ClkClientWin, MODKEY, Button2, togglefloating, { 0 } },
++ { ClkClientWin, MODKEY, Button3, resizemouse, { 0 } },
++ { ClkLtSymbol, 0, Button1, setlayout, { 0 } },
++ { ClkTagBar, 0, Button1, view, { 0 } },
++ { ClkTagBar, 0, Button3, toggleview, { 0 } },
++ { ClkTagBar, MODKEY, Button1, tag, { 0 } },
++ { ClkTagBar, MODKEY, Button3, toggletag, { 0 } },
++ { ClkWinTitle, 0, Button2, zoom, { 0 } }
++};
diff --git a/local/src/src/fork/dwm/patches/dwm-actualfullscreen-20191112-cb3f58a.diff b/local/src/src/fork/dwm/patches/dwm-actualfullscreen-20191112-cb3f58a.diff
@@ -0,0 +1,53 @@
+From 3a16816a6f5d38014c2a06ce395873c545c8789a Mon Sep 17 00:00:00 2001
+From: Soenke Lambert <s.lambert@mittwald.de>
+Date: Tue, 12 Nov 2019 10:44:02 +0100
+Subject: [PATCH] Fullscreen current window with [Alt]+[Shift]+[f]
+
+This actually fullscreens a window, instead of just hiding the statusbar
+and applying the monocle layout.
+---
+ config.def.h | 1 +
+ dwm.c | 8 ++++++++
+ 2 files changed, 9 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..8cd3204 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -78,6 +78,7 @@ static Key keys[] = {
+ { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XK_space, setlayout, {0} },
+ { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
++ { MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
+ { MODKEY, XK_0, view, {.ui = ~0 } },
+ { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
+ { MODKEY, XK_comma, focusmon, {.i = -1 } },
+diff --git a/dwm.c b/dwm.c
+index 4465af1..c1b899a 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -211,6 +211,7 @@ static void tagmon(const Arg *arg);
+ static void tile(Monitor *);
+ static void togglebar(const Arg *arg);
+ static void togglefloating(const Arg *arg);
++static void togglefullscr(const Arg *arg);
+ static void toggletag(const Arg *arg);
+ static void toggleview(const Arg *arg);
+ static void unfocus(Client *c, int setfocus);
+@@ -1719,6 +1720,13 @@ togglefloating(const Arg *arg)
+ arrange(selmon);
+ }
+
++void
++togglefullscr(const Arg *arg)
++{
++ if(selmon->sel)
++ setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
++}
++
+ void
+ toggletag(const Arg *arg)
+ {
+--
+2.17.1
+
diff --git a/local/src/src/fork/dwm/patches/dwm-grab-all-keycodes-6.2.diff b/local/src/src/fork/dwm/patches/dwm-grab-all-keycodes-6.2.diff
@@ -0,0 +1,57 @@
+From f64e5ddc9bc47dd3bca79a1eac214525ba005caf Mon Sep 17 00:00:00 2001
+From: Alexander Courtis <acourtis@atlassian.com>
+Date: Sat, 15 Feb 2020 14:23:26 +1100
+Subject: [PATCH] Grab all keycodes that map to keys.keysym
+
+There may be multiple keycodes that map to a keys.keysym. One such scenario is using xkb to remap a key: `caps:escape`
+
+When grabbing keys, we now scan all X keycode mappings and look for match.
+
+Changing keymaps via xkb or other means will not cause the keys to be "re-grabbed". This existing behaviour is desirable.
+
+---
+ dwm.c | 26 ++++++++++++++++++++------
+ 1 file changed, 20 insertions(+), 6 deletions(-)
+
+diff --git a/dwm.c b/dwm.c
+index cc4fce7..04f6220 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -1104,14 +1104,28 @@ grabkeys(void)
+ {
+ unsigned int i, j;
+ unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
+- KeyCode code;
++ int kc, kcmin, kcmax, kcper;
++ KeySym keysym, *keysyms;
+
+ XUngrabKey(dpy, AnyKey, AnyModifier, root);
+- for (i = 0; i < LENGTH(keys); i++)
+- if ((code = XKeysymToKeycode(dpy, keys[i].keysym)))
+- for (j = 0; j < LENGTH(modifiers); j++)
+- XGrabKey(dpy, code, keys[i].mod | modifiers[j], root,
+- True, GrabModeAsync, GrabModeAsync);
++
++ /* retrieve all the keycode -> keysym mappings */
++ XDisplayKeycodes(dpy, &kcmin, &kcmax);
++ keysyms = XGetKeyboardMapping(dpy, kcmin, kcmax - kcmin + 1, &kcper);
++
++ /* only look at the first keysym for each keycode as we handle shifted states */
++ for (kc = kcmin; kc <= kcmax; kc++) {
++ keysym = keysyms[(kc - kcmin) * kcper];
++ for (i = 0; i < LENGTH(keys); i++) {
++ if (keys[i].keysym == keysym) {
++ for (j = 0; j < LENGTH(modifiers); j++) {
++ XGrabKey(dpy, kc, keys[i].mod | modifiers[j], root, True, GrabModeAsync, GrabModeAsync);
++ }
++ }
++ }
++ }
++
++ XFree(keysyms);
+ }
+ }
+
+--
+2.25.0
+
diff --git a/local/src/src/fork/dwm/patches/dwm-noborderfloatingfix-6.2.diff b/local/src/src/fork/dwm/patches/dwm-noborderfloatingfix-6.2.diff
@@ -0,0 +1,31 @@
+From 700b0bdea872f4c00182b2bd925b41fe03f8d222 Mon Sep 17 00:00:00 2001
+From: Aidan Hall <aidan.hall@outlook.com>
+Date: Tue, 2 Jun 2020 14:41:53 +0000
+Subject: [PATCH] Prevents hiding the border if layout is floating.
+
+---
+ dwm.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/dwm.c b/dwm.c
+index 4465af1..2dd959d 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -1282,6 +1282,14 @@ resizeclient(Client *c, int x, int y, int w, int h)
+ c->oldw = c->w; c->w = wc.width = w;
+ c->oldh = c->h; c->h = wc.height = h;
+ wc.border_width = c->bw;
++ if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next))
++ || &monocle == c->mon->lt[c->mon->sellt]->arrange)
++ && !c->isfullscreen && !c->isfloating
++ && NULL != c->mon->lt[c->mon->sellt]->arrange) {
++ c->w = wc.width += c->bw * 2;
++ c->h = wc.height += c->bw * 2;
++ wc.border_width = 0;
++ }
+ XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
+ configure(c);
+ XSync(dpy, False);
+--
+2.26.2
+
diff --git a/local/src/src/fork/dwm/patches/openbsd.diff b/local/src/src/fork/dwm/patches/openbsd.diff
@@ -0,0 +1,20 @@
+--- config.mk.orig Sat Feb 5 15:25:41 2022
++++ config.mk Sat Feb 5 15:26:21 2022
+@@ -5,7 +5,7 @@ VERSION = 6.3
+
+ # paths
+ PREFIX = /usr/local
+-MANPREFIX = ${PREFIX}/share/man
++MANPREFIX = ${PREFIX}/man
+
+ X11INC = /usr/X11R6/include
+ X11LIB = /usr/X11R6/lib
+@@ -18,7 +18,7 @@ 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}