No, I want unused tags hidden.
This commit is contained in:
parent
4508f38520
commit
dc9d5df7e4
4 changed files with 121 additions and 63 deletions
|
@ -13,5 +13,5 @@ for battery in /sys/class/power_supply/BAT?*; do
|
||||||
esac
|
esac
|
||||||
capacity=$(cat "$battery/capacity")
|
capacity=$(cat "$battery/capacity")
|
||||||
# Will make a warn variable if discharging and low
|
# Will make a warn variable if discharging and low
|
||||||
[ "$capacity" -le 20 ] && printf "\ue19c ^c#161616^^b#fd4285^${capacity}%%^d^" || printf "${status} ${capacity}%%"
|
[ "$capacity" -le 20 ] && printf "^c#161616^^b#fd4285^\ue19c ${capacity}%%^d^" || printf "${status} ${capacity}%%"
|
||||||
done && exit 0
|
done && exit 0
|
||||||
|
|
|
@ -39,7 +39,7 @@ static Sp scratchpads[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* tagging */
|
/* tagging */
|
||||||
static const char *tags[] = {"\ue9ef", "\ue894", "\ue0c9", "\ue0e1", "\ue3fe", "\ue3ff", "\ue943", "\uea67" };
|
static const char *tags[] = {"\ue9ef", "\ue894", "\ue0c9", "\ue0e1", "\ue3fe", "\ue3ff", "7", "8", "\ue943", "\uea67" };
|
||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
/* xprop(1):
|
/* xprop(1):
|
||||||
|
@ -54,7 +54,7 @@ static const Rule rules[] = {
|
||||||
{ "Thunderbird", NULL, NULL, 1 << 3, 0, 0, 0, -1 },
|
{ "Thunderbird", NULL, NULL, 1 << 3, 0, 0, 0, -1 },
|
||||||
{ "Wfica", NULL, NULL, 1 << 9, 0, 0, 0, -1 },
|
{ "Wfica", NULL, NULL, 1 << 9, 0, 0, 0, -1 },
|
||||||
{ "Pavucontrol", NULL, NULL, 0, 1, 0, 0, -1 },
|
{ "Pavucontrol", NULL, NULL, 0, 1, 0, 0, -1 },
|
||||||
{ NULL, NULL, "Citrix Workspace", 1 << 6, 0, 0, 0, -1 },
|
{ NULL, NULL, "Citrix Workspace", 1 << 8, 0, 0, 0, -1 },
|
||||||
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
|
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
|
||||||
{ NULL, "spterm", NULL, SPTAG(0), 1, 1, 0, -1 },
|
{ NULL, "spterm", NULL, SPTAG(0), 1, 1, 0, -1 },
|
||||||
{ NULL, "spfile", NULL, SPTAG(1), 1, 1, 0, -1 },
|
{ NULL, "spfile", NULL, SPTAG(1), 1, 1, 0, -1 },
|
||||||
|
@ -95,56 +95,56 @@ static const char *termcmd[] = { "st", NULL };
|
||||||
static Key keys[] = {
|
static Key keys[] = {
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
TAGKEYS( XK_1, 0)
|
TAGKEYS( XK_1, 0)
|
||||||
TAGKEYS( XK_2, 1)
|
TAGKEYS( XK_2, 1)
|
||||||
TAGKEYS( XK_3, 2)
|
TAGKEYS( XK_3, 2)
|
||||||
TAGKEYS( XK_4, 3)
|
TAGKEYS( XK_4, 3)
|
||||||
TAGKEYS( XK_5, 4)
|
TAGKEYS( XK_5, 4)
|
||||||
TAGKEYS( XK_6, 5)
|
TAGKEYS( XK_6, 5)
|
||||||
TAGKEYS( XK_7, 6)
|
TAGKEYS( XK_7, 6)
|
||||||
TAGKEYS( XK_8, 7)
|
TAGKEYS( XK_8, 7)
|
||||||
TAGKEYS( XK_9, 8)
|
TAGKEYS( XK_9, 8)
|
||||||
TAGKEYS( XK_0, 9)
|
TAGKEYS( XK_0, 9)
|
||||||
/* apps n'shit */
|
/* apps n'shit */
|
||||||
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
|
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
|
||||||
{ MODKEY, XK_space, spawn, SHCMD("rofi -show run -i") },
|
{ MODKEY, XK_space, spawn, SHCMD("rofi -show run -i") },
|
||||||
{ MODKEY, XK_i, spawn, SHCMD("scrot --select 'scrot_%Y-%m-%d_%H-%M-%S_%s.png'") },
|
{ MODKEY, XK_i, spawn, SHCMD("scrot --select 'scrot_%Y-%m-%d_%H-%M-%S_%s.png'") },
|
||||||
{ SHTKEY, XK_i, spawn, SHCMD("scrot 'scrot_%Y-%m-%d_%H-%M-%S_%s.png'") },
|
{ SHTKEY, XK_i, spawn, SHCMD("scrot 'scrot_%Y-%m-%d_%H-%M-%S_%s.png'") },
|
||||||
{ MODKEY, XK_m, spawn, SHCMD("kill -50 $(pidof dwmblocks)") },
|
{ MODKEY, XK_m, spawn, SHCMD("kill -50 $(pidof dwmblocks)") },
|
||||||
{ MODKEY, XK_q, killclient, {0} },
|
{ MODKEY, XK_q, killclient, {0} },
|
||||||
{ MODKEY, XK_e, togglescratch, {.ui = 0 } },
|
{ MODKEY, XK_e, togglescratch, {.ui = 0 } },
|
||||||
{ MODKEY, XK_f, togglescratch, {.ui = 1 } },
|
{ MODKEY, XK_f, togglescratch, {.ui = 1 } },
|
||||||
/* service controls */
|
/* service controls */
|
||||||
{ CTRKEY, XK_b, spawn, SHCMD("rofi-bluetooth") },
|
{ CTRKEY, XK_b, spawn, SHCMD("rofi-bluetooth") },
|
||||||
{ CTRKEY, XK_d, spawn, SHCMD("rofi_display") },
|
{ CTRKEY, XK_d, spawn, SHCMD("rofi_display") },
|
||||||
{ CTRKEY, XK_l, spawn, SHCMD("slock") },
|
{ CTRKEY, XK_l, spawn, SHCMD("slock") },
|
||||||
{ CTRKEY, XK_v, spawn, SHCMD("pavucontrol") },
|
{ CTRKEY, XK_v, spawn, SHCMD("pavucontrol") },
|
||||||
{ CTRKEY, XK_u, spawn, SHCMD("rofi -show emoji") },
|
{ CTRKEY, XK_u, spawn, SHCMD("rofi -show emoji") },
|
||||||
/* window controls */
|
/* window controls */
|
||||||
{ SHTKEY, XK_m, zoom, {0} },
|
{ SHTKEY, XK_m, zoom, {0} },
|
||||||
{ SHTKEY, XK_h, setmfact, {.f = -0.05} },
|
{ SHTKEY, XK_h, setmfact, {.f = -0.05} },
|
||||||
{ SHTKEY, XK_l, setmfact, {.f = +0.05} },
|
{ SHTKEY, XK_l, setmfact, {.f = +0.05} },
|
||||||
{ SHTKEY, XK_j, focusstack, {.i = +1 } },
|
{ SHTKEY, XK_j, focusstack, {.i = +1 } },
|
||||||
{ SHTKEY, XK_k, focusstack, {.i = -1 } },
|
{ SHTKEY, XK_k, focusstack, {.i = -1 } },
|
||||||
{ SHTKEY, XK_f, togglefloating, {0} },
|
{ SHTKEY, XK_f, togglefloating, {0} },
|
||||||
{ SHTKEY, XK_equal, incnmaster, {.i = +1 } },
|
{ SHTKEY, XK_equal, incnmaster, {.i = +1 } },
|
||||||
{ SHTKEY, XK_minus, incnmaster, {.i = -1 } },
|
{ SHTKEY, XK_minus, incnmaster, {.i = -1 } },
|
||||||
/* main dwm controls */
|
/* main dwm controls */
|
||||||
{ ALLKEY, XK_b, togglebar, {0} },
|
{ ALLKEY, XK_b, togglebar, {0} },
|
||||||
{ ALLKEY, XK_g, setgaps, {.i = GAP_TOGGLE} },
|
{ ALLKEY, XK_g, setgaps, {.i = GAP_TOGGLE} },
|
||||||
{ ALLKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
{ ALLKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ ALLKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
{ ALLKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ ALLKEY, XK_r, quit, {1} },
|
{ ALLKEY, XK_r, quit, {1} },
|
||||||
{ ALLKEY, XK_q, quit, {0} },
|
{ ALLKEY, XK_q, quit, {0} },
|
||||||
/* only to avoid warnings */
|
/* only to avoid warnings */
|
||||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||||
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||||
{ SHTKEY, XK_comma, tagmon, {.i = -1 } },
|
{ SHTKEY, XK_comma, tagmon, {.i = -1 } },
|
||||||
{ SHTKEY, XK_period, tagmon, {.i = +1 } },
|
{ SHTKEY, XK_period, tagmon, {.i = +1 } },
|
||||||
{ 0, XF86XK_AudioMute, spawn, SHCMD("pamixer -t; kill -46 $(pidof dwmblocks)") },
|
{ 0, XF86XK_AudioMute, spawn, SHCMD("pamixer -t; kill -46 $(pidof dwmblocks)") },
|
||||||
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer --allow-boost -i 5; kill -46 $(pidof dwmblocks)") },
|
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer --allow-boost -i 5; kill -46 $(pidof dwmblocks)") },
|
||||||
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer --allow-boost -d 5; kill -46 $(pidof dwmblocks)") },
|
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer --allow-boost -d 5; kill -46 $(pidof dwmblocks)") },
|
||||||
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("sudo xbacklight -inc 10") },
|
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("sudo xbacklight -inc 10") },
|
||||||
{ 0, XF86XK_MonBrightnessDown, spawn, SHCMD("sudo xbacklight -dec 10") },
|
{ 0, XF86XK_MonBrightnessDown, spawn, SHCMD("sudo xbacklight -dec 10") },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* button definitions */
|
/* button definitions */
|
||||||
|
|
|
@ -554,7 +554,7 @@ unswallow(Client *c)
|
||||||
void
|
void
|
||||||
buttonpress(XEvent *e)
|
buttonpress(XEvent *e)
|
||||||
{
|
{
|
||||||
unsigned int i, x, click;
|
unsigned int i, x, click, occ = 0;
|
||||||
Arg arg = {0};
|
Arg arg = {0};
|
||||||
Client *c;
|
Client *c;
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
|
@ -569,9 +569,14 @@ buttonpress(XEvent *e)
|
||||||
}
|
}
|
||||||
if (ev->window == selmon->barwin) {
|
if (ev->window == selmon->barwin) {
|
||||||
i = x = 0;
|
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]);
|
x += TEXTW(tags[i]);
|
||||||
while (ev->x >= x && ++i < LENGTH(tags));
|
} while (ev->x >= x && ++i < LENGTH(tags));
|
||||||
if (i < LENGTH(tags)) {
|
if (i < LENGTH(tags)) {
|
||||||
click = ClkTagBar;
|
click = ClkTagBar;
|
||||||
arg.ui = 1 << i;
|
arg.ui = 1 << i;
|
||||||
|
@ -1004,8 +1009,6 @@ void
|
||||||
drawbar(Monitor *m)
|
drawbar(Monitor *m)
|
||||||
{
|
{
|
||||||
int x, w, tw = 0, stw = 0;
|
int x, w, tw = 0, stw = 0;
|
||||||
int boxs = drw->fonts->h / 9;
|
|
||||||
int boxw = drw->fonts->h / 6 + 2;
|
|
||||||
|
|
||||||
unsigned int i, occ = 0, urg = 0;
|
unsigned int i, occ = 0, urg = 0;
|
||||||
Client *c;
|
Client *c;
|
||||||
|
@ -1020,19 +1023,19 @@ drawbar(Monitor *m)
|
||||||
|
|
||||||
resizebarwin(m);
|
resizebarwin(m);
|
||||||
for (c = m->clients; c; c = c->next) {
|
for (c = m->clients; c; c = c->next) {
|
||||||
occ |= c->tags;
|
occ |= c->tags == 255 ? 0 : c->tags;
|
||||||
if (c->isurgent)
|
if (c->isurgent)
|
||||||
urg |= c->tags;
|
urg |= c->tags;
|
||||||
}
|
}
|
||||||
x = 0;
|
x = 0;
|
||||||
for (i = 0; i < LENGTH(tags); i++) {
|
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]);
|
w = TEXTW(tags[i]);
|
||||||
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
|
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);
|
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;
|
x += w;
|
||||||
}
|
}
|
||||||
w = blw = TEXTW(m->ltsymbol);
|
w = blw = TEXTW(m->ltsymbol);
|
||||||
|
|
55
_suckless/dwm/patches/09-dwm-hide_vacant_tags-6.2.diff
Normal file
55
_suckless/dwm/patches/09-dwm-hide_vacant_tags-6.2.diff
Normal file
|
@ -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);
|
Loading…
Add table
Add a link
Reference in a new issue