aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bashrc2
-rw-r--r--.repos/dwm/config.def.h2
-rw-r--r--.repos/dwm/config.h22
-rwxr-xr-x.repos/dwm/dwmbin66608 -> 70960 bytes
-rw-r--r--.repos/dwm/dwm.c.orig75
-rw-r--r--.repos/dwm/dwm.obin58920 -> 60824 bytes
-rw-r--r--.repos/dwm/horizgrid.c32
-rw-r--r--.repos/dwm/patches/attachbottom.diff60
-rw-r--r--.repos/dwm/patches/horizgrid.diff70
-rw-r--r--.repos/dwm/tcl.c74
-rwxr-xr-xbackup5
11 files changed, 330 insertions, 12 deletions
diff --git a/.bashrc b/.bashrc
index 71d3664..b0c7b20 100644
--- a/.bashrc
+++ b/.bashrc
@@ -28,5 +28,5 @@ export BROWSER='qutebrowser'
export EDITOR='nvim'
export TERM='st'
export TERMINAL='st'
-export PATH=$PATH:$HOME/.scripts
+export PATH=$PATH:$HOME/.scripts:$HOME/.sailfish/bin
export GITHUB_TOKEN="$(cat "$HOME"/.crypto/github)"
diff --git a/.repos/dwm/config.def.h b/.repos/dwm/config.def.h
index 4d90ff2..af302ba 100644
--- a/.repos/dwm/config.def.h
+++ b/.repos/dwm/config.def.h
@@ -36,11 +36,13 @@ static const float mfact = 0.55; /* factor of master area size [0.05..0.95]
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
+#include "horizgrid.c"
static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
+ { "###", horizgrid },
};
/* key definitions */
diff --git a/.repos/dwm/config.h b/.repos/dwm/config.h
index b218ea6..9ecb4fc 100644
--- a/.repos/dwm/config.h
+++ b/.repos/dwm/config.h
@@ -1,4 +1,6 @@
/* See LICENSE file for copyright and license details. */
+#include "horizgrid.c"
+#include "tcl.c"
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
@@ -40,13 +42,15 @@ static const Rule rules[] = {
/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
-static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
+static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
static const Layout layouts[] = {
/* symbol arrange function */
+ { "[G]", horizgrid },
{ "[T]", tile }, /* first entry is default */
{ "[F]", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
+ { "[3]", tcl },
};
/* key definitions */
@@ -70,27 +74,30 @@ static const char *lockcmd[] = { "slock", NULL };
static Key keys[] = {
/* modifier key function argument */
- { MODKEY, XK_d, spawn, {.v = dmenucmd } },
+ { MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ShiftMask, XK_b, spawn, {.v = browsercmd } },
{ MODKEY|ShiftMask, XK_s, spawn, {.v = musiccmd } },
{ MODKEY|ShiftMask, XK_l, spawn, {.v = lockcmd } },
+ { MODKEY|ShiftMask, XK_Return, zoom, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } },
{ MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } },
- // { MODKEY, XK_i, incnmaster, {.i = +1 } },
- // { MODKEY, XK_d, incnmaster, {.i = -1 } },
+ { MODKEY, XK_i, incnmaster, {.i = +1 } },
+ { MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY, XK_q, killclient, {0} },
- { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
- { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
- { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XK_g, setlayout, {.v = &layouts[0]} },
+ { MODKEY, XK_t, setlayout, {.v = &layouts[1]} },
+ { MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XK_m, setlayout, {.v = &layouts[3]} },
+ { MODKEY, XK_c, setlayout, {.v = &layouts[4]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
@@ -108,6 +115,7 @@ static Key keys[] = {
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
+
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};
diff --git a/.repos/dwm/dwm b/.repos/dwm/dwm
index b5eb427..3591ee2 100755
--- a/.repos/dwm/dwm
+++ b/.repos/dwm/dwm
Binary files differ
diff --git a/.repos/dwm/dwm.c.orig b/.repos/dwm/dwm.c.orig
index 685eca1..2fde0a9 100644
--- a/.repos/dwm/dwm.c.orig
+++ b/.repos/dwm/dwm.c.orig
@@ -147,6 +147,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 attachbelow(Client *c);
static void attachstack(Client *c);
static void buttonpress(XEvent *e);
static void checkotherwm(void);
@@ -163,6 +164,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);
@@ -192,6 +195,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);
@@ -407,6 +411,17 @@ attach(Client *c)
}
void
+attachbelow(Client *c)
+{
+ Client *below = c->mon->clients;
+ for (; below && below->next; below = below->next);
+ if (below)
+ below->next = c;
+ else
+ c->mon->clients = c;
+}
+
+void
attachstack(Client *c)
{
c->snext = c->mon->stack;
@@ -752,6 +767,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;
@@ -1062,7 +1099,7 @@ manage(Window w, XWindowAttributes *wa)
c->isfloating = c->oldstate = trans != None || c->isfixed;
if (c->isfloating)
XRaiseWindow(dpy, c->win);
- attach(c);
+ attachbelow(c);
attachstack(c);
XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
(unsigned char *) &(c->win), 1);
@@ -1377,6 +1414,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;
@@ -1424,7 +1493,7 @@ sendmon(Client *c, Monitor *m)
detachstack(c);
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
- attach(c);
+ attachbelow(c);
attachstack(c);
focus(NULL);
arrange(NULL);
@@ -1904,7 +1973,7 @@ updategeom(void)
m->clients = c->next;
detachstack(c);
c->mon = mons;
- attach(c);
+ attachbelow(c);
attachstack(c);
}
if (m == selmon)
diff --git a/.repos/dwm/dwm.o b/.repos/dwm/dwm.o
index 2b60050..fca3d9f 100644
--- a/.repos/dwm/dwm.o
+++ b/.repos/dwm/dwm.o
Binary files differ
diff --git a/.repos/dwm/horizgrid.c b/.repos/dwm/horizgrid.c
new file mode 100644
index 0000000..51ce0f8
--- /dev/null
+++ b/.repos/dwm/horizgrid.c
@@ -0,0 +1,32 @@
+void
+horizgrid(Monitor *m) {
+ Client *c;
+ unsigned int n, i;
+ int w = 0;
+ int ntop, nbottom = 0;
+
+ /* Count windows */
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+
+ if(n == 0)
+ return;
+ else if(n == 1) { /* Just fill the whole screen */
+ c = nexttiled(m->clients);
+ resize(c, m->wx, m->wy, m->ww - (2*c->bw), m->wh - (2*c->bw), False);
+ } else if(n == 2) { /* Split vertically */
+ w = m->ww / 2;
+ c = nexttiled(m->clients);
+ resize(c, m->wx, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False);
+ c = nexttiled(c->next);
+ resize(c, m->wx + w, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False);
+ } else {
+ ntop = n / 2;
+ nbottom = n - ntop;
+ for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
+ if(i < ntop)
+ resize(c, m->wx + i * m->ww / ntop, m->wy, m->ww / ntop - (2*c->bw), m->wh / 2 - (2*c->bw), False);
+ else
+ resize(c, m->wx + (i - ntop) * m->ww / nbottom, m->wy + m->wh / 2, m->ww / nbottom - (2*c->bw), m->wh / 2 - (2*c->bw), False);
+ }
+ }
+}
diff --git a/.repos/dwm/patches/attachbottom.diff b/.repos/dwm/patches/attachbottom.diff
new file mode 100644
index 0000000..71d092f
--- /dev/null
+++ b/.repos/dwm/patches/attachbottom.diff
@@ -0,0 +1,60 @@
+Binary files dwm/drw.o and dwm.patched/drw.o differ
+Binary files dwm/dwm and dwm.patched/dwm differ
+diff -ruN dwm/dwm.c dwm.patched/dwm.c
+--- dwm/dwm.c 2018-05-22 20:05:47.208417141 -0700
++++ dwm.patched/dwm.c 2018-06-20 15:08:07.380496725 -0700
+@@ -147,6 +147,7 @@
+ static void arrange(Monitor *m);
+ static void arrangemon(Monitor *m);
+ static void attach(Client *c);
++static void attachbelow(Client *c);
+ static void attachstack(Client *c);
+ static void buttonpress(XEvent *e);
+ static void checkotherwm(void);
+@@ -407,6 +408,17 @@
+ }
+
+ void
++attachbelow(Client *c)
++{
++ Client *below = c->mon->clients;
++ for (; below && below->next; below = below->next);
++ if (below)
++ below->next = c;
++ else
++ c->mon->clients = c;
++}
++
++void
+ attachstack(Client *c)
+ {
+ c->snext = c->mon->stack;
+@@ -1065,7 +1077,7 @@
+ c->isfloating = c->oldstate = trans != None || c->isfixed;
+ if (c->isfloating)
+ XRaiseWindow(dpy, c->win);
+- attach(c);
++ attachbelow(c);
+ attachstack(c);
+ XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
+ (unsigned char *) &(c->win), 1);
+@@ -1420,7 +1432,7 @@
+ detachstack(c);
+ c->mon = m;
+ c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
+- attach(c);
++ attachbelow(c);
+ attachstack(c);
+ focus(NULL);
+ arrange(NULL);
+@@ -1900,7 +1912,7 @@
+ m->clients = c->next;
+ detachstack(c);
+ c->mon = mons;
+- attach(c);
++ attachbelow(c);
+ attachstack(c);
+ }
+ if (m == selmon)
+Binary files dwm/dwm.o and dwm.patched/dwm.o differ
+Binary files dwm/util.o and dwm.patched/util.o differ
diff --git a/.repos/dwm/patches/horizgrid.diff b/.repos/dwm/patches/horizgrid.diff
new file mode 100644
index 0000000..0920cee
--- /dev/null
+++ b/.repos/dwm/patches/horizgrid.diff
@@ -0,0 +1,70 @@
+From 064e1d48631cd9b03f32b42d7be79677197ee42f Mon Sep 17 00:00:00 2001
+From: Marshall Mason <marshallmason3@gmail.com>
+Date: Mon, 9 Nov 2015 12:38:28 -0800
+Subject: [PATCH] Added horizgrid function
+
+---
+ config.def.h | 2 ++
+ horizgrid.c | 32 ++++++++++++++++++++++++++++++++
+ 2 files changed, 34 insertions(+)
+ create mode 100644 horizgrid.c
+
+diff --git a/config.def.h b/config.def.h
+index eaae8f3..c2ad519 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -36,11 +36,13 @@ static const float mfact = 0.55; /* factor of master area size [0.05..0.95]
+ static const int nmaster = 1; /* number of clients in master area */
+ static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
+
++#include "horizgrid.c"
+ static const Layout layouts[] = {
+ /* symbol arrange function */
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
++ { "###", horizgrid },
+ };
+
+ /* key definitions */
+diff --git a/horizgrid.c b/horizgrid.c
+new file mode 100644
+index 0000000..51ce0f8
+--- /dev/null
++++ b/horizgrid.c
+@@ -0,0 +1,32 @@
++void
++horizgrid(Monitor *m) {
++ Client *c;
++ unsigned int n, i;
++ int w = 0;
++ int ntop, nbottom = 0;
++
++ /* Count windows */
++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
++
++ if(n == 0)
++ return;
++ else if(n == 1) { /* Just fill the whole screen */
++ c = nexttiled(m->clients);
++ resize(c, m->wx, m->wy, m->ww - (2*c->bw), m->wh - (2*c->bw), False);
++ } else if(n == 2) { /* Split vertically */
++ w = m->ww / 2;
++ c = nexttiled(m->clients);
++ resize(c, m->wx, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False);
++ c = nexttiled(c->next);
++ resize(c, m->wx + w, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False);
++ } else {
++ ntop = n / 2;
++ nbottom = n - ntop;
++ for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
++ if(i < ntop)
++ resize(c, m->wx + i * m->ww / ntop, m->wy, m->ww / ntop - (2*c->bw), m->wh / 2 - (2*c->bw), False);
++ else
++ resize(c, m->wx + (i - ntop) * m->ww / nbottom, m->wy + m->wh / 2, m->ww / nbottom - (2*c->bw), m->wh / 2 - (2*c->bw), False);
++ }
++ }
++}
+--
+2.1.4
+
diff --git a/.repos/dwm/tcl.c b/.repos/dwm/tcl.c
new file mode 100644
index 0000000..4c94914
--- /dev/null
+++ b/.repos/dwm/tcl.c
@@ -0,0 +1,74 @@
+void
+tcl(Monitor * m)
+{
+ int x, y, h, w, mw, sw, bdw;
+ unsigned int i, n;
+ Client * c;
+
+ for (n = 0, c = nexttiled(m->clients); c;
+ c = nexttiled(c->next), n++);
+
+ if (n == 0)
+ return;
+
+ c = nexttiled(m->clients);
+
+ mw = m->mfact * m->ww;
+ sw = (m->ww - mw) / 2;
+ bdw = (2 * c->bw);
+ resize(c,
+ n < 3 ? m->wx : m->wx + sw,
+ m->wy,
+ n == 1 ? m->ww - bdw : mw - bdw,
+ m->wh - bdw,
+ False);
+
+ if (--n == 0)
+ return;
+
+ w = (m->ww - mw) / ((n > 1) + 1);
+ c = nexttiled(c->next);
+
+ if (n > 1)
+ {
+ x = m->wx + ((n > 1) ? mw + sw : mw);
+ y = m->wy;
+ h = m->wh / (n / 2);
+
+ if (h < bh)
+ h = m->wh;
+
+ for (i = 0; c && i < n / 2; c = nexttiled(c->next), i++)
+ {
+ resize(c,
+ x,
+ y,
+ w - bdw,
+ (i + 1 == n / 2) ? m->wy + m->wh - y - bdw : h - bdw,
+ False);
+
+ if (h != m->wh)
+ y = c->y + HEIGHT(c);
+ }
+ }
+
+ x = (n + 1 / 2) == 1 ? mw : m->wx;
+ y = m->wy;
+ h = m->wh / ((n + 1) / 2);
+
+ if (h < bh)
+ h = m->wh;
+
+ for (i = 0; c; c = nexttiled(c->next), i++)
+ {
+ resize(c,
+ x,
+ y,
+ (i + 1 == (n + 1) / 2) ? w - bdw : w - bdw,
+ (i + 1 == (n + 1) / 2) ? m->wy + m->wh - y - bdw : h - bdw,
+ False);
+
+ if (h != m->wh)
+ y = c->y + HEIGHT(c);
+ }
+}
diff --git a/backup b/backup
index 6de3a2e..75220f9 100755
--- a/backup
+++ b/backup
@@ -1,4 +1,7 @@
-#!/usr/bin/env sh
+#!/usr/bin/env bash
+
+rm -rf .config/ .repos/ .scripts/
+mkdir -p .config/{dunst,gtk-2.0,gtk-3.0,nvim,zathura,mpv} .repos
# Scripts
cp -r "$HOME"/.scripts/ .