From f2da4d20d9a79070863972423ca964cf65342ba7 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Wed, 15 Jul 2020 09:26:16 +0200 Subject: [PATCH] Further bar renaming --- patch/{ewmhtags.c => bar_ewmhtags.c} | 0 patch/{ewmhtags.h => bar_ewmhtags.h} | 0 patch/{holdbar.c => bar_holdbar.c} | 0 patch/{holdbar.h => bar_holdbar.h} | 0 patch/{statuscolors.c => bar_statuscolors.c} | 0 patch/include.c | 27 ++--- patch/include.h | 21 ++-- patch/statuscmd.c | 18 --- patch/statuscmd.h | 1 - patch/taggrid.c | 118 ------------------- patch/taggrid.h | 2 - 11 files changed, 21 insertions(+), 166 deletions(-) rename patch/{ewmhtags.c => bar_ewmhtags.c} (100%) rename patch/{ewmhtags.h => bar_ewmhtags.h} (100%) rename patch/{holdbar.c => bar_holdbar.c} (100%) rename patch/{holdbar.h => bar_holdbar.h} (100%) rename patch/{statuscolors.c => bar_statuscolors.c} (100%) delete mode 100644 patch/statuscmd.c delete mode 100644 patch/statuscmd.h delete mode 100644 patch/taggrid.c delete mode 100644 patch/taggrid.h diff --git a/patch/ewmhtags.c b/patch/bar_ewmhtags.c similarity index 100% rename from patch/ewmhtags.c rename to patch/bar_ewmhtags.c diff --git a/patch/ewmhtags.h b/patch/bar_ewmhtags.h similarity index 100% rename from patch/ewmhtags.h rename to patch/bar_ewmhtags.h diff --git a/patch/holdbar.c b/patch/bar_holdbar.c similarity index 100% rename from patch/holdbar.c rename to patch/bar_holdbar.c diff --git a/patch/holdbar.h b/patch/bar_holdbar.h similarity index 100% rename from patch/holdbar.h rename to patch/bar_holdbar.h diff --git a/patch/statuscolors.c b/patch/bar_statuscolors.c similarity index 100% rename from patch/statuscolors.c rename to patch/bar_statuscolors.c diff --git a/patch/include.c b/patch/include.c index 5cde652..e35033e 100644 --- a/patch/include.c +++ b/patch/include.c @@ -8,6 +8,12 @@ #if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH #include "bar_dwmblocks.c" #endif +#if BAR_EWMHTAGS_PATCH +#include "bar_ewmhtags.c" +#endif +#if BAR_HOLDBAR_PATCH +#include "bar_holdbar.c" +#endif #if BAR_LTSYMBOL_PATCH #include "bar_ltsymbol.c" #endif @@ -26,6 +32,9 @@ #if BAR_STATUSCMD_PATCH #include "bar_statuscmd.c" #endif +#if BAR_STATUSCOLORS_PATCH +#include "bar_statuscolors.c" +#endif #if BAR_TAGS_PATCH #include "bar_tags.c" #endif @@ -44,6 +53,9 @@ #if BAR_SYSTRAY_PATCH #include "bar_systray.c" #endif +#if BAR_VTCOLORS_PATCH +#include "bar_vtcolors.c" +#endif /* Other patches */ #if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH @@ -72,9 +84,6 @@ #elif FSIGNAL_PATCH #include "fsignal.c" #endif -#if BAR_EWMHTAGS_PATCH -#include "ewmhtags.c" -#endif #if EXRESIZE_PATCH #include "exresize.c" #endif @@ -93,9 +102,6 @@ #if FULLSCREEN_PATCH #include "fullscreen.c" #endif -#if BAR_HOLDBAR_PATCH -#include "holdbar.c" -#endif #if INPLACEROTATE_PATCH #include "inplacerotate.c" #endif @@ -166,9 +172,6 @@ #if STACKER_PATCH #include "stacker.c" #endif -#if BAR_STATUSCOLORS_PATCH -#include "statuscolors.c" -#endif #if STICKY_PATCH #include "sticky.c" #endif @@ -190,9 +193,6 @@ #if TAGALLMON_PATCH #include "tagallmon.c" #endif -#if TAGGRID_PATCH -#include "taggrid.c" -#endif #if TAGOTHERMONITOR_PATCH #include "tagothermonitor.c" #endif @@ -214,9 +214,6 @@ #if VANITYGAPS_PATCH #include "vanitygaps.c" #endif -#if BAR_VTCOLORS_PATCH -#include "vtcolors.c" -#endif #if WARP_PATCH #include "warp.c" #endif diff --git a/patch/include.h b/patch/include.h index 49ce915..9065c87 100644 --- a/patch/include.h +++ b/patch/include.h @@ -8,6 +8,12 @@ #if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH #include "bar_dwmblocks.h" #endif +#if BAR_EWMHTAGS_PATCH +#include "bar_ewmhtags.h" +#endif +#if BAR_HOLDBAR_PATCH +#include "bar_holdbar.h" +#endif #if BAR_LTSYMBOL_PATCH #include "bar_ltsymbol.h" #endif @@ -44,6 +50,9 @@ #if BAR_SYSTRAY_PATCH #include "bar_systray.h" #endif +#if BAR_VTCOLORS_PATCH +#include "bar_vtcolors.h" +#endif /* Other patches */ #if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH @@ -75,9 +84,6 @@ #elif FSIGNAL_PATCH #include "fsignal.h" #endif -#if BAR_EWMHTAGS_PATCH -#include "ewmhtags.h" -#endif #if EXRESIZE_PATCH #include "exresize.h" #endif @@ -96,9 +102,6 @@ #if FULLSCREEN_PATCH #include "fullscreen.h" #endif -#if BAR_HOLDBAR_PATCH -#include "holdbar.h" -#endif #if INPLACEROTATE_PATCH #include "inplacerotate.h" #endif @@ -190,9 +193,6 @@ #if TAGALLMON_PATCH #include "tagallmon.h" #endif -#if TAGGRID_PATCH -#include "taggrid.h" -#endif #if TAGOTHERMONITOR_PATCH #include "tagothermonitor.h" #endif @@ -214,9 +214,6 @@ #if VANITYGAPS_PATCH #include "vanitygaps.h" #endif -#if BAR_VTCOLORS_PATCH -#include "vtcolors.h" -#endif #if WARP_PATCH #include "warp.h" #endif diff --git a/patch/statuscmd.c b/patch/statuscmd.c deleted file mode 100644 index b38739d..0000000 --- a/patch/statuscmd.c +++ /dev/null @@ -1,18 +0,0 @@ -#if !DWMBLOCKS_PATCH -static const char statusexport[] = "export BUTTON=-;"; -static int statuscmdn; -static int lastbutton; -#endif // DWMBLOCKS_PATCH - -void -copyvalidchars(char *text, char *rawtext) -{ - int i = -1, j = 0; - - while (rawtext[++i]) { - if ((unsigned char)rawtext[i] >= ' ') { - text[j++] = rawtext[i]; - } - } - text[j] = '\0'; -} diff --git a/patch/statuscmd.h b/patch/statuscmd.h deleted file mode 100644 index 77391b6..0000000 --- a/patch/statuscmd.h +++ /dev/null @@ -1 +0,0 @@ -static void copyvalidchars(char *text, char *rawtext); \ No newline at end of file diff --git a/patch/taggrid.c b/patch/taggrid.c deleted file mode 100644 index bfa19ec..0000000 --- a/patch/taggrid.c +++ /dev/null @@ -1,118 +0,0 @@ -void drawtaggrid(Monitor *m, int *x_pos, unsigned int occ) -{ - unsigned int x, y, h, max_x, columns; - int invert, i,j, k; - - h = bh / tagrows; - x = max_x = *x_pos; - y = 0; - columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0); - - /* Firstly we will fill the borders of squares */ - - XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm][ColBorder].pixel); - XFillRectangle(dpy, drw->drawable, drw->gc, x, y, h*columns + 1, bh); - - /* We will draw LENGTH(tags) squares in tagraws raws. */ - for (j = 0, i= 0; j < tagrows; j++) { - x = *x_pos; - for (k = 0; k < columns && i < LENGTH(tags); k++, i++) { - invert = m->tagset[m->seltags] & 1 << i ? 0 : 1; - - /* Select active color for current square */ - XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColBg].pixel : - scheme[SchemeNorm][ColFg].pixel); - XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h-1); - - /* Mark square if tag has client */ - if (occ & 1 << i) { - XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColFg].pixel : - scheme[SchemeNorm][ColBg].pixel); - XFillRectangle(dpy, drw->drawable, drw->gc, x + 1, y + 1, - h / 2, h / 2); - } - x += h; - if (x > max_x) { - max_x = x; - } - } - y += h; - } - *x_pos = max_x + 1; -} - -void switchtag(const Arg *arg) -{ - unsigned int columns; - unsigned int new_tagset = 0; - unsigned int pos, i; - int col, row; - Arg new_arg; - - columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0); - - for (i = 0; i < LENGTH(tags); ++i) { - if (!(selmon->tagset[selmon->seltags] & 1 << i)) { - continue; - } - pos = i; - row = pos / columns; - col = pos % columns; - if (arg->ui & SWITCHTAG_UP) { /* UP */ - row --; - if (row < 0) { - row = tagrows - 1; - } - do { - pos = row * columns + col; - row --; - } while (pos >= LENGTH(tags)); - } - if (arg->ui & SWITCHTAG_DOWN) { /* DOWN */ - row ++; - if (row >= tagrows) { - row = 0; - } - pos = row * columns + col; - if (pos >= LENGTH(tags)) { - row = 0; - } - pos = row * columns + col; - } - if (arg->ui & SWITCHTAG_LEFT) { /* LEFT */ - col --; - if (col < 0) { - col = columns - 1; - } - do { - pos = row * columns + col; - col --; - } while (pos >= LENGTH(tags)); - } - if (arg->ui & SWITCHTAG_RIGHT) { /* RIGHT */ - col ++; - if (col >= columns) { - col = 0; - } - pos = row * columns + col; - if (pos >= LENGTH(tags)) { - col = 0; - pos = row * columns + col; - } - } - new_tagset |= 1 << pos; - } - new_arg.ui = new_tagset; - if (arg->ui & SWITCHTAG_TOGGLETAG) { - toggletag(&new_arg); - } - if (arg->ui & SWITCHTAG_TAG) { - tag(&new_arg); - } - if (arg->ui & SWITCHTAG_VIEW) { - view (&new_arg); - } - if (arg->ui & SWITCHTAG_TOGGLEVIEW) { - toggleview (&new_arg); - } -} \ No newline at end of file diff --git a/patch/taggrid.h b/patch/taggrid.h deleted file mode 100644 index 27343a6..0000000 --- a/patch/taggrid.h +++ /dev/null @@ -1,2 +0,0 @@ -static void drawtaggrid(Monitor *m, int *x_pos, unsigned int occ); -static void switchtag(const Arg *arg); \ No newline at end of file