summaryrefslogtreecommitdiff
path: root/dwm.c.orig
diff options
context:
space:
mode:
authorP.P.A <adolphs@moselle.moe>2023-07-08 09:42:51 +0200
committerP.P.A <adolphs@moselle.moe>2023-07-08 09:42:51 +0200
commit3eea951a662f9282de6b6847c861c358f5dc5f9f (patch)
tree1b3402335a205c299800d7e10976235227d0b098 /dwm.c.orig
parent88a51560ef67174f46cd0b02f41b4da43465bf9a (diff)
scratchpad
Diffstat (limited to 'dwm.c.orig')
-rw-r--r--dwm.c.orig44
1 files changed, 44 insertions, 0 deletions
diff --git a/dwm.c.orig b/dwm.c.orig
index beaaf79..94bc42a 100644
--- a/dwm.c.orig
+++ b/dwm.c.orig
@@ -236,7 +236,10 @@ static void motionnotify(XEvent *e);
static void movemouse(const Arg *arg);
static Client *nexttiled(Client *c);
static void pop(Client *c);
+static Client *prevtiled(Client *c);
static void propertynotify(XEvent *e);
+static void pushdown(const Arg *arg);
+static void pushup(const Arg *arg);
static void quit(const Arg *arg);
static Monitor *recttomon(int x, int y, int w, int h);
static void removesystrayicon(Client *i);
@@ -1469,6 +1472,16 @@ pop(Client *c)
arrange(c->mon);
}
+Client *
+prevtiled(Client *c) {
+ Client *p, *r;
+
+ for(p = selmon->clients, r = NULL; p && p != c; p = p->next)
+ if(!p->isfloating && ISVISIBLE(p))
+ r = p;
+ return r;
+}
+
void
propertynotify(XEvent *e)
{
@@ -1518,6 +1531,37 @@ propertynotify(XEvent *e)
}
void
+pushdown(const Arg *arg) {
+ Client *sel = selmon->sel, *c;
+
+ if(!sel || sel->isfloating || sel == nexttiled(selmon->clients))
+ return;
+ if((c = nexttiled(sel->next))) {
+ detach(sel);
+ sel->next = c->next;
+ c->next = sel;
+ }
+ focus(sel);
+ arrange(selmon);
+}
+
+void
+pushup(const Arg *arg) {
+ Client *sel = selmon->sel, *c;
+
+ if(!sel || sel->isfloating)
+ return;
+ if((c = prevtiled(sel)) && c != nexttiled(selmon->clients)) {
+ detach(sel);
+ sel->next = c;
+ for(c = selmon->clients; c->next != sel->next; c = c->next);
+ c->next = sel;
+ }
+ focus(sel);
+ arrange(selmon);
+}
+
+void
quit(const Arg *arg)
{
running = 0;