sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-toggletopbar-6.4.diff (1561B)


      1 diff -up a/config.def.h b/config.def.h
      2 --- a/config.def.h	2022-10-04 19:38:18.000000000 +0200
      3 +++ b/config.def.h	2022-10-22 14:12:40.528975869 +0200
      4 @@ -64,6 +64,7 @@ static const Key keys[] = {
      5  	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
      6  	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
      7  	{ MODKEY,                       XK_b,      togglebar,      {0} },
      8 +	{ MODKEY,                       XK_t,      toggletopbar,   {0} },
      9  	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
     10  	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
     11  	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
     12 diff -up a/dwm.c b/dwm.c
     13 --- a/dwm.c	2022-10-04 19:38:18.000000000 +0200
     14 +++ b/dwm.c	2022-10-22 14:12:14.142976534 +0200
     15 @@ -211,6 +211,7 @@ static void tag(const Arg *arg);
     16  static void tagmon(const Arg *arg);
     17  static void tile(Monitor *m);
     18  static void togglebar(const Arg *arg);
     19 +static void toggletopbar(const Arg *arg);
     20  static void togglefloating(const Arg *arg);
     21  static void toggletag(const Arg *arg);
     22  static void toggleview(const Arg *arg);
     23 @@ -1701,6 +1702,15 @@ togglebar(const Arg *arg)
     24  	updatebarpos(selmon);
     25  	XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
     26  	arrange(selmon);
     27 +}
     28 +
     29 +void
     30 +toggletopbar(const Arg *arg)
     31 +{
     32 +    selmon->topbar = !selmon->topbar;
     33 +	updatebarpos(selmon);
     34 +	XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
     35 +	arrange(selmon);
     36  }
     37  
     38  void