Return to repo list

suckless-gf-dwm

Gentoo-friendly patches for Suckless's dwm.
Return to HMagellan.com

commit c0cb48ffb0a856a557df14cb7084752c63e67700
parent 330b8ea1fb9cfcf8213bc471718ad111fad577e0
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Tue, 11 Aug 2020 20:42:15 -0500

Added alternativetags

Diffstat:
MREADME | 2+-
Aalternativetages/USAGE | 26++++++++++++++++++++++++++
Aalternativetages/alternativetags.patch | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 84 insertions(+), 1 deletion(-)

diff --git a/README b/README @@ -42,7 +42,7 @@ patches! (1). https://dwm.suckless.org/patches/ - CURRENT PROGRESS: 5/172 patches supported + CURRENT PROGRESS: 6/172 patches supported 1/172 patches unsupported USUPPORTED PATCHES: diff --git a/alternativetages/USAGE b/alternativetages/USAGE @@ -0,0 +1,26 @@ +alternativetags - Toggle-able alternative tags for dwm +Source: https://dwm.suckless.org/patches/alternativetags/dwm-alternativetags-6.2.diff +Original Author: Piyush Pangtey gokuvsvegita@gmail.com + +Description from source: + """ + Having icons as tags sure makes dwm look awesome, but having tags number simplifies + tags related operations. This patch introduces alternative tags which can be switched + on the fly for the sole purpose of providing visual aid. + """ + +== YOU MUST == +(1). Place the patch file in /etc/portage/patches/x11-wm/dwm/ and run 'emerge dwm' +(2). Add the following line to your savedconfig file: + + static const char *tagsalt[] = { "a", "b", "c", "d", "e", "f", "g", "h", "i" }; + + Note that the actual contents of the tag name strings can be whatever you want. + +== YOU PROBABLY SHOULD == +(1). Add a key binding to toggle the alternative tags off and on, for example: + + { MODKEY, XK_n, togglealttag, {0} }, + +== PATCH MODIFICATIONS == +(1). Removed lines relating to config.def.h diff --git a/alternativetages/alternativetags.patch b/alternativetages/alternativetags.patch @@ -0,0 +1,57 @@ +diff --git a/dwm.c b/dwm.c +index 4465af1..ee292e1 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -130,6 +130,7 @@ struct Monitor { + Monitor *next; + Window barwin; + const Layout *lt[2]; ++ unsigned int alttag; + }; + + typedef struct { +@@ -209,6 +210,7 @@ static void spawn(const Arg *arg); + static void tag(const Arg *arg); + static void tagmon(const Arg *arg); + static void tile(Monitor *); ++static void togglealttag(); + static void togglebar(const Arg *arg); + static void togglefloating(const Arg *arg); + static void toggletag(const Arg *arg); +@@ -695,7 +697,7 @@ dirtomon(int dir) + void + drawbar(Monitor *m) + { +- int x, w, sw = 0; ++ int x, w, wdelta, sw = 0; + int boxs = drw->fonts->h / 9; + int boxw = drw->fonts->h / 6 + 2; + unsigned int i, occ = 0, urg = 0; +@@ -716,8 +718,9 @@ drawbar(Monitor *m) + x = 0; + for (i = 0; i < LENGTH(tags); i++) { + w = TEXTW(tags[i]); ++ wdelta = selmon->alttag ? abs(TEXTW(tags[i]) - TEXTW(tagsalt[i])) / 2 : 0; + 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, wdelta + lrpad / 2, (selmon->alttag ? tagsalt[i] : 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, +@@ -1696,6 +1699,13 @@ tile(Monitor *m) + } + } + ++void ++togglealttag() ++{ ++ selmon->alttag = !selmon->alttag; ++ drawbar(selmon); ++} ++ + void + togglebar(const Arg *arg) + { +-- +2.21.0 +