From d0757568ee2680e50d142a32ec7c759439431399 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Tue, 10 Sep 2019 08:27:00 +0200 Subject: [PATCH] Minor tweaks to awesomebar patch (incl. alpha and systray compatibility) --- README.md | 2 ++ config.def.h | 14 +++++++++++--- dwm.c | 2 +- patch/awesomebar.c | 18 ++++++++++++++++++ patch/awesomebar.h | 3 ++- patch/flextile.c | 1 + patches.h | 2 +- 7 files changed, 36 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f76b2b5..fac315e 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t ### Changelog: +2019-09-10 - Minor tweaks to awesomebar patch (incl. alpha and systray compatibility). + 2019-09-09 - Added deck, fibonacci (dwindle and spiral), gridmode, gapplessgrid, horizgrid, nrowgrid, centeredmaster and flextile layouts. Added alternativetags and awesomebar patches. 2019-09-08 - Added cfacts and vanitygaps patches, added bstack and bstackhoriz layouts diff --git a/config.def.h b/config.def.h index 30152ec..55cb61d 100644 --- a/config.def.h +++ b/config.def.h @@ -36,6 +36,9 @@ static const unsigned int alphas[][3] = { /* fg bg border */ [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, [SchemeSel] = { OPAQUE, baralpha, borderalpha }, + #if AWESOMEBAR_PATCH + [SchemeHid] = { OPAQUE, baralpha, borderalpha }, + #endif // AWESOMEBAR_PATCH }; #endif // ALPHA_PATCH static const char *colors[][3] = { @@ -217,6 +220,9 @@ static Key keys[] = { { MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} }, #endif // VANITYGAPS_PATCH { MODKEY, XK_Tab, view, {0} }, + #if AWESOMEBAR_PATCH + { MODKEY, XK_z, showhideclient, {0} }, + #endif // AWESOMEBAR_PATCH { MODKEY|ShiftMask, XK_c, killclient, {0} }, { MODKEY|ShiftMask, XK_q, quit, {0} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, @@ -231,9 +237,10 @@ static Key keys[] = { { MODKEY|ControlMask, XK_w, setflexlayout, {.i = 7 } }, // grid { MODKEY|ControlMask, XK_e, setflexlayout, {.i = 262 } }, // deck layout { MODKEY|ControlMask, XK_r, setflexlayout, {.i = 6 } }, // monocle - { MODKEY|ControlMask, XK_t, rotatelayoutaxis, {.i = 0} }, /* flextile, 0 = layout axis */ - { MODKEY|ControlMask, XK_Tab, rotatelayoutaxis, {.i = 1} }, /* flextile, 1 = master axis */ - { MODKEY|ControlMask|ShiftMask, XK_Tab, rotatelayoutaxis, {.i = 2} }, /* flextile, 2 = stack axis */ + { MODKEY|ControlMask, XK_g, setflexlayout, {.i = 257 } }, // columns (col) layout + { MODKEY|ControlMask, XK_t, rotatelayoutaxis, {.i = 0 } }, /* flextile, 0 = layout axis */ + { MODKEY|ControlMask, XK_Tab, rotatelayoutaxis, {.i = 1 } }, /* flextile, 1 = master axis */ + { MODKEY|ControlMask|ShiftMask, XK_Tab, rotatelayoutaxis, {.i = 2 } }, /* flextile, 2 = stack axis */ { MODKEY|ControlMask, XK_Return, mirrorlayout, {0} }, /* flextile, flip master and stack areas */ #endif // FLEXTILE_LAYOUT { MODKEY, XK_space, setlayout, {0} }, @@ -281,6 +288,7 @@ static Button buttons[] = { { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, #if AWESOMEBAR_PATCH { ClkWinTitle, 0, Button1, togglewin, {0} }, + { ClkWinTitle, 0, Button3, showhideclient, {0} }, #endif // AWESOMEBAR_PATCH { ClkWinTitle, 0, Button2, zoom, {0} }, { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, diff --git a/dwm.c b/dwm.c index cf95dbd..a309de1 100644 --- a/dwm.c +++ b/dwm.c @@ -1197,7 +1197,7 @@ focusin(XEvent *e) { XFocusChangeEvent *ev = &e->xfocus; - #if SYSTRAY_PATCH + #if SYSTRAY_PATCH && !AWESOMEBAR_PATCH if (showsystray) { /* Clear status bar to avoid artifacts beneath systray icons */ drw_rect(drw, 0, 0, selmon->ww, bh, 1, 1); diff --git a/patch/awesomebar.c b/patch/awesomebar.c index 20a54c7..e21f4f1 100644 --- a/patch/awesomebar.c +++ b/patch/awesomebar.c @@ -1,5 +1,6 @@ void hide(Client *c) { + if (!c || HIDDEN(c)) return; @@ -46,4 +47,21 @@ togglewin(const Arg *arg) focus(c); restack(selmon); } +} + +void +showhideclient(const Arg *arg) +{ + Client *c = (Client*)arg->v; + if (!c) + c = selmon->sel; + if (!c) + return; + + if (HIDDEN(c)) { + show(c); + restack(selmon); + } else { + hide(c); + } } \ No newline at end of file diff --git a/patch/awesomebar.h b/patch/awesomebar.h index 2ca3dd1..8cf46f4 100644 --- a/patch/awesomebar.h +++ b/patch/awesomebar.h @@ -1,3 +1,4 @@ static void hide(Client *c); static void show(Client *c); -static void togglewin(const Arg *arg); \ No newline at end of file +static void togglewin(const Arg *arg); +static void showhideclient(const Arg *arg); \ No newline at end of file diff --git a/patch/flextile.c b/patch/flextile.c index 5ff9ef1..695b312 100644 --- a/patch/flextile.c +++ b/patch/flextile.c @@ -29,6 +29,7 @@ * 000100000101 261 default tile layout * 000100100101 293 centered master * 000100000111 263 default tile layout with grid stack + * 000100000001 257 columns (col) layout */ void setflexlayout(const Arg *arg) diff --git a/patches.h b/patches.h index e67ecd2..7d3ab4f 100644 --- a/patches.h +++ b/patches.h @@ -269,4 +269,4 @@ /* Monocle layout (default). * This can be optionally disabled in favour of other layouts. */ -#define MONOCLE_LAYOUT 1 \ No newline at end of file +#define MONOCLE_LAYOUT 1