summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstkhan <personal@slickd.xyz>2021-05-19 17:18:07 -0500
committerstkhan <personal@slickd.xyz>2021-05-19 17:18:07 -0500
commit60f1e650a996c95ab937627096300503cfd90292 (patch)
treeb547509fe650947fa2627dcec46ab4a202d0e221
parent412fa23b2db9d2a74097a3c3cb8ba885dbc3e1a0 (diff)
Made installation script quiet, and added purple theme
-rwxr-xr-xdwm-6.2/dwmbin72024 -> 72056 bytes
-rw-r--r--dwm-6.2/dwm-attachabove-6.2-20200421.diff60
-rw-r--r--dwm-6.2/dwm.c21
-rw-r--r--dwm-6.2/dwm.c.orig150
-rw-r--r--dwm-6.2/dwm.obin63072 -> 63192 bytes
-rwxr-xr-xetc/clean2
-rw-r--r--etc/purple.wallpaper.jpgbin0 -> 1570213 bytes
-rwxr-xr-xinstall.sh12
-rw-r--r--themes/theme.h2
-rw-r--r--themes/themes/purple16
10 files changed, 243 insertions, 20 deletions
diff --git a/dwm-6.2/dwm b/dwm-6.2/dwm
index 5695bb0..a73f24f 100755
--- a/dwm-6.2/dwm
+++ b/dwm-6.2/dwm
Binary files differ
diff --git a/dwm-6.2/dwm-attachabove-6.2-20200421.diff b/dwm-6.2/dwm-attachabove-6.2-20200421.diff
new file mode 100644
index 0000000..198f293
--- /dev/null
+++ b/dwm-6.2/dwm-attachabove-6.2-20200421.diff
@@ -0,0 +1,60 @@
+diff --git a/local/src/dwm/dwm.c b/local/src/dwm/dwm.c
+index 83e44e0..94392b4 100644
+--- a/local/src/dwm/dwm.c
++++ b/local/src/dwm/dwm.c
+@@ -164,6 +164,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 attachabove(Client *c);
+ static void attachstack(Client *c);
+ static void buttonpress(XEvent *e);
+ static void checkotherwm(void);
+@@ -431,6 +432,20 @@ attach(Client *c)
+ c->mon->clients = c;
+ }
+
++void
++attachabove(Client *c)
++{
++ if (c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) {
++ attach(c);
++ return;
++ }
++
++ Client *at;
++ for (at = c->mon->clients; at->next != c->mon->sel; at = at->next);
++ c->next = at->next;
++ at->next = c;
++}
++
+ void
+ attachstack(Client *c)
+ {
+@@ -1272,7 +1287,7 @@ manage(Window w, XWindowAttributes *wa)
+ c->isfloating = c->oldstate = trans != None || c->isfixed;
+ if (c->isfloating)
+ XRaiseWindow(dpy, c->win);
+- attach(c);
++ attachabove(c);
+ attachstack(c);
+ XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
+ (unsigned char *) &(c->win), 1);
+@@ -1633,7 +1648,7 @@ sendmon(Client *c, Monitor *m)
+ detachstack(c);
+ c->mon = m;
+ c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
+- attach(c);
++ attachabove(c);
+ attachstack(c);
+ focus(NULL);
+ arrange(NULL);
+@@ -2122,7 +2137,7 @@ updategeom(void)
+ m->clients = c->next;
+ detachstack(c);
+ c->mon = mons;
+- attach(c);
++ attachabove(c);
+ attachstack(c);
+ }
+ if (m == selmon)
diff --git a/dwm-6.2/dwm.c b/dwm-6.2/dwm.c
index 520b818..f788759 100644
--- a/dwm-6.2/dwm.c
+++ b/dwm-6.2/dwm.c
@@ -152,6 +152,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 attachabove(Client *c);
static void attachstack(Client *c);
static void buttonpress(XEvent *e);
static void checkotherwm(void);
@@ -428,6 +429,20 @@ attach(Client *c)
}
void
+attachabove(Client *c)
+{
+ if (c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) {
+ attach(c);
+ return;
+ }
+
+ Client *at;
+ for (at = c->mon->clients; at->next != c->mon->sel; at = at->next);
+ c->next = at->next;
+ at->next = c;
+}
+
+void
attachstack(Client *c)
{
c->snext = c->mon->stack;
@@ -1087,7 +1102,7 @@ manage(Window w, XWindowAttributes *wa)
c->isfloating = c->oldstate = trans != None || c->isfixed;
if (c->isfloating)
XRaiseWindow(dpy, c->win);
- attach(c);
+ attachabove(c);
attachstack(c);
XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
(unsigned char *) &(c->win), 1);
@@ -1519,7 +1534,7 @@ sendmon(Client *c, Monitor *m)
detachstack(c);
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
- attach(c);
+ attachabove(c);
attachstack(c);
focus(NULL);
arrange(NULL);
@@ -2110,7 +2125,7 @@ updategeom(void)
m->clients = c->next;
detachstack(c);
c->mon = mons;
- attach(c);
+ attachabove(c);
attachstack(c);
}
if (m == selmon)
diff --git a/dwm-6.2/dwm.c.orig b/dwm-6.2/dwm.c.orig
index d7cd75c..520b818 100644
--- a/dwm-6.2/dwm.c.orig
+++ b/dwm-6.2/dwm.c.orig
@@ -120,6 +120,10 @@ struct Monitor {
int by; /* bar geometry */
int mx, my, mw, mh; /* screen size */
int wx, wy, ww, wh; /* window area */
+ int gappih; /* horizontal gap between windows */
+ int gappiv; /* vertical gap between windows */
+ int gappoh; /* horizontal outer gaps */
+ int gappov; /* vertical outer gaps */
unsigned int seltags;
unsigned int sellt;
unsigned int tagset[2];
@@ -201,6 +205,16 @@ static void sendmon(Client *c, Monitor *m);
static void setclientstate(Client *c, long state);
static void setfocus(Client *c);
static void setfullscreen(Client *c, int fullscreen);
+static void setgaps(int oh, int ov, int ih, int iv);
+static void incrgaps(const Arg *arg);
+static void incrigaps(const Arg *arg);
+static void incrogaps(const Arg *arg);
+static void incrohgaps(const Arg *arg);
+static void incrovgaps(const Arg *arg);
+static void incrihgaps(const Arg *arg);
+static void incrivgaps(const Arg *arg);
+static void togglegaps(const Arg *arg);
+static void defaultgaps(const Arg *arg);
static void setlayout(const Arg *arg);
static void setmfact(const Arg *arg);
static void setup(void);
@@ -246,6 +260,7 @@ static char stext[256];
static int screen;
static int sw, sh; /* X display screen geometry width, height */
static int bh, blw = 0; /* bar geometry */
+static int enablegaps = 1; /* enables gaps, used by togglegaps */
static int lrpad; /* sum of left and right padding for text */
static int (*xerrorxlib)(Display *, XErrorEvent *);
static unsigned int numlockmask = 0;
@@ -644,6 +659,10 @@ createmon(void)
m->nmaster = nmaster;
m->showbar = showbar;
m->topbar = topbar;
+ m->gappih = gappih;
+ m->gappiv = gappiv;
+ m->gappoh = gappoh;
+ m->gappov = gappov;
m->lt[0] = &layouts[0];
m->lt[1] = &layouts[1 % LENGTH(layouts)];
strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
@@ -1581,6 +1600,111 @@ setfullscreen(Client *c, int fullscreen)
}
void
+setgaps(int oh, int ov, int ih, int iv)
+{
+ if (oh < 0) oh = 0;
+ if (ov < 0) ov = 0;
+ if (ih < 0) ih = 0;
+ if (iv < 0) iv = 0;
+
+ selmon->gappoh = oh;
+ selmon->gappov = ov;
+ selmon->gappih = ih;
+ selmon->gappiv = iv;
+ arrange(selmon);
+}
+
+void
+togglegaps(const Arg *arg)
+{
+ enablegaps = !enablegaps;
+ arrange(selmon);
+}
+
+void
+defaultgaps(const Arg *arg)
+{
+ setgaps(gappoh, gappov, gappih, gappiv);
+}
+
+void
+incrgaps(const Arg *arg)
+{
+ setgaps(
+ selmon->gappoh + arg->i,
+ selmon->gappov + arg->i,
+ selmon->gappih + arg->i,
+ selmon->gappiv + arg->i
+ );
+}
+
+void
+incrigaps(const Arg *arg)
+{
+ setgaps(
+ selmon->gappoh,
+ selmon->gappov,
+ selmon->gappih + arg->i,
+ selmon->gappiv + arg->i
+ );
+}
+
+void
+incrogaps(const Arg *arg)
+{
+ setgaps(
+ selmon->gappoh + arg->i,
+ selmon->gappov + arg->i,
+ selmon->gappih,
+ selmon->gappiv
+ );
+}
+
+void
+incrohgaps(const Arg *arg)
+{
+ setgaps(
+ selmon->gappoh + arg->i,
+ selmon->gappov,
+ selmon->gappih,
+ selmon->gappiv
+ );
+}
+
+void
+incrovgaps(const Arg *arg)
+{
+ setgaps(
+ selmon->gappoh,
+ selmon->gappov + arg->i,
+ selmon->gappih,
+ selmon->gappiv
+ );
+}
+
+void
+incrihgaps(const Arg *arg)
+{
+ setgaps(
+ selmon->gappoh,
+ selmon->gappov,
+ selmon->gappih + arg->i,
+ selmon->gappiv
+ );
+}
+
+void
+incrivgaps(const Arg *arg)
+{
+ setgaps(
+ selmon->gappoh,
+ selmon->gappov,
+ selmon->gappih,
+ selmon->gappiv + arg->i
+ );
+}
+
+void
setlayout(const Arg *arg)
{
if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
@@ -1756,26 +1880,32 @@ tagmon(const Arg *arg)
void
tile(Monitor *m)
{
- unsigned int i, n, h, mw, my, ty;
+ unsigned int i, n, h, r, oe = enablegaps, ie = enablegaps, mw, my, ty;
Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
if (n == 0)
return;
+ if (smartgaps == n) {
+ oe = 0; // outer gaps disabled
+ }
+
if (n > m->nmaster)
- mw = m->nmaster ? m->ww * m->mfact : 0;
+ mw = m->nmaster ? (m->ww + m->gappiv*ie) * m->mfact : 0;
else
- mw = m->ww;
- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ mw = m->ww - 2*m->gappov*oe + m->gappiv*ie;
+ for (i = 0, my = ty = m->gappoh*oe, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
if (i < m->nmaster) {
- h = (m->wh - my) / (MIN(n, m->nmaster) - i);
- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0);
- my += HEIGHT(c);
+ r = MIN(n, m->nmaster) - i;
+ h = (m->wh - my - m->gappoh*oe - m->gappih*ie * (r - 1)) / r;
+ resize(c, m->wx + m->gappov*oe, m->wy + my, mw - (2*c->bw) - m->gappiv*ie, h - (2*c->bw), 0);
+ my += HEIGHT(c) + m->gappih*ie;
} else {
- h = (m->wh - ty) / (n - i);
- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0);
- ty += HEIGHT(c);
+ r = n - i;
+ h = (m->wh - ty - m->gappoh*oe - m->gappih*ie * (r - 1)) / r;
+ resize(c, m->wx + mw + m->gappov*oe, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappov*oe, h - (2*c->bw), 0);
+ ty += HEIGHT(c) + m->gappih*ie;
}
}
diff --git a/dwm-6.2/dwm.o b/dwm-6.2/dwm.o
index fe04c71..7802266 100644
--- a/dwm-6.2/dwm.o
+++ b/dwm-6.2/dwm.o
Binary files differ
diff --git a/etc/clean b/etc/clean
index 4236ecf..6cf362c 100755
--- a/etc/clean
+++ b/etc/clean
@@ -5,3 +5,5 @@ sudo rm -r ~/.config/sarc
sudo rm /usr/local/bin/dm*
sudo rm /usr/local/bin/dwm*
sudo rm /usr/local/bin/st*
+rm ~/.xinitrc
+
diff --git a/etc/purple.wallpaper.jpg b/etc/purple.wallpaper.jpg
new file mode 100644
index 0000000..f0e89e8
--- /dev/null
+++ b/etc/purple.wallpaper.jpg
Binary files differ
diff --git a/install.sh b/install.sh
index 29d47f8..a930f00 100755
--- a/install.sh
+++ b/install.sh
@@ -21,16 +21,16 @@ cp themes/themes/$theme themes/theme.h
cd $dwm
rm config.h
make clean
-make
-sudo make install
+make -s
+sudo make -s install
cd ../$st
-make
-sudo make install
+make -s
+sudo make -s install
cd ../$dmenu
-make
-sudo make install
+make -s
+sudo make -s install
cd ..
mkdir -p ~/.config/sarc
diff --git a/themes/theme.h b/themes/theme.h
index dfca57e..162087c 100644
--- a/themes/theme.h
+++ b/themes/theme.h
@@ -6,7 +6,7 @@
/* primary color */
-static const char col_cyan[] = "#0a0063";
+static const char col_cyan[] = "#8c0180";
/* secondary colors */
diff --git a/themes/themes/purple b/themes/themes/purple
new file mode 100644
index 0000000..162087c
--- /dev/null
+++ b/themes/themes/purple
@@ -0,0 +1,16 @@
+/* Sarc config file */
+
+/*
+ * DWM CONFIGURATION
+*/
+
+/* primary color */
+
+static const char col_cyan[] = "#8c0180";
+
+/* secondary colors */
+
+static const char col_gray1[] = "#222222";
+static const char col_gray2[] = "#444444";
+static const char col_gray3[] = "#bbbbbb";
+static const char col_gray4[] = "#eeeeee";