1
0
Fork 0

Add center patch, for floating windows (MODKEY + x)

This commit is contained in:
MGislv 2022-02-15 21:27:49 +01:00
parent 1b3540e796
commit 93b92091b4
2 changed files with 10 additions and 0 deletions

View File

@ -89,6 +89,7 @@ static Key keys[] = {
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
{ MODKEY, XK_c, spawn, {.v = clipmenu} },
{ MODKEY, XK_x, movecenter, {0} },
{ Mod4Mask, XK_plus, spawn, {.v = upvol} },
{ Mod4Mask, XK_minus, spawn, {.v = downvol} },
{ Mod4Mask, XK_m, spawn, {.v = tmutevol} },

9
dwm.c
View File

@ -184,6 +184,7 @@ static void maprequest(XEvent *e);
static void monocle(Monitor *m);
static void motionnotify(XEvent *e);
static void movemouse(const Arg *arg);
static void movecenter(const Arg *arg);
static Client *nexttiled(Client *c);
static void pop(Client *);
static void propertynotify(XEvent *e);
@ -1195,6 +1196,14 @@ movemouse(const Arg *arg)
}
}
void
movecenter(const Arg *arg)
{
selmon->sel->x = selmon->sel->mon->mx + (selmon->sel->mon->mw - WIDTH(selmon->sel)) / 2;
selmon->sel->y = selmon->sel->mon->my + (selmon->sel->mon->mh - HEIGHT(selmon->sel)) / 2;
arrange(selmon);
}
Client *
nexttiled(Client *c)
{