aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2016-06-23 22:06:34 +0200
committerDuncaen <mail@duncano.de>2018-12-31 22:45:05 +0100
commit112d2d7856c305f41cf5191f0f8c30f6ee0dba5d (patch)
treeab19d0d258d4f740d58b320d64f33e239f9a344f
parentb69c870a3076d78ab595ed1cd4b41cf6b03b2610 (diff)
downloaddwm-112d2d7856c305f41cf5191f0f8c30f6ee0dba5d.tar.gz
add function to move and resize floating windows for key bindings
-rw-r--r--dwm.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/dwm.c b/dwm.c
index 4465af1..59ef309 100644
--- a/dwm.c
+++ b/dwm.c
@@ -233,6 +233,10 @@ static int xerror(Display *dpy, XErrorEvent *ee);
static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
static void zoom(const Arg *arg);
+static void movex(const Arg *arg);
+static void movey(const Arg *arg);
+static void resizew(const Arg *arg);
+static void resizeh(const Arg *arg);
/* variables */
static const char broken[] = "broken";
@@ -2124,6 +2128,46 @@ zoom(const Arg *arg)
pop(c);
}
+void
+movex(const Arg *arg)
+{
+ Client *c = selmon->sel;
+
+ if (!c->isfloating)
+ return;
+ resize(c, c->x + arg->i, c->y, c->w, c->h, 1);
+}
+
+void
+movey(const Arg *arg)
+{
+ Client *c = selmon->sel;
+
+ if (!c->isfloating)
+ return;
+ resize(c, c->x, c->y + arg->i, c->w, c->h, 1);
+}
+
+void
+resizew(const Arg *arg)
+{
+ Client *c = selmon->sel;
+
+ if (!c->isfloating)
+ return;
+ resize(c, c->x, c->y, c->w + arg->i, c->h, 1);
+}
+
+void
+resizeh(const Arg *arg)
+{
+ Client *c = selmon->sel;
+
+ if (!c->isfloating)
+ return;
+ resize(c, c->x, c->y, c->w, c->h + arg->i, 1);
+}
+
int
main(int argc, char *argv[])
{