Update signals, add keybind for resetting barheight, improve keybind for

resetting bar items
This commit is contained in:
speediegq 2022-10-23 21:19:35 +02:00
parent 28235b64bf
commit de61f81137
4 changed files with 61 additions and 30 deletions

View file

@ -78,16 +78,17 @@
- 78 | Show all bar modules
- 79 | Increase bar height by 1
- 80 | Decrease bar height by 1
- 81 | Increase vertical barpadding by 1
- 82 | Decrease vertical barpadding by 1
- 83 | Increase horizontal barpadding by 1
- 84 | Decrease horizontal barpadding by 1
- 85 | Increase vertical and horizontal barpadding by 1
- 86 | Decrease vertical and horizontal barpadding by 1
- 87 | Toggle vertical barpadding
- 88 | Toggle horizontal barpadding
- 89 | Toggle vertical and horizontal barpadding
- 90 | Reset vertical barpadding
- 91 | Reset horizontal barpadding
- 92 | Reset vertical and horizontal barpadding
- 81 | Reset bar height
- 82 | Increase vertical barpadding by 1
- 83 | Decrease vertical barpadding by 1
- 84 | Increase horizontal barpadding by 1
- 85 | Decrease horizontal barpadding by 1
- 86 | Increase vertical and horizontal barpadding by 1
- 87 | Decrease vertical and horizontal barpadding by 1
- 88 | Toggle vertical barpadding
- 89 | Toggle horizontal barpadding
- 90 | Toggle vertical and horizontal barpadding
- 91 | Reset vertical barpadding
- 92 | Reset horizontal barpadding
- 93 | Reset vertical and horizontal barpadding

View file

@ -122,6 +122,7 @@ static Key keys[] = {
{ MODIFIER1, -1, XK_n, incmastercount, {.i = -1 } },
{ MODIFIER1, -1, XK_i, incmastercount, {.i = +1 } },
{ MODIFIER1, -1, XK_y, togglesticky, {0} },
{ MODIFIER1|CONTROL|SHIFT, -1, XK_0, resetbarheight, {0} },
{ MODIFIER1|CONTROL|SHIFT, -1, XK_equal, setbarheight, {.i = +1} },
{ MODIFIER1|CONTROL|SHIFT, -1, XK_minus, setbarheight, {.i = -1} },

View file

@ -77,18 +77,19 @@ static Signal signals[] = {
{ 78, resetbar, {0} },
{ 79, setbarheight, {.i = +1 } },
{ 80, setbarheight, {.i = -1 } },
{ 81, setbarpaddingv, {.i = +1 } },
{ 82, setbarpaddingv, {.i = -1 } },
{ 83, setbarpaddingh, {.i = +1 } },
{ 84, setbarpaddingh, {.i = -1 } },
{ 85, setbarpadding, {.i = +1 } },
{ 86, setbarpadding, {.i = -1 } },
{ 87, togglebarpaddingv, {0} },
{ 88, togglebarpaddingh, {0} },
{ 89, togglebarpadding, {0} },
{ 90, resetbarpaddingv, {0} },
{ 91, resetbarpaddingh, {0} },
{ 92, resetbarpadding, {0} },
{ 81, resetbarheight, {0} },
{ 82, setbarpaddingv, {.i = +1 } },
{ 83, setbarpaddingv, {.i = -1 } },
{ 84, setbarpaddingh, {.i = +1 } },
{ 85, setbarpaddingh, {.i = -1 } },
{ 86, setbarpadding, {.i = +1 } },
{ 87, setbarpadding, {.i = -1 } },
{ 88, togglebarpaddingv, {0} },
{ 89, togglebarpaddingh, {0} },
{ 90, togglebarpadding, {0} },
{ 91, resetbarpaddingv, {0} },
{ 92, resetbarpaddingh, {0} },
{ 93, resetbarpadding, {0} },
#if LAYOUT_TILE
{ 1, setlayout, {.v = &layouts[0]} }, /* Tiling layout */

View file

@ -618,6 +618,18 @@ static void resetbar(const Arg *arg);
static void toggleopacity(const Arg *arg);
static void togglefullscr(const Arg *arg);
static void setbarheight(const Arg *arg);
static void resetbarheight(const Arg *arg);
/* todo: create standalone patch for these functions */
static void setbarpaddingv(const Arg *arg);
static void setbarpaddingh(const Arg *arg);
static void setbarpadding(const Arg *arg);
static void resetbarpaddingv(const Arg *arg);
static void resetbarpaddingh(const Arg *arg);
static void resetbarpadding(const Arg *arg);
static void togglebarpaddingv(const Arg *arg);
static void togglebarpaddingh(const Arg *arg);
static void togglebarpadding(const Arg *arg);
/* todo: create standalone patch for these functions */
static void setbarpaddingv(const Arg *arg);
@ -3392,6 +3404,19 @@ setbarheight(const Arg *arg)
arrange(selmon);
}
void
resetbarheight(const Arg *arg)
{
if (altbar)
return;
bh = altbar ? 0 : drw->fonts->h + barheight;
updatebarpos(selmon);
resizebarwin(selmon);
arrange(selmon);
}
void
togglegaps(const Arg *arg)
{
@ -5775,12 +5800,15 @@ togglebarsticky(const Arg *arg)
void
resetbar(const Arg *arg)
{
selmon->hidetags = 0;
selmon->hidetitle = 0;
selmon->hidelayout = 0;
selmon->hidestatus = 0;
selmon->hidefloating = 0;
selmon->hidesticky = 0;
selmon->hidetags = hidetags;
selmon->hidetitle = hidetitle;
selmon->hidelayout = hidelayout;
selmon->hidestatus = hidestatus;
selmon->hidefloating = hidefloating;
selmon->hidesticky = hidesticky;
selmon->hidepowerline = hidepowerline;
selmon->hideunselectedtitle = hideunselectedtitle;
selmon->hideemptytags = hideemptytags;
arrange(selmon);
}