summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Francois Chevrette2020-03-28 18:25:48 -0400
committerJean-Francois Chevrette2020-03-28 18:25:48 -0400
commitc60117e83efbbb05b021436c9d9cf5dda72554bb (patch)
tree1e08b5dc353f469c40650d9089055da759878d84
parent06f8b53f4b76b52bc8028067b8b6e5dcbfd118a7 (diff)
downloadaur-dwm-jfchevrette.tar.gz
add patches
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD37
-rw-r--r--config.h4
-rw-r--r--dwm-rotatestack-20161021-ab9571b.diff102
-rw-r--r--dwm-uselessgap-6.2.diff81
5 files changed, 215 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index fc40c178624a..499d631bc3d1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -20,10 +20,14 @@ pkgbase = dwm-jfchevrette
source = config.h
source = dwm.desktop
source = dwm-attachaside-6.1.diff
+ source = dwm-rotatestack-20161021-ab9571b.diff
+ source = dwm-uselessgap-6.2.diff
sha256sums = 97902e2e007aaeaa3c6e3bed1f81785b817b7413947f1db1d3b62b8da4cd110e
- sha256sums = ce156c4ff6be6f664f5c1eb41e8ae8228c15d0282410be3ecdd58598bb8867d2
+ sha256sums = 1aa35c0d21fc32263b3eb484df76b5cc883255201c817dfc3c89f3e4266e8295
sha256sums = bc36426772e1471d6dd8c8aed91f288e16949e3463a9933fee6390ee0ccd3f81
sha256sums = 86bdb4291c0f8f9b0c6fbbac9f05403224872b786fc5e74f3b141c8f2ce6c7a1
+ sha256sums = 27c889d424e1b539cd8b113d0c4f9693be521a0a2ef5adf246ecf3efb4208f3c
+ sha256sums = 5667251372a5f3e8f297a2b458637ead9627f608b8e86e7a517baf791106a237
pkgname = dwm-jfchevrette
diff --git a/PKGBUILD b/PKGBUILD
index 8c439ad12c98..4490d757f0d5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,7 @@
# Maintainer: Jean-Francois Chevrette <jfchevrette@gmail.com>
pkgname=dwm-jfchevrette
+_pkgname=dwm
pkgver=6.2
pkgrel=1
pkgdesc="A dynamic window manager for X"
@@ -12,32 +13,40 @@ depends=('libx11' 'libxinerama' 'libxft' 'freetype2' 'st' 'dmenu')
provides=(dwm)
conflicts=(dwm)
install=dwm.install
-source=(http://dl.suckless.org/dwm/dwm-$pkgver.tar.gz
- config.h
- dwm.desktop
- dwm-attachaside-6.1.diff)
+source=(http://dl.suckless.org/dwm/dwm-${pkgver}.tar.gz
+ config.h
+ dwm.desktop
+ dwm-attachaside-6.1.diff
+ dwm-rotatestack-20161021-ab9571b.diff
+ dwm-uselessgap-6.2.diff)
sha256sums=('97902e2e007aaeaa3c6e3bed1f81785b817b7413947f1db1d3b62b8da4cd110e'
- 'ce156c4ff6be6f664f5c1eb41e8ae8228c15d0282410be3ecdd58598bb8867d2'
+ '1aa35c0d21fc32263b3eb484df76b5cc883255201c817dfc3c89f3e4266e8295'
'bc36426772e1471d6dd8c8aed91f288e16949e3463a9933fee6390ee0ccd3f81'
- '86bdb4291c0f8f9b0c6fbbac9f05403224872b786fc5e74f3b141c8f2ce6c7a1')
+ '86bdb4291c0f8f9b0c6fbbac9f05403224872b786fc5e74f3b141c8f2ce6c7a1'
+ '27c889d424e1b539cd8b113d0c4f9693be521a0a2ef5adf246ecf3efb4208f3c'
+ '5667251372a5f3e8f297a2b458637ead9627f608b8e86e7a517baf791106a237')
prepare() {
- cd "$srcdir/$pkgname-$pkgver"
- cp "$srcdir/config.h" config.h
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ cp "${srcdir}/config.h" config.h
# https://dwm.suckless.org/patches/attachaside/
- patch -p1 < "$srcdir/dwm-attachaside-6.1.diff"
+ patch -p1 < "${srcdir}/dwm-attachaside-6.1.diff"
+ # https://dwm.suckless.org/patches/rotatestack/
+ patch -p1 < "${srcdir}/dwm-rotatestack-20161021-ab9571b.diff"
+ # https://dwm.suckless.org/patches/uselessgap/
+ patch -p1 < "${srcdir}/dwm-uselessgap-6.2.diff"
}
build() {
- cd "$srcdir/$pkgname-$pkgver"
+ cd "${srcdir}/${_pkgname}-${pkgver}"
make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11 FREETYPEINC=/usr/include/freetype2
}
package() {
- cd "$srcdir/$pkgname-$pkgver"
+ cd "${srcdir}/${_pkgname}-${pkgver}"
make PREFIX=/usr DESTDIR="$pkgdir" install
- install -m644 -D LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- install -m644 -D README "$pkgdir/usr/share/doc/$pkgname/README"
- install -m644 -D "$srcdir/dwm.desktop" "$pkgdir/usr/share/xsessions/dwm.desktop"
+ install -m644 -D LICENSE "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE"
+ install -m644 -D README "$pkgdir/usr/share/doc/${_pkgname}/README"
+ install -m644 -D "${srcdir}/dwm.desktop" "$pkgdir/usr/share/xsessions/dwm.desktop"
}
diff --git a/config.h b/config.h
index 1c0b587bda10..2170f47a78e0 100644
--- a/config.h
+++ b/config.h
@@ -18,6 +18,9 @@ static const char *colors[][3] = {
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
};
+/* gaps */
+static const unsigned int gappx = 6; /* gap pixel between windows */
+
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
@@ -76,6 +79,7 @@ static Key keys[] = {
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XK_r, rotatestack, {0} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
diff --git a/dwm-rotatestack-20161021-ab9571b.diff b/dwm-rotatestack-20161021-ab9571b.diff
new file mode 100644
index 000000000000..ed74c6dce48e
--- /dev/null
+++ b/dwm-rotatestack-20161021-ab9571b.diff
@@ -0,0 +1,102 @@
+diff --git a/config.def.h b/config.def.h
+index fd77a07..09737d7 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -64,6 +64,8 @@ static Key keys[] = {
+ { MODKEY, XK_p, spawn, {.v = dmenucmd } },
+ { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
+ { MODKEY, XK_b, togglebar, {0} },
++ { MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } },
++ { MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } },
+ { MODKEY, XK_j, focusstack, {.i = +1 } },
+ { MODKEY, XK_k, focusstack, {.i = -1 } },
+ { MODKEY, XK_i, incnmaster, {.i = +1 } },
+diff --git a/dwm.c b/dwm.c
+index 421bf27..1ec8b10 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -165,6 +165,8 @@ static void detachstack(Client *c);
+ static Monitor *dirtomon(int dir);
+ static void drawbar(Monitor *m);
+ static void drawbars(void);
++static void enqueue(Client *c);
++static void enqueuestack(Client *c);
+ static void enternotify(XEvent *e);
+ static void expose(XEvent *e);
+ static void focus(Client *c);
+@@ -194,6 +196,7 @@ static void resize(Client *c, int x, int y, int w, int h, int interact);
+ static void resizeclient(Client *c, int x, int y, int w, int h);
+ static void resizemouse(const Arg *arg);
+ static void restack(Monitor *m);
++static void rotatestack(const Arg *arg);
+ static void run(void);
+ static void scan(void);
+ static int sendevent(Client *c, Atom proto);
+@@ -765,6 +768,28 @@ drawbars(void)
+ }
+
+ void
++enqueue(Client *c)
++{
++ Client *l;
++ for (l = c->mon->clients; l && l->next; l = l->next);
++ if (l) {
++ l->next = c;
++ c->next = NULL;
++ }
++}
++
++void
++enqueuestack(Client *c)
++{
++ Client *l;
++ for (l = c->mon->stack; l && l->snext; l = l->snext);
++ if (l) {
++ l->snext = c;
++ c->snext = NULL;
++ }
++}
++
++void
+ enternotify(XEvent *e)
+ {
+ Client *c;
+@@ -1390,6 +1415,38 @@ restack(Monitor *m)
+ }
+
+ void
++rotatestack(const Arg *arg)
++{
++ Client *c = NULL, *f;
++
++ if (!selmon->sel)
++ return;
++ f = selmon->sel;
++ if (arg->i > 0) {
++ for (c = nexttiled(selmon->clients); c && nexttiled(c->next); c = nexttiled(c->next));
++ if (c){
++ detach(c);
++ attach(c);
++ detachstack(c);
++ attachstack(c);
++ }
++ } else {
++ if ((c = nexttiled(selmon->clients))){
++ detach(c);
++ enqueue(c);
++ detachstack(c);
++ enqueuestack(c);
++ }
++ }
++ if (c){
++ arrange(selmon);
++ //unfocus(f, 1);
++ focus(f);
++ restack(selmon);
++ }
++}
++
++void
+ run(void)
+ {
+ XEvent ev;
diff --git a/dwm-uselessgap-6.2.diff b/dwm-uselessgap-6.2.diff
new file mode 100644
index 000000000000..d9cacbecb6d1
--- /dev/null
+++ b/dwm-uselessgap-6.2.diff
@@ -0,0 +1,81 @@
+From 58a5ece9406ca6c90dc362617c065e4aac19417f Mon Sep 17 00:00:00 2001
+From: Cyril Cressent <cyril@cressent.org>
+Date: Wed, 3 Jul 2019 21:33:45 -0700
+Subject: [PATCH] Port the uselessgap patch to 6.2
+
+---
+ config.def.h | 1 +
+ dwm.c | 36 ++++++++++++++++++++++++++++++------
+ 2 files changed, 31 insertions(+), 6 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..b11471d 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -2,6 +2,7 @@
+
+ /* appearance */
+ static const unsigned int borderpx = 1; /* border pixel of windows */
++static const unsigned int gappx = 6; /* gaps between windows */
+ static const unsigned int snap = 32; /* snap pixel */
+ static const int showbar = 1; /* 0 means no bar */
+ static const int topbar = 1; /* 0 means bottom bar */
+diff --git a/dwm.c b/dwm.c
+index 4465af1..4545e05 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -52,8 +52,8 @@
+ #define ISVISIBLE(C) ((C->tags & 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)
+-#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
++#define WIDTH(X) ((X)->w + 2 * (X)->bw + gappx)
++#define HEIGHT(X) ((X)->h + 2 * (X)->bw + gappx)
+ #define TAGMASK ((1 << LENGTH(tags)) - 1)
+ #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
+
+@@ -1276,12 +1276,36 @@ void
+ resizeclient(Client *c, int x, int y, int w, int h)
+ {
+ XWindowChanges wc;
++ unsigned int n;
++ unsigned int gapoffset;
++ unsigned int gapincr;
++ Client *nbc;
+
+- c->oldx = c->x; c->x = wc.x = x;
+- c->oldy = c->y; c->y = wc.y = y;
+- c->oldw = c->w; c->w = wc.width = w;
+- c->oldh = c->h; c->h = wc.height = h;
+ wc.border_width = c->bw;
++
++ /* Get number of clients for the selected monitor */
++ for (n = 0, nbc = nexttiled(selmon->clients); nbc; nbc = nexttiled(nbc->next), n++);
++
++ /* Do nothing if layout is floating */
++ if (c->isfloating || selmon->lt[selmon->sellt]->arrange == NULL) {
++ gapincr = gapoffset = 0;
++ } else {
++ /* Remove border and gap if layout is monocle or only one client */
++ if (selmon->lt[selmon->sellt]->arrange == monocle || n == 1) {
++ gapoffset = 0;
++ gapincr = -2 * borderpx;
++ wc.border_width = 0;
++ } else {
++ gapoffset = gappx;
++ gapincr = 2 * gappx;
++ }
++ }
++
++ c->oldx = c->x; c->x = wc.x = x + gapoffset;
++ c->oldy = c->y; c->y = wc.y = y + gapoffset;
++ c->oldw = c->w; c->w = wc.width = w - gapincr;
++ c->oldh = c->h; c->h = wc.height = h - gapincr;
++
+ XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
+ configure(c);
+ XSync(dpy, False);
+--
+2.22.0
+