cleanup and patch
This commit is contained in:
@@ -83,6 +83,7 @@ static const Key keys[] = {
|
|||||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, XK_v, togglefloating, {0} },
|
{ MODKEY, XK_v, togglefloating, {0} },
|
||||||
|
{ MODKEY, XK_x, movecenter, {0} },
|
||||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||||
|
|||||||
11
dwm.c
11
dwm.c
@@ -183,6 +183,7 @@ static void maprequest(XEvent *e);
|
|||||||
static void monocle(Monitor *m);
|
static void monocle(Monitor *m);
|
||||||
static void motionnotify(XEvent *e);
|
static void motionnotify(XEvent *e);
|
||||||
static void movemouse(const Arg *arg);
|
static void movemouse(const Arg *arg);
|
||||||
|
static void movecenter(const Arg *arg);
|
||||||
static Client *nexttiled(Client *c);
|
static Client *nexttiled(Client *c);
|
||||||
static void pop(Client *c);
|
static void pop(Client *c);
|
||||||
static void propertynotify(XEvent *e);
|
static void propertynotify(XEvent *e);
|
||||||
@@ -1202,6 +1203,16 @@ movemouse(const Arg *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
movecenter(const Arg *arg)
|
||||||
|
{
|
||||||
|
if (selmon->sel) {
|
||||||
|
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 *
|
Client *
|
||||||
nexttiled(Client *c)
|
nexttiled(Client *c)
|
||||||
{
|
{
|
||||||
|
|||||||
2169
dwm.c.orig
2169
dwm.c.orig
File diff suppressed because it is too large
Load Diff
41
patches/dwm-movecenter-6.5.diff
Normal file
41
patches/dwm-movecenter-6.5.diff
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 9efa774..89a958a 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -85,6 +85,7 @@ static const Key keys[] = {
|
||||||
|
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||||
|
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||||
|
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||||
|
+ { MODKEY, XK_x, movecenter, {0} },
|
||||||
|
TAGKEYS( XK_1, 0)
|
||||||
|
TAGKEYS( XK_2, 1)
|
||||||
|
TAGKEYS( XK_3, 2)
|
||||||
|
diff --git a/dwm.c b/dwm.c
|
||||||
|
index f1d86b2..ad534ad 100644
|
||||||
|
--- a/dwm.c
|
||||||
|
+++ b/dwm.c
|
||||||
|
@@ -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 *c);
|
||||||
|
static void propertynotify(XEvent *e);
|
||||||
|
@@ -1202,6 +1203,16 @@ movemouse(const Arg *arg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+movecenter(const Arg *arg)
|
||||||
|
+{
|
||||||
|
+ if (selmon->sel) {
|
||||||
|
+ 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)
|
||||||
|
{
|
||||||
Reference in New Issue
Block a user