summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksa Vučković <aleksav013@gmail.com>2021-06-14 02:00:29 +0200
committerAleksa Vuckovic <aleksa@vuckovic.cc>2023-12-06 05:05:49 +0100
commit40045f3f9e866fe64d55994cf63896cb990cdfaa (patch)
treeeb86ce440981d8b5776b81e1935bc5a45c08ee52
parent5719fb17a1d44c755e7be4849549f94466727005 (diff)
Moving to st
-rw-r--r--config.def.h6
-rw-r--r--dwm.c21
-rw-r--r--patches/dwm-hide_vacant_tags-6.2.diff55
3 files changed, 71 insertions, 11 deletions
diff --git a/config.def.h b/config.def.h
index 53fa262..6f3b2b4 100644
--- a/config.def.h
+++ b/config.def.h
@@ -19,7 +19,7 @@ static const unsigned int borderpx = 1; /* border pixel of 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 */
-static const char *fonts[] = { "xft:Inconsolata Nerd Font Mono:style=Bold:pixelsize=14:antialias=true" /*"Liberation Mono:size=10"*/ };
+static const char *fonts[] = { "monospace:size=10", "JoyPixels:pixelsize=10:antialias=true:autohint=true" };
static const char dmenufont[] = "monospace:size=10";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
@@ -72,7 +72,7 @@ static const Layout layouts[] = {
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
-static const char *termcmd[] = { "urxvt", NULL };
+static const char *termcmd[] = { "st", NULL };
static const Key keys[] = {
/* modifier key function argument */
@@ -115,7 +115,7 @@ static const Key keys[] = {
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("/usr/bin/pamixer -i 5;kill -44 $(pidof dwmblocks)") },
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("/usr/bin/xbacklight -inc 5;kill -40 $(pidof dwmblocks)") },
{ 0, XF86XK_MonBrightnessDown, spawn, SHCMD("/usr/bin/xbacklight -dec 5;kill -40 $(pidof dwmblocks)") },
- { 0, XK_Print, spawn, SHCMD("scrot -e 'mv $f ~/Screenshots/'") },
+ { 0, XK_Print, spawn, SHCMD("scrot -e 'mv $f ~/Pictures/Screenshots/'") },
};
diff --git a/dwm.c b/dwm.c
index f1d86b2..9830ba5 100644
--- a/dwm.c
+++ b/dwm.c
@@ -418,7 +418,7 @@ attachstack(Client *c)
void
buttonpress(XEvent *e)
{
- unsigned int i, x, click;
+ unsigned int i, x, click, occ = 0;
Arg arg = {0};
Client *c;
Monitor *m;
@@ -433,9 +433,14 @@ buttonpress(XEvent *e)
}
if (ev->window == selmon->barwin) {
i = x = 0;
- do
+ for (c = m->clients; c; c = c->next)
+ occ |= c->tags == 255 ? 0 : c->tags;
+ do {
+ /* do not reserve space for vacant tags */
+ if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
+ continue;
x += TEXTW(tags[i]);
- while (ev->x >= x && ++i < LENGTH(tags));
+ } while (ev->x >= x && ++i < LENGTH(tags));
if (i < LENGTH(tags)) {
click = ClkTagBar;
arg.ui = 1 << i;
@@ -715,19 +720,19 @@ drawbar(Monitor *m)
}
for (c = m->clients; c; c = c->next) {
- occ |= c->tags;
+ occ |= c->tags == 255 ? 0 : c->tags;
if (c->isurgent)
urg |= c->tags;
}
x = 0;
for (i = 0; i < LENGTH(tags); i++) {
+ /* do not draw vacant tags */
+ if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
+ continue;
+
w = TEXTW(tags[i]);
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
- if (occ & 1 << i)
- drw_rect(drw, x + boxs, boxs, boxw, boxw,
- m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
- urg & 1 << i);
x += w;
}
w = TEXTW(m->ltsymbol);
diff --git a/patches/dwm-hide_vacant_tags-6.2.diff b/patches/dwm-hide_vacant_tags-6.2.diff
new file mode 100644
index 0000000..a981b23
--- /dev/null
+++ b/patches/dwm-hide_vacant_tags-6.2.diff
@@ -0,0 +1,55 @@
+diff --git a/dwm.c b/dwm.c
+index 4465af1..c4aa3de 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -416,7 +416,7 @@ attachstack(Client *c)
+ void
+ buttonpress(XEvent *e)
+ {
+- unsigned int i, x, click;
++ unsigned int i, x, click, occ = 0;
+ Arg arg = {0};
+ Client *c;
+ Monitor *m;
+@@ -431,9 +431,14 @@ buttonpress(XEvent *e)
+ }
+ if (ev->window == selmon->barwin) {
+ i = x = 0;
+- do
++ for (c = m->clients; c; c = c->next)
++ occ |= c->tags == 255 ? 0 : c->tags;
++ do {
++ /* do not reserve space for vacant tags */
++ if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
++ continue;
+ x += TEXTW(tags[i]);
+- while (ev->x >= x && ++i < LENGTH(tags));
++ } while (ev->x >= x && ++i < LENGTH(tags));
+ if (i < LENGTH(tags)) {
+ click = ClkTagBar;
+ arg.ui = 1 << i;
+@@ -709,19 +714,19 @@ drawbar(Monitor *m)
+ }
+
+ for (c = m->clients; c; c = c->next) {
+- occ |= c->tags;
++ occ |= c->tags == 255 ? 0 : c->tags;
+ if (c->isurgent)
+ urg |= c->tags;
+ }
+ x = 0;
+ for (i = 0; i < LENGTH(tags); i++) {
++ /* do not draw vacant tags */
++ if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
++ continue;
++
+ w = TEXTW(tags[i]);
+ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
+ drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
+- if (occ & 1 << i)
+- drw_rect(drw, x + boxs, boxs, boxw, boxw,
+- m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
+- urg & 1 << i);
+ x += w;
+ }
+ w = blw = TEXTW(m->ltsymbol);