From 5bbdf5c439f42a4d8210154e98dc315ef1cd4631 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Mon, 22 Aug 2022 02:46:46 +0200 Subject: [PATCH] More tag schemes. --- _desktop/_suckless/dwm/README.md | 2 +- .../_patches/dwm-empty_urgent_tags-1.0.diff | 84 ------------------- .../dwm/_patches/dwm-tagschemes-1.0.diff | 67 +++++++++++++++ _desktop/_suckless/dwm/config.def.h | 1 - _desktop/_suckless/dwm/config.h | 2 + _desktop/_suckless/dwm/dwm.c | 4 +- 6 files changed, 72 insertions(+), 88 deletions(-) delete mode 100644 _desktop/_suckless/dwm/_patches/dwm-empty_urgent_tags-1.0.diff create mode 100644 _desktop/_suckless/dwm/_patches/dwm-tagschemes-1.0.diff diff --git a/_desktop/_suckless/dwm/README.md b/_desktop/_suckless/dwm/README.md index cd82f22..f937b7a 100644 --- a/_desktop/_suckless/dwm/README.md +++ b/_desktop/_suckless/dwm/README.md @@ -13,7 +13,7 @@ These patches from suckless.org were applied from the newest versions, in order: 1. `dwm-swallow-20201211-61bb8b2.diff` 1. `dwm-scratchpads-20200414-728d397b.diff` 1. `dwm-alwayscenter-20200625-f04cac6.diff` -1. `dwm-empty_urgent_tags-1.0.diff` (local, see _patches/ - use `git apply`) +1. `dwm-tagschemes-1.0.diff` (local, see _patches/ - use `git apply`) **note**: lot of manual work was involved, these won't apply easily on top of the others. diff --git a/_desktop/_suckless/dwm/_patches/dwm-empty_urgent_tags-1.0.diff b/_desktop/_suckless/dwm/_patches/dwm-empty_urgent_tags-1.0.diff deleted file mode 100644 index 430f8df..0000000 --- a/_desktop/_suckless/dwm/_patches/dwm-empty_urgent_tags-1.0.diff +++ /dev/null @@ -1,84 +0,0 @@ -diff --git a/_desktop/_suckless/dwm/config.def.h b/_desktop/_suckless/dwm/config.def.h -index d4a6eee..f115171 100644 ---- a/_desktop/_suckless/dwm/config.def.h -+++ b/_desktop/_suckless/dwm/config.def.h -@@ -22,10 +22,12 @@ static const char col_gray2[] = "#444444"; - static const char col_gray3[] = "#bbbbbb"; - static const char col_gray4[] = "#eeeeee"; - static const char col_cyan[] = "#005577"; -+static const char col_empty[] = "#525252"; - static const char *colors[][3] = { -- /* fg bg border */ -- [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, -- [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -+ /* fg bg border */ -+ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, -+ [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -+ [SchemeEmpty] = { col_empty, col_gray1, col_gray2 }, - }; - - typedef struct { -diff --git a/_desktop/_suckless/dwm/config.h b/_desktop/_suckless/dwm/config.h -index 5395cf2..5d41d54 100644 ---- a/_desktop/_suckless/dwm/config.h -+++ b/_desktop/_suckless/dwm/config.h -@@ -17,16 +17,21 @@ static const int showsystray = 1; /* 0 means no systray */ - static const int showbar = 1; /* 0 means no bar */ - static const int topbar = 1; /* 0 means bottom bar */ - static const char *fonts[] = { "RobotoMono Nerd Font:style=Medium:pixelsize=13" }; --static const char col_fg[] = "#f8f8f2"; --static const char col_bg[] = "#272822"; --static const char col_bd[] = "#161616"; --static const char col_fg_sel[] = "#ffffff"; --static const char col_bg_sel[] = "#005577"; --static const char col_bd_sel[] = "#707070"; -+static const char col_fg[] = "#f8f8f2"; -+static const char col_bg[] = "#272822"; -+static const char col_bd[] = "#161616"; -+static const char col_fg_empty[] = "#525252"; -+static const char col_fg_urgent[] = "#ffffff"; -+static const char col_bg_urgent[] = "#770000"; -+static const char col_fg_sel[] = "#272822"; -+static const char col_bg_sel[] = "#ffffff"; -+static const char col_bd_sel[] = "#ffffff"; - static const char *colors[][3] = { -- /* fg bg border */ -- [SchemeNorm] = { col_fg, col_bg, col_bd }, -- [SchemeSel] = { col_fg_sel, col_bg_sel, col_bd_sel }, -+ /* fg bg border */ -+ [SchemeNorm] = { col_fg, col_bg, col_bd }, -+ [SchemeSel] = { col_fg_sel, col_bg_sel, col_bd_sel }, -+ [SchemeEmpty] = { col_fg_empty, col_bg, col_bd }, -+ [SchemeUrgent] = { col_fg_urgent, col_bg_urgent, col_bd }, - }; - - typedef struct { -diff --git a/_desktop/_suckless/dwm/dwm.c b/_desktop/_suckless/dwm/dwm.c -index 8a200d5..626eab3 100644 ---- a/_desktop/_suckless/dwm/dwm.c -+++ b/_desktop/_suckless/dwm/dwm.c -@@ -81,7 +81,7 @@ - - /* enums */ - enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ --enum { SchemeNorm, SchemeSel }; /* color schemes */ -+enum { SchemeNorm, SchemeSel, SchemeEmpty, SchemeUrgent }; /* color schemes */ - enum { NetSupported, NetWMName, NetWMState, NetWMCheck, - NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz, - NetWMFullscreen, NetActiveWindow, NetWMWindowType, -@@ -1029,12 +1029,12 @@ drawbar(Monitor *m) - x = 0; - for (i = 0; i < LENGTH(tags); i++) { - 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); -+ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : urg & 1 << i ? SchemeUrgent : occ & 1 << i ? SchemeNorm : SchemeEmpty ]); -+ drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], 0); - x += w; - } - w = blw = TEXTW(m->ltsymbol); -- drw_setscheme(drw, scheme[SchemeNorm]); -+ drw_setscheme(drw, scheme[SchemeEmpty]); - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); - - if ((w = m->ww - tw - stw - x) > bh) { diff --git a/_desktop/_suckless/dwm/_patches/dwm-tagschemes-1.0.diff b/_desktop/_suckless/dwm/_patches/dwm-tagschemes-1.0.diff new file mode 100644 index 0000000..e13cbea --- /dev/null +++ b/_desktop/_suckless/dwm/_patches/dwm-tagschemes-1.0.diff @@ -0,0 +1,67 @@ +diff --git a/config.def.h b/config.def.h +index 9efa774..ab0209f 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -7,15 +7,24 @@ static const int showbar = 1; /* 0 means no bar */ + static const int topbar = 1; /* 0 means bottom bar */ + static const char *fonts[] = { "monospace:size=10" }; + static const char dmenufont[] = "monospace:size=10"; +-static const char col_gray1[] = "#222222"; +-static const char col_gray2[] = "#444444"; +-static const char col_gray3[] = "#bbbbbb"; +-static const char col_gray4[] = "#eeeeee"; +-static const char col_cyan[] = "#005577"; +-static const char *colors[][3] = { +- /* fg bg border */ +- [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, +- [SchemeSel] = { col_gray4, col_cyan, col_cyan }, ++static const char col_fg[] = "#ffffff"; ++static const char col_bg[] = "#272822"; ++static const char col_bd[] = "#272822"; ++static const char col_fg_empty[] = "#404040"; ++static const char col_fg_layout[] = "#909090"; ++static const char col_fg_urgent[] = "#ffffff"; ++static const char col_bg_urgent[] = "#770000"; ++static const char col_bd_urgent[] = "#770000"; ++static const char col_fg_sel[] = "#ffffff"; ++static const char col_bg_sel[] = "#005577"; ++static const char col_bd_sel[] = "#ffffff"; ++static const char *colors[][3] = { ++ /* fg bg border */ ++ [SchemeNorm] = { col_fg, col_bg, col_bd }, ++ [SchemeSel] = { col_fg_sel, col_bg_sel, col_bd_sel }, ++ [SchemeEmpty] = { col_fg_empty, col_bg, col_bd }, ++ [SchemeLayout] = { col_fg_layout, col_bg, col_bd }, ++ [SchemeUrgent] = { col_fg_urgent, col_bg_urgent, col_bd_urgent }, + }; + + /* tagging */ +diff --git a/dwm.c b/dwm.c +index 8a200d5..626eab3 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -81,7 +81,7 @@ + + /* enums */ + enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ +-enum { SchemeNorm, SchemeSel }; /* color schemes */ ++enum { SchemeNorm, SchemeSel, SchemeEmpty, SchemeLayout, SchemeUrgent }; /* color schemes */ + enum { NetSupported, NetWMName, NetWMState, NetWMCheck, + NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz, + NetWMFullscreen, NetActiveWindow, NetWMWindowType, +@@ -1029,12 +1029,12 @@ drawbar(Monitor *m) + x = 0; + for (i = 0; i < LENGTH(tags); i++) { + 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); ++ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : urg & 1 << i ? SchemeUrgent : occ & 1 << i ? SchemeNorm : SchemeEmpty ]); ++ drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], 0); + x += w; + } + w = blw = TEXTW(m->ltsymbol); +- drw_setscheme(drw, scheme[SchemeNorm]); ++ drw_setscheme(drw, scheme[SchemeLayout]); + x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); + + if ((w = m->ww - tw - stw - x) > bh) { diff --git a/_desktop/_suckless/dwm/config.def.h b/_desktop/_suckless/dwm/config.def.h index f115171..3a60ca7 100644 --- a/_desktop/_suckless/dwm/config.def.h +++ b/_desktop/_suckless/dwm/config.def.h @@ -22,7 +22,6 @@ static const char col_gray2[] = "#444444"; static const char col_gray3[] = "#bbbbbb"; static const char col_gray4[] = "#eeeeee"; static const char col_cyan[] = "#005577"; -static const char col_empty[] = "#525252"; static const char *colors[][3] = { /* fg bg border */ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, diff --git a/_desktop/_suckless/dwm/config.h b/_desktop/_suckless/dwm/config.h index 7aba27a..2d00373 100644 --- a/_desktop/_suckless/dwm/config.h +++ b/_desktop/_suckless/dwm/config.h @@ -21,6 +21,7 @@ static const char col_fg[] = "#ffffff"; static const char col_bg[] = "#272822"; static const char col_bd[] = "#272822"; static const char col_fg_empty[] = "#404040"; +static const char col_fg_layout[] = "#909090"; static const char col_fg_urgent[] = "#ffffff"; static const char col_bg_urgent[] = "#770000"; static const char col_bd_urgent[] = "#770000"; @@ -32,6 +33,7 @@ static const char *colors[][3] = { [SchemeNorm] = { col_fg, col_bg, col_bd }, [SchemeSel] = { col_fg_sel, col_bg_sel, col_bd_sel }, [SchemeEmpty] = { col_fg_empty, col_bg, col_bd }, + [SchemeLayout] = { col_fg_layout, col_bg, col_bd }, [SchemeUrgent] = { col_fg_urgent, col_bg_urgent, col_bd_urgent }, }; diff --git a/_desktop/_suckless/dwm/dwm.c b/_desktop/_suckless/dwm/dwm.c index 626eab3..32958c9 100644 --- a/_desktop/_suckless/dwm/dwm.c +++ b/_desktop/_suckless/dwm/dwm.c @@ -81,7 +81,7 @@ /* enums */ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel, SchemeEmpty, SchemeUrgent }; /* color schemes */ +enum { SchemeNorm, SchemeSel, SchemeEmpty, SchemeLayout, SchemeUrgent }; /* color schemes */ enum { NetSupported, NetWMName, NetWMState, NetWMCheck, NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz, NetWMFullscreen, NetActiveWindow, NetWMWindowType, @@ -1034,7 +1034,7 @@ drawbar(Monitor *m) x += w; } w = blw = TEXTW(m->ltsymbol); - drw_setscheme(drw, scheme[SchemeEmpty]); + drw_setscheme(drw, scheme[SchemeLayout]); x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); if ((w = m->ww - tw - stw - x) > bh) {