mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Adding setborderpx patch
This commit is contained in:
parent
39e161e545
commit
5501f81b9c
@ -13,6 +13,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
|
|
||||||
### Changelog:
|
### Changelog:
|
||||||
|
|
||||||
|
2019-09-14 - Added setborderpx patch
|
||||||
|
|
||||||
2019-09-13 - Added titlecolor and push patches
|
2019-09-13 - Added titlecolor and push patches
|
||||||
|
|
||||||
2019-09-12 - Added activetagindicatorbar, alwaysfullscreen and autoresize patches
|
2019-09-12 - Added activetagindicatorbar, alwaysfullscreen and autoresize patches
|
||||||
@ -117,6 +119,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
- saves size and position of every floating window before it is forced into tiled mode
|
- saves size and position of every floating window before it is forced into tiled mode
|
||||||
- if the window is made floating again then the old dimensions will be restored
|
- if the window is made floating again then the old dimensions will be restored
|
||||||
|
|
||||||
|
- [setborderpx](https://dwm.suckless.org/patches/statuspadding/)
|
||||||
|
- this patch allows border pixels to be changed during runtime
|
||||||
|
|
||||||
- [statuspadding](https://dwm.suckless.org/patches/statuspadding/)
|
- [statuspadding](https://dwm.suckless.org/patches/statuspadding/)
|
||||||
- adds configuration options for horizontal and vertical padding in the status bar
|
- adds configuration options for horizontal and vertical padding in the status bar
|
||||||
|
|
||||||
|
@ -313,6 +313,11 @@ static Key keys[] = {
|
|||||||
#if ALTERNATIVE_TAGS_PATCH
|
#if ALTERNATIVE_TAGS_PATCH
|
||||||
{ MODKEY, XK_n, togglealttag, {0} },
|
{ MODKEY, XK_n, togglealttag, {0} },
|
||||||
#endif // ALTERNATIVE_TAGS_PATCH
|
#endif // ALTERNATIVE_TAGS_PATCH
|
||||||
|
#if SETBORDERPX_PATCH
|
||||||
|
{ MODKEY|ShiftMask, XK_minus, setborderpx, {.i = -1 } },
|
||||||
|
{ MODKEY|ShiftMask, XK_plus, setborderpx, {.i = +1 } },
|
||||||
|
{ MODKEY|ShiftMask, XK_numbersign, setborderpx, {.i = 0 } },
|
||||||
|
#endif // SETBORDERPX_PATCH
|
||||||
#if CYCLELAYOUTS_PATCH
|
#if CYCLELAYOUTS_PATCH
|
||||||
{ MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } },
|
{ MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } },
|
||||||
{ MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },
|
{ MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },
|
||||||
|
10
dwm.c
10
dwm.c
@ -180,6 +180,9 @@ struct Monitor {
|
|||||||
int gappoh; /* horizontal outer gaps */
|
int gappoh; /* horizontal outer gaps */
|
||||||
int gappov; /* vertical outer gaps */
|
int gappov; /* vertical outer gaps */
|
||||||
#endif // VANITYGAPS_PATCH
|
#endif // VANITYGAPS_PATCH
|
||||||
|
#if SETBORDERPX_PATCH
|
||||||
|
unsigned int borderpx;
|
||||||
|
#endif // SETBORDERPX_PATCH
|
||||||
unsigned int seltags;
|
unsigned int seltags;
|
||||||
unsigned int sellt;
|
unsigned int sellt;
|
||||||
unsigned int tagset[2];
|
unsigned int tagset[2];
|
||||||
@ -888,6 +891,9 @@ createmon(void)
|
|||||||
m->nmaster = nmaster;
|
m->nmaster = nmaster;
|
||||||
m->showbar = showbar;
|
m->showbar = showbar;
|
||||||
m->topbar = topbar;
|
m->topbar = topbar;
|
||||||
|
#if SETBORDERPX_PATCH
|
||||||
|
m->borderpx = borderpx;
|
||||||
|
#endif // SETBORDERPX_PATCH
|
||||||
#if VANITYGAPS_PATCH
|
#if VANITYGAPS_PATCH
|
||||||
m->gappih = gappih;
|
m->gappih = gappih;
|
||||||
m->gappiv = gappiv;
|
m->gappiv = gappiv;
|
||||||
@ -1568,7 +1574,11 @@ manage(Window w, XWindowAttributes *wa)
|
|||||||
/* only fix client y-offset, if the client center might cover the bar */
|
/* only fix client y-offset, if the client center might cover the bar */
|
||||||
c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx)
|
c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx)
|
||||||
&& (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
|
&& (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
|
||||||
|
#if SETBORDERPX_PATCH
|
||||||
|
c->bw = c->mon->borderpx;
|
||||||
|
#else
|
||||||
c->bw = borderpx;
|
c->bw = borderpx;
|
||||||
|
#endif // SETBORDERPX_PATCH
|
||||||
|
|
||||||
wc.border_width = c->bw;
|
wc.border_width = c->bw;
|
||||||
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
|
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
|
||||||
|
@ -48,6 +48,10 @@
|
|||||||
#include "rotatestack.c"
|
#include "rotatestack.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if SETBORDERPX_PATCH
|
||||||
|
#include "setborderpx.c"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SYSTRAY_PATCH
|
#if SYSTRAY_PATCH
|
||||||
#include "systray.c"
|
#include "systray.c"
|
||||||
#endif
|
#endif
|
||||||
|
@ -44,6 +44,10 @@
|
|||||||
#include "rotatestack.h"
|
#include "rotatestack.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if SETBORDERPX_PATCH
|
||||||
|
#include "setborderpx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SYSTRAY_PATCH
|
#if SYSTRAY_PATCH
|
||||||
#include "systray.h"
|
#include "systray.h"
|
||||||
#endif
|
#endif
|
||||||
|
20
patch/setborderpx.c
Normal file
20
patch/setborderpx.c
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
void
|
||||||
|
setborderpx(const Arg *arg)
|
||||||
|
{
|
||||||
|
Client *c;
|
||||||
|
|
||||||
|
if (arg->i == 0)
|
||||||
|
mons->borderpx = borderpx;
|
||||||
|
else if (mons->borderpx + arg->i < 0)
|
||||||
|
mons->borderpx = 0;
|
||||||
|
else
|
||||||
|
mons->borderpx += arg->i;
|
||||||
|
|
||||||
|
for (c = mons->clients; c; c = c->next)
|
||||||
|
if (c->bw + arg->i < 0)
|
||||||
|
c->bw = mons->borderpx = 0;
|
||||||
|
else
|
||||||
|
c->bw = mons->borderpx;
|
||||||
|
|
||||||
|
arrange(selmon);
|
||||||
|
}
|
1
patch/setborderpx.h
Normal file
1
patch/setborderpx.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
static void setborderpx(const Arg *arg);
|
@ -187,6 +187,11 @@
|
|||||||
*/
|
*/
|
||||||
#define SAVEFLOATS_PATCH 0
|
#define SAVEFLOATS_PATCH 0
|
||||||
|
|
||||||
|
/* This patch allows border pixels to be changed during runtime.
|
||||||
|
* https://dwm.suckless.org/patches/setborderpx/
|
||||||
|
*/
|
||||||
|
#define SETBORDERPX_PATCH 0
|
||||||
|
|
||||||
/* This patch adds configuration options for horizontal and vertical padding in the status bar.
|
/* This patch adds configuration options for horizontal and vertical padding in the status bar.
|
||||||
* https://dwm.suckless.org/patches/statuspadding/
|
* https://dwm.suckless.org/patches/statuspadding/
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user