Update keybinds, add better hide patch

This commit is contained in:
speediegq 2022-10-22 16:52:17 +02:00
parent 422d7767ca
commit 9bfff2176b
5 changed files with 267 additions and 127 deletions

View file

@ -65,4 +65,13 @@
- 65 | Reload .Xresources on the fly
- 66 | Switch to the previous tag, skipping empty tags
- 67 | Switch to the next tag, skipping empty tags
- 68 | Toggle the tag area in the bar
- 69 | Toggle the empty tags in the bar
- 70 | Toggle the powerline tags in the bar
- 71 | Toggle the title area in the bar
- 72 | Toggle the unselected title area in the bar
- 73 | Toggle the layout area in the bar
- 74 | Toggle the status area in the bar
- 75 | Toggle the floating indicator area in the bar
- 76 | Toggle the sticky indicator area in the bar

View file

@ -24,7 +24,6 @@
These keybinds are for navigating speedwm
- Super+t | Reorganize tags and move windows
- Super+f | Full-screen the selected window
- Super+b | Show/hide the speedwm bar
- Super+s | Show/hide the systray
@ -46,10 +45,10 @@
- Super+Colon | Open a list of desktop entries in dmenu
- Super+0 | Reset mfact
- Super+r | Reset number of masters
- Super+t | Disable inactive fade
- Super+Shift+Equal | Toggle scratchpads
- Super+Shift+Minus | Hide the scratchpad
- Super+Shift+Space | Unfloat floating windows
- Super+Shift+Space | Toggle floating windows
- Super+y | Make the current selected window sticky
- Super+Shift+Arrow | Resizes a window in floating mode
- Super+1 | Move to tag 1
- Super+2 | Move to tag 2
@ -115,6 +114,15 @@
-- Chained keybinds --
- Super+t & r | Reorganize tags and move windows
- Super+t & t | Toggle tag area in the bar
- Super+t & y | Toggle empty tag area in the bar
- Super+t & w | Toggle title area in the bar
- Super+t & u | Toggle unselected title area in the bar
- Super+t & p | Toggle powerline tags in the bar
- Super+t & s | Toggle status area in the bar
- Super+t & l | Toggle layout area in the bar
- Super+t & o | Toggle inactive fade
- Super+c & w | Get the weather (Using wttr.in)
- Super+c & n | Switch to the next track
- Super+c & p | Switch to the previous track

View file

@ -119,9 +119,10 @@ static Key keys[] = {
{ MODIFIER1|SHIFT, -1, XK_k, inplacerotate, {.i = -1} },
{ MODIFIER1|SHIFT, -1, XK_h, inplacerotate, {.i = +2} },
{ MODIFIER1|SHIFT, -1, XK_l, inplacerotate, {.i = -2} },
{ MODIFIER1, -1, XK_n, incmastercount, {.i = -1 } },
{ MODIFIER1, -1, XK_i, incmastercount, {.i = +1 } },
{ MODIFIER1, -1, XK_n, incmastercount, {.i = -1 } },
{ MODIFIER1, -1, XK_i, incmastercount, {.i = +1 } },
{ MODIFIER1, -1, XK_t, toggleopacity, {0} },
{ MODIFIER1, -1, XK_y, togglesticky, {0} },
/* Floating mode keybinds */
{ MODIFIER1, -1, XK_w, moveresizeaspect, {.i = +24} },
@ -153,7 +154,6 @@ static Key keys[] = {
TAGKEYS( -1, XK_7, 6)
TAGKEYS( -1, XK_8, 7)
TAGKEYS( -1, XK_9, 8)
{ MODIFIER1, -1, XK_t, reorganizetags, {0} },
{ MODIFIER1|CONTROL, -1, XK_a, viewtoleft, {0} },
{ MODIFIER1|CONTROL, -1, XK_d, viewtoright, {0} },
{ MODIFIER1|CONTROL|SHIFT, -1, XK_z, viewtoleft_vacant, {0} },
@ -171,7 +171,18 @@ static Key keys[] = {
{ MODIFIER1, XK_c, XK_p, spawn, cmd( PREVMUSIC ) },
{ MODIFIER1, XK_r, XK_s, spawn, cmd( "screenkey" ) },
{ MODIFIER1, XK_r, XK_d, spawn, cmd( "pkill screenkey" ) },
{ MODIFIER1, XK_t, XK_s, togglesticky, {0} },
{ MODIFIER1, XK_t, XK_t, togglebartags, {0} },
{ MODIFIER1, XK_t, XK_w, togglebartitle, {0} },
{ MODIFIER1, XK_t, XK_u, togglebarunseltitle, {0} },
{ MODIFIER1, XK_t, XK_s, togglebarstatus, {0} },
{ MODIFIER1, XK_t, XK_p, togglebarpowerline, {0} },
{ MODIFIER1, XK_t, XK_y, togglebaremptytags, {0} },
{ MODIFIER1, XK_t, XK_l, togglebarlt, {0} },
{ MODIFIER1, XK_t, XK_o, toggleopacity, {0} },
{ MODIFIER1, XK_t, XK_r, reorganizetags, {0} },
{ MODIFIER1, XK_w, XK_r, spawn, cmd( "speedwm-swal --randomize" ) },
{ MODIFIER1, XK_w, XK_p, spawn, cmd( "speedwm-swal --previous" ) },
{ MODIFIER1|SHIFT, XK_k, XK_o, killunsel, {0} },

143
signal.h
View file

@ -6,102 +6,111 @@
static Signal signals[] = {
/* signum function argument */
#if LAYOUT_CUSTOM
{ 15, set_s_layout, {.v = &layouts[13]} },
{ 15, set_s_layout, {.v = &layouts[13]} },
#endif
{ 16, cyclelayout, {.i = +1 } },
{ 17, cyclelayout, {.i = -1 } },
{ 18, setmfact, {.f = +0.05} },
{ 19, setmfact, {.f = -0.05} },
{ 20, togglesticky, {0} },
{ 21, togglebar, {0} },
{ 22, togglefullscr, {0} },
{ 23, togglefloating, {0} },
{ 24, zoom, {0} },
{ 25, reorganizetags, {0} },
{ 26, quit, {0} },
{ 27, quit, {1} },
{ 28, show, {0} },
{ 29, hide, {0} },
{ 30, killclient, {0} },
{ 31, inplacerotate, {.i = +1 } },
{ 32, inplacerotate, {.i = -1 } },
{ 33, incmastercount, {.i = +1 } },
{ 34, incmastercount, {.i = -1 } },
{ 35, focusmaster, {0} },
{ 36, focusstackvis, {.i = +1 } },
{ 37, focusstackvis, {.i = -1 } },
{ 38, focusstackhid, {.i = +1 } },
{ 39, focusstackhid, {.i = -1 } },
{ 40, toggleopacity, {0} },
{ 41, setcfact, {.f = +0.05 } },
{ 42, setcfact, {.f = -0.05 } },
{ 43, viewtoleft, {0} },
{ 44, viewtoright, {0} },
{ 45, defaultgaps, {0} },
{ 46, togglegaps, {0} },
{ 47, incrgaps, {.i = +1 } },
{ 48, incrgaps, {.i = -1 } },
{ 49, incrigaps, {.i = +1 } },
{ 50, incrigaps, {.i = -1 } },
{ 51, incrogaps, {.i = +1 } },
{ 52, incrogaps, {.i = -1 } },
{ 53, killunsel, {0} },
{ 54, focusmon, {.i = +1 } },
{ 55, focusmon, {.i = -1 } },
{ 56, scratchpad_show, {0} },
{ 57, scratchpad_hide, {0} },
{ 58, scratchpad_remove, {0} },
{ 59, reset_layout, {0} },
{ 60, resetmastercount, {0} },
{ 16, cyclelayout, {.i = +1 } },
{ 17, cyclelayout, {.i = -1 } },
{ 18, setmfact, {.f = +0.05} },
{ 19, setmfact, {.f = -0.05} },
{ 20, togglesticky, {0} },
{ 21, togglebar, {0} },
{ 22, togglefullscr, {0} },
{ 23, togglefloating, {0} },
{ 24, zoom, {0} },
{ 25, reorganizetags, {0} },
{ 26, quit, {0} },
{ 27, quit, {1} },
{ 28, show, {0} },
{ 29, hide, {0} },
{ 30, killclient, {0} },
{ 31, inplacerotate, {.i = +1 } },
{ 32, inplacerotate, {.i = -1 } },
{ 33, incmastercount, {.i = +1 } },
{ 34, incmastercount, {.i = -1 } },
{ 35, focusmaster, {0} },
{ 36, focusstackvis, {.i = +1 } },
{ 37, focusstackvis, {.i = -1 } },
{ 38, focusstackhid, {.i = +1 } },
{ 39, focusstackhid, {.i = -1 } },
{ 40, toggleopacity, {0} },
{ 41, setcfact, {.f = +0.05 } },
{ 42, setcfact, {.f = -0.05 } },
{ 43, viewtoleft, {0} },
{ 44, viewtoright, {0} },
{ 45, defaultgaps, {0} },
{ 46, togglegaps, {0} },
{ 47, incrgaps, {.i = +1 } },
{ 48, incrgaps, {.i = -1 } },
{ 49, incrigaps, {.i = +1 } },
{ 50, incrigaps, {.i = -1 } },
{ 51, incrogaps, {.i = +1 } },
{ 52, incrogaps, {.i = -1 } },
{ 53, killunsel, {0} },
{ 54, focusmon, {.i = +1 } },
{ 55, focusmon, {.i = -1 } },
{ 56, scratchpad_show, {0} },
{ 57, scratchpad_hide, {0} },
{ 58, scratchpad_remove, {0} },
{ 59, reset_layout, {0} },
{ 60, resetmastercount, {0} },
#if USESYSTRAY
{ 61, togglesystray, {0} },
{ 61, togglesystray, {0} },
#endif
{ 62, hideall, {0} },
{ 63, showall, {0} },
{ 64, reset_mfact, {0} },
{ 62, hideall, {0} },
{ 63, showall, {0} },
{ 64, reset_mfact, {0} },
#if USEXRESOURCES
{ 65, reloadcolors, {0} },
{ 65, reloadcolors, {0} },
#endif
{ 66, viewtoleft_vacant, {0} },
{ 67, viewtoright_vacant,{0} },
{ 66, viewtoleft_vacant, {0} },
{ 67, viewtoright_vacant, {0} },
{ 68, togglebartags, {0} },
{ 69, togglebaremptytags, {0} },
{ 70, togglebarpowerline, {0} },
{ 71, togglebartitle, {0} },
{ 72, togglebarunseltitle,{0} },
{ 73, togglebarlt, {0} },
{ 74, togglebarstatus, {0} },
{ 75, togglebarfloat, {0} },
{ 76, togglebarsticky, {0} },
#if LAYOUT_TILE
{ 1, setlayout, {.v = &layouts[0]} }, /* Tiling layout */
{ 1, setlayout, {.v = &layouts[0]} }, /* Tiling layout */
#endif
{ 2, setlayout, {.v = &layouts[1]} }, /* Floating layout */
{ 2, setlayout, {.v = &layouts[1]} }, /* Floating layout */
#if LAYOUT_MONOCLE
{ 3, setlayout, {.v = &layouts[2]} }, /* Monocle layout */
{ 3, setlayout, {.v = &layouts[2]} }, /* Monocle layout */
#endif
#if LAYOUT_GRID
{ 4, setlayout, {.v = &layouts[3]} }, /* Grid layout */
{ 4, setlayout, {.v = &layouts[3]} }, /* Grid layout */
#endif
#if LAYOUT_DECK
{ 5, setlayout, {.v = &layouts[4]} }, /* Deck layout */
{ 5, setlayout, {.v = &layouts[4]} }, /* Deck layout */
#endif
#if LAYOUT_CM
{ 6, setlayout, {.v = &layouts[5]} }, /* Centered Master layout */
{ 6, setlayout, {.v = &layouts[5]} }, /* Centered Master layout */
#endif
#if LAYOUT_CFM
{ 7, setlayout, {.v = &layouts[6]} }, /* Centered Floating Master layout */
{ 7, setlayout, {.v = &layouts[6]} }, /* Centered Floating Master layout */
#endif
#if LAYOUT_SPIRAL
{ 8, setlayout, {.v = &layouts[7]} }, /* Fibonacci Spiral layout */
{ 8, setlayout, {.v = &layouts[7]} }, /* Fibonacci Spiral layout */
#endif
#if LAYOUT_DWINDLE
{ 9, setlayout, {.v = &layouts[8]} }, /* Fibonacci Dwindle layout */
{ 9, setlayout, {.v = &layouts[8]} }, /* Fibonacci Dwindle layout */
#endif
#if LAYOUT_BSTACK
{ 10, setlayout, {.v = &layouts[9]} }, /* Bottom Stack layout */
{ 10, setlayout, {.v = &layouts[9]} }, /* Bottom Stack layout */
#endif
#if LAYOUT_BSTACKH
{ 11, setlayout, {.v = &layouts[10]} }, /* Horizontal Bottom Stack layout */
{ 11, setlayout, {.v = &layouts[10]} }, /* Horizontal Bottom Stack layout */
#endif
#if LAYOUT_HGRID
{ 12, setlayout, {.v = &layouts[11]} }, /* Horizontal Grid layout */
{ 12, setlayout, {.v = &layouts[11]} }, /* Horizontal Grid layout */
#endif
#if LAYOUT_DGRID
{ 13, setlayout, {.v = &layouts[12]} }, /* Dynamic Grid layout */
{ 13, setlayout, {.v = &layouts[12]} }, /* Dynamic Grid layout */
#endif
#if LAYOUT_CUSTOM
{ 14, setlayout, {.v = &layouts[13]} }, /* Custom layout */
{ 14, setlayout, {.v = &layouts[13]} }, /* Custom layout */
#endif
};

209
speedwm.c
View file

@ -261,6 +261,20 @@ struct Monitor {
int previewshow;
#endif
int showbar;
/* bar items */
int hidelayout;
int hidetitle;
int hideunselectedtitle;
int hidestatus;
int hideicon;
int hidetags;
int hidesystray;
int hideemptytags;
int hidepowerline;
int hidefloating;
int hidesticky;
int barposition;
int hidsel;
int isreset;
@ -582,6 +596,18 @@ static void empty(Monitor *m);
#endif
static void togglebar(const Arg *arg);
static void togglefloating(const Arg *arg);
/* bar items */
static void togglebartags(const Arg *arg);
static void togglebaremptytags(const Arg *arg);
static void togglebartitle(const Arg *arg);
static void togglebarunseltitle(const Arg *arg);
static void togglebarpowerline(const Arg *arg);
static void togglebarlt(const Arg *arg);
static void togglebarstatus(const Arg *arg);
static void togglebarfloat(const Arg *arg);
static void togglebarsticky(const Arg *arg);
static void toggleopacity(const Arg *arg);
static void togglefullscr(const Arg *arg);
#if USEWINICON
@ -1171,32 +1197,32 @@ buttonpress(XEvent *e)
if (ev->window == selmon->barwin) {
/* powerline */
if (!hidepowerline) {
if (!selmon->hidepowerline) {
i = 0; x = plw; occ = 0;
} else {
i = x = occ = 0;
}
/* powerline */
if (!hidepowerline)
if (!selmon->hidepowerline)
x = plw;
/* Bitmask of occupied tags */
for (c = m->clients; c; c = c->next)
occ |= c->tags;
if (layoutposition && !hidelayout) {
if (layoutposition && !selmon->hidelayout) {
x += TEXTW(m->ltsymbol);
} if (ev->x < x && layoutposition && !selmon->isreset && !hidelayout) {
} if (ev->x < x && layoutposition && !selmon->isreset && !selmon->hidelayout) {
click = ClkLtSymbol; /* left layout */
} else {
do {
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i) && hideemptytags)
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i) && selmon->hideemptytags)
continue;
if (!hidetags && hideemptytags)
if (!selmon->hidetags && selmon->hideemptytags)
x += TEXTW(occ & 1 << i ? usedtags[i] : tags[i]) + plw;
} while (ev->x >= x && ++i < LENGTH(tags));
if (i < LENGTH(tags) && !hidetags) {
if (i < LENGTH(tags) && !selmon->hidetags) {
click = ClkTagBar;
if ( ev->button == Button4 || ev->button == Button5 ) {
arg.ui = selmon->tagset[selmon->seltags];
@ -1219,7 +1245,7 @@ buttonpress(XEvent *e)
} else if (ev->x < x + TEXTW(selmon->ltsymbol) && !layoutposition && !selmon->isreset) /* right layout */
click = ClkLtSymbol; /* right layout */
else if (ev->x > selmon->ww - statusw + lrpad - 2 - getsystraywidth() && !hidestatus) {
else if (ev->x > selmon->ww - statusw + lrpad - 2 - getsystraywidth() && !selmon->hidestatus) {
x = selmon->ww - statusw + lrpad - 2 * sp - getsystraywidth() - 2;
click = ClkStatusText;
char *text = rawstext;
@ -1240,8 +1266,8 @@ buttonpress(XEvent *e)
statuscmdn = ch;
}
}
} else if (!hideunselectedtitle) {
if (!layoutposition && !hidelayout) {
} else if (!selmon->hideunselectedtitle) {
if (!layoutposition && !selmon->hidelayout) {
x += TEXTW(m->ltsymbol); /* Left layout does not need this */
}
@ -1249,7 +1275,7 @@ buttonpress(XEvent *e)
* This is not required, but you won't be able to see what you're clicking so we might as well disable it */
c = m->clients;
if (c && !hidetitle) {
if (c && !selmon->hidetitle) {
do {
if (!c || !ISVISIBLE(c))
continue;
@ -1309,7 +1335,7 @@ cleanup(void)
cleanupmon(mons);
#if USESYSTRAY
if (!hidesystray) {
if (!selmon->hidesystray) {
XUnmapWindow(dpy, systray->win);
XDestroyWindow(dpy, systray->win);
free(systray);
@ -1381,7 +1407,7 @@ clientmessage(XEvent *e)
XWindowAttributes wa;
XSetWindowAttributes swa;
if (!hidesystray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) {
if (!selmon->hidesystray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) {
/* add systray icons */
if (cme->data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) {
if (!(c = (Client *)calloc(1, sizeof(Client))))
@ -1626,6 +1652,20 @@ createmon(void)
m->mfact = mfact;
m->mastercount = mastercount;
m->showbar = !hidebar;
/* bar items */
m->hidelayout = hidelayout;
m->hidetitle = hidetitle;
m->hideunselectedtitle = hideunselectedtitle;
m->hidestatus = hidestatus;
m->hideicon = hideicon;
m->hidetags = hidetags;
m->hidesystray = hidesystray;
m->hideemptytags = hideemptytags;
m->hidepowerline = hidepowerline;
m->hidefloating = hidefloating;
m->hidesticky = hidesticky;
m->barposition = barposition;
m->bh = bh;
m->gapsizeih = gapsizeih;
@ -1970,7 +2010,7 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
w += 2; /* 1px padding on both sides */
ret = x = m->ww - w - 2 * sp - ((!hidesystray && m == systraytomon(m)) ? getsystraywidth() : 0);
ret = x = m->ww - w - 2 * sp - ((!selmon->hidesystray && m == systraytomon(m)) ? getsystraywidth() : 0);
drw_setscheme(drw, scheme[LENGTH(colors)]);
drw->scheme[ColFg] = scheme[SchemeStatus][ColFg];
@ -2203,7 +2243,7 @@ drawbaritems(Monitor *m)
int wt;
Clr *prevscheme, *nxtscheme; /* powerline schemes */
if (!hidepowerline)
if (!selmon->hidepowerline)
plw = drw->fonts->h / 2 + 1;
/* indicators */
@ -2223,14 +2263,14 @@ drawbaritems(Monitor *m)
return;
#if USESYSTRAY
if(!hidesystray && m == systraytomon(m) && !systrayposition)
if(!selmon->hidesystray && m == systraytomon(m) && !systrayposition)
stw = getsystraywidth();
#endif
/* draw status first so it can be overdrawn by tags later */
if (m == selmon || 1) { /* status is only drawn on selected monitor */
char *text, *s, ch;
if (!hidestatus) {
if (!selmon->hidestatus) {
tw = statusw = m->ww - drawstatusbar(m, bh, stext) - getsystraywidth();
}
#if USESYSTRAY
@ -2256,12 +2296,12 @@ resizebarwin(m);
if (ISVISIBLE(c))
n++;
occ |= c->tags;
if (c->isurgent && !hidetags)
if (c->isurgent && !selmon->hidetags)
urg |= c->tags;
}
/* draw the layout bar on the left if layoutposition = 1 and we're not hiding the layout */
if (layoutposition && !hidelayout) {
if (layoutposition && !selmon->hidelayout) {
w = TEXTW(m->ltsymbol);
/* color with the bar color if !colorlayout */
@ -2273,16 +2313,16 @@ resizebarwin(m);
}
/* draw tags */
if (!hidetags) {
if (!selmon->hidetags) {
for (i = 0; i < LENGTH(tags); i++) {
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i) && hideemptytags)
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i) && selmon->hideemptytags)
continue;
if (!hidetags) {
if (!selmon->hidetags) {
tagtext = occ & 1 << i ? usedtags[i] : tags[i];
w = TEXTW(tagtext);
/* draw powerlined tags */
if (!hidepowerline) {
if (!selmon->hidepowerline) {
prevscheme = scheme[SchemeBar]; /* previous scheme = scheme */
if (urg & 1 << i && allowurgent)
drw_settrans(drw, prevscheme, (nxtscheme = scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsUrg])); /* set transition colorscheme */
@ -2312,7 +2352,7 @@ resizebarwin(m);
}
/* draw end of powerline tags */
if (!hidepowerline) {
if (!selmon->hidepowerline) {
prevscheme = nxtscheme; /* previous scheme = next colorscheme */
nxtscheme = scheme[SchemeBar]; /* next colorscheme = bar color */
drw_settrans(drw, prevscheme, nxtscheme); /* set transition colorscheme */
@ -2337,7 +2377,7 @@ resizebarwin(m);
#endif
/* draw the layout bar on the right if layoutposition is not 0 */
if (!layoutposition && !hidelayout) {
if (!layoutposition && !selmon->hidelayout) {
w = TEXTW(m->ltsymbol);
drw_setscheme(drw, scheme[SchemeLayout]);
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
@ -2348,14 +2388,14 @@ resizebarwin(m);
#else
if ((w = m->ww - tw - x) > bh) {
#endif
if (n > 0 && !hidetitle) {
if (n > 0 && !selmon->hidetitle) {
int remainder;
int tabw;
int docontinue;
/* we're doing this to make sure the title does not get truncated when there's only supposed to be one title anyway */
if (!hideunselectedtitle) {
if (!selmon->hideunselectedtitle) {
remainder = w % n; /* remainder of the title area */
tabw = (1.0 / (double)n) * w + 1; /* width of each tab (client in the title area) */
} else {
@ -2371,29 +2411,29 @@ resizebarwin(m);
continue;
/* hide unselected title */
if (m->sel != c && hideunselectedtitle) {
if (m->sel != c && selmon->hideunselectedtitle) {
docontinue = 1; /* we're going to continue */
continue;
}
/* selected clients */
if (m->sel == c && colorselectedtitle) {
if (!hideunselectedtitle)
if (!selmon->hideunselectedtitle)
scm = SchemeTitleSel;
/* hidden clients */
} else if (HIDDEN(c) && colorhiddentitle) {
if (!hideunselectedtitle)
if (!selmon->hideunselectedtitle)
scm = SchemeTitleHidden;
/* unselected clients */
} else {
if (!hideunselectedtitle)
if (!selmon->hideunselectedtitle)
scm = SchemeTitleNorm;
}
/* apply colors */
if (!hideunselectedtitle) {
if (!selmon->hideunselectedtitle) {
if (colorselectedtitle) {
drw_setscheme(drw, scheme[scm]);
} else {
@ -2408,7 +2448,7 @@ resizebarwin(m);
}
/* we don't need this if we're only printing focused */
if (!hideunselectedtitle) {
if (!selmon->hideunselectedtitle) {
if (remainder >= 0) {
if (remainder == 0) {
tabw--;
@ -2426,7 +2466,7 @@ resizebarwin(m);
/* draw title and icon */
#if USEWINICON
if (hideicon) {
if (selmon->hideicon) {
#endif
drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0);
#if USEWINICON
@ -2438,12 +2478,12 @@ resizebarwin(m);
#endif
/* draw sticky window indicator */
if (c->issticky && !hidesticky) {
if (c->issticky && !selmon->hidesticky) {
drw_polygon(drw, x + boxs, c->isfloating ? boxs * 2 + boxw : boxs, stickyiconbb.x, stickyiconbb.y, boxw, boxw * stickyiconbb.y / stickyiconbb.x, stickyicon, LENGTH(stickyicon), Nonconvex, c->tags & c->mon->tagset[c->mon->seltags]);
}
/* draw floating window indicator */
if (c->isfloating && !hidefloating) {
if (c->isfloating && !selmon->hidefloating) {
drw_rect(drw, x + boxs, boxs, boxw, boxw, c->isfixed, 0);
}
@ -2815,7 +2855,7 @@ getsystraywidth()
#if USESYSTRAY
unsigned int w = 0;
Client *i;
if(!hidesystray)
if(!selmon->hidesystray)
for(i = systray->icons; i; w += i->w + systrayspacing, i = i->next) ;
return w ? w + systrayspacing : 1;
#else
@ -2827,9 +2867,9 @@ getsystraywidth()
void
togglesystray()
{
if (!hidesystray)
if (!selmon->hidesystray)
XUnmapWindow(dpy, systray->win);
hidesystray = !hidesystray;
selmon->hidesystray = !selmon->hidesystray;
updatesystray();
updatestatus();
}
@ -3536,11 +3576,11 @@ motionnotify(XEvent *e)
for (c = selmon->clients; c; c = c->next)
occ |= c->tags == 255 ? 0 : c->tags;
do {
if (!(occ & 1 << i || selmon->seltags & 1 << i) && hideemptytags)
if (!(occ & 1 << i || selmon->seltags & 1 << i) && selmon->hideemptytags)
continue;
x += TEXTW(tags[i]) + lts + plw;
} while (ev->x >= x && ++i < LENGTH(tags));
if (mousepreview && !hidetags) {
if (mousepreview && !selmon->hidetags) {
if (i < LENGTH(tags)) {
if (selmon->previewshow != (i + 1)
&& !(selmon->seltags & 1 << i)) {
@ -3561,7 +3601,7 @@ motionnotify(XEvent *e)
selmon->previewshow = 0;
XUnmapWindow(dpy, selmon->tagwin);
}
} /* mousepreview && !hidetags */
} /* mousepreview && !selmon->hidetags */
#endif
if (ev->window != root)
return;
@ -4369,7 +4409,7 @@ propertynotify(XEvent *e)
if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
updatetitle(c);
updaterules(c);
if (c == c->mon->sel && !hidetitle)
if (c == c->mon->sel && !selmon->hidetitle)
drawbaritems(c->mon);
}
#if USEWINICON
@ -4504,7 +4544,7 @@ removesystrayicon(Client *i)
{
Client **ii;
if (hidesystray || !i)
if (selmon->hidesystray || !i)
return;
for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next);
if (ii)
@ -4515,7 +4555,7 @@ removesystrayicon(Client *i)
void
resizebarwin(Monitor *m) {
unsigned int w = m->ww;
if (!hidesystray && m == systraytomon(m) && !systrayposition)
if (!selmon->hidesystray && m == systraytomon(m) && !systrayposition)
w -= getsystraywidth();
XMoveResizeWindow(dpy, m->barwin, m->wx + sp, m->by + vp, m->ww - 2 * sp, bh);
}
@ -5479,7 +5519,7 @@ togglebar(const Arg *arg)
updatebarpos(selmon);
#if USESYSTRAY
resizebarwin(selmon);
if (!hidesystray) {
if (!selmon->hidesystray) {
XWindowChanges wc;
if (!selmon->showbar)
wc.y = -bh;
@ -5499,6 +5539,69 @@ togglebar(const Arg *arg)
arrange(selmon);
}
void
togglebartags(const Arg *arg)
{
selmon->hidetags = !selmon->hidetags;
arrange(selmon);
}
void
togglebaremptytags(const Arg *arg)
{
selmon->hideemptytags = !selmon->hideemptytags;
arrange(selmon);
}
void
togglebarunseltitle(const Arg *arg)
{
selmon->hideunselectedtitle = !selmon->hideunselectedtitle;
arrange(selmon);
}
void
togglebarpowerline(const Arg *arg)
{
selmon->hidepowerline = !selmon->hidepowerline;
arrange(selmon);
}
void
togglebartitle(const Arg *arg)
{
selmon->hidetitle = !selmon->hidetitle;
arrange(selmon);
}
void
togglebarlt(const Arg *arg)
{
selmon->hidelayout = !selmon->hidelayout;
arrange(selmon);
}
void
togglebarstatus(const Arg *arg)
{
selmon->hidestatus = !selmon->hidestatus;
arrange(selmon);
}
void
togglebarfloat(const Arg *arg)
{
selmon->hidefloating = !selmon->hidefloating;
arrange(selmon);
}
void
togglebarsticky(const Arg *arg)
{
selmon->hidesticky = !selmon->hidesticky;
arrange(selmon);
}
void
togglefloating(const Arg *arg)
{
@ -5714,7 +5817,7 @@ updatebars(void)
continue;
#if USESYSTRAY
w = m->ww;
if (!hidesystray && m == systraytomon(m))
if (!selmon->hidesystray && m == systraytomon(m))
w -= getsystraywidth();
#endif
m->barwin = XCreateWindow(dpy, root, m->wx + sp, m->by + vp, m->ww - 2 * sp, bh, 0, depth,
@ -5723,7 +5826,7 @@ updatebars(void)
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
#if USESYSTRAY
if (!hidesystray && m == systraytomon(m))
if (!selmon->hidesystray && m == systraytomon(m))
XMapRaised(dpy, systray->win);
#endif
@ -5970,11 +6073,11 @@ void
updatestatus(void)
{
Monitor* m;
if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext)) && !hidestatus) {
if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext)) && !selmon->hidestatus) {
strcpy(stext, defaultstatus);
statusw = TEXTW(stext) - lrpad + 2;
} else {
if (!hidestatus) {
if (!selmon->hidestatus) {
copyvalidchars(stext, rawstext);
char *text, *s, ch;
statusw = 0;
@ -6376,7 +6479,7 @@ updatesystrayiconstate(Client *i, XPropertyEvent *ev)
long flags;
int code = 0;
if (hidesystray || !i || ev->atom != xatom[XembedInfo] ||
if (selmon->hidesystray || !i || ev->atom != xatom[XembedInfo] ||
!(flags = getatomprop(i, xatom[XembedInfo])))
return;
@ -6410,7 +6513,7 @@ updatesystray(void)
unsigned int sw = TEXTW(stext) - lrpad + systrayspacing;
unsigned int w = 1;
if (hidesystray)
if (selmon->hidesystray)
return;
if (systrayposition)
x -= sw + lrpad / 2;
@ -6470,7 +6573,7 @@ Client *
wintosystrayicon(Window w) {
Client *i = NULL;
if (hidesystray || !w)
if (selmon->hidesystray || !w)
return i;
for (i = systray->icons; i && i->win != w; i = i->next) ;
return i;