summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-10-02 00:03:21 +0200
committerbakkeby <[email protected]>2019-10-02 00:03:21 +0200
commit37b1b54ab9b79a144d6224264f39ad946aea5d4e (patch)
tree31f7baee32f4a97b350978fd963129520e74308e /patch
parent1cff0331278a2348046fcf27d13493abba3a5a4f (diff)
downloaddwm-flexipatch-37b1b54ab9b79a144d6224264f39ad946aea5d4e.tar.gz
dwm-flexipatch-37b1b54ab9b79a144d6224264f39ad946aea5d4e.zip
Adding fullscreen, holdbar and unfloatvisible patches
Diffstat (limited to 'patch')
-rw-r--r--patch/fullscreen.c13
-rw-r--r--patch/fullscreen.h1
-rw-r--r--patch/holdbar.c31
-rw-r--r--patch/holdbar.h3
-rw-r--r--patch/include.c12
-rw-r--r--patch/include.h12
-rw-r--r--patch/unfloatvisible.c14
-rw-r--r--patch/unfloatvisible.h1
8 files changed, 87 insertions, 0 deletions
diff --git a/patch/fullscreen.c b/patch/fullscreen.c
new file mode 100644
index 0000000..3ddb0e1
--- /dev/null
+++ b/patch/fullscreen.c
@@ -0,0 +1,13 @@
+Layout *last_layout;
+
+void
+fullscreen(const Arg *arg)
+{
+ if (selmon->showbar) {
+ for (last_layout = (Layout *)layouts; last_layout != selmon->lt[selmon->sellt]; last_layout++);
+ setlayout(&((Arg) { .v = &layouts[2] })); // <-- NB! hardcoded monocle
+ } else {
+ setlayout(&((Arg) { .v = last_layout }));
+ }
+ togglebar(arg);
+} \ No newline at end of file
diff --git a/patch/fullscreen.h b/patch/fullscreen.h
new file mode 100644
index 0000000..b380c2e
--- /dev/null
+++ b/patch/fullscreen.h
@@ -0,0 +1 @@
+static void fullscreen(const Arg *arg); \ No newline at end of file
diff --git a/patch/holdbar.c b/patch/holdbar.c
new file mode 100644
index 0000000..a7727b8
--- /dev/null
+++ b/patch/holdbar.c
@@ -0,0 +1,31 @@
+void
+holdbar(const Arg *arg)
+{
+ selmon->showbar = 1;
+ updateholdbarpos(selmon);
+ XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
+}
+
+void
+keyrelease(XEvent *e)
+{
+ if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY)) {
+ selmon->showbar = 0;
+ updateholdbarpos(selmon);
+ XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
+ arrange(selmon);
+ }
+}
+
+void
+updateholdbarpos(Monitor *m)
+{
+ m->wy = m->my;
+ m->wh = m->mh;
+ if (m->showbar) {
+ m->by = m->topbar ? m->wy : m->wy + m->wh - bh;
+ m->wy = m->topbar ? m->wy - bh + bh : m->wy;
+ } else {
+ m->by = -bh;
+ }
+} \ No newline at end of file
diff --git a/patch/holdbar.h b/patch/holdbar.h
new file mode 100644
index 0000000..719b9ea
--- /dev/null
+++ b/patch/holdbar.h
@@ -0,0 +1,3 @@
+static void keyrelease(XEvent *e);
+static void holdbar(const Arg *arg);
+static void updateholdbarpos(Monitor *m); \ No newline at end of file
diff --git a/patch/include.c b/patch/include.c
index 9fd267f..bb41382 100644
--- a/patch/include.c
+++ b/patch/include.c
@@ -36,6 +36,14 @@
#include "ewmhtags.c"
#endif
+#if FULLSCREEN_PATCH
+#include "fullscreen.c"
+#endif
+
+#if HOLDBAR_PATCH
+#include "holdbar.c"
+#endif
+
#if PERTAG_PATCH
#include "pertag.c"
#endif
@@ -78,6 +86,10 @@
#include "togglefullscreen.c"
#endif
+#if UNFLOATVISIBLE_PATCH
+#include "unfloatvisible.c"
+#endif
+
#if VANITYGAPS_PATCH
#include "vanitygaps.c"
#endif
diff --git a/patch/include.h b/patch/include.h
index cc6ac94..d19423e 100644
--- a/patch/include.h
+++ b/patch/include.h
@@ -36,6 +36,14 @@
#include "ewmhtags.h"
#endif
+#if FULLSCREEN_PATCH
+#include "fullscreen.h"
+#endif
+
+#if HOLDBAR_PATCH
+#include "holdbar.h"
+#endif
+
#if PERTAG_PATCH
#include "pertag.h"
#endif
@@ -78,6 +86,10 @@
#include "togglefullscreen.h"
#endif
+#if UNFLOATVISIBLE_PATCH
+#include "unfloatvisible.h"
+#endif
+
#if VANITYGAPS_PATCH
#include "vanitygaps.h"
#endif
diff --git a/patch/unfloatvisible.c b/patch/unfloatvisible.c
new file mode 100644
index 0000000..8f0360d
--- /dev/null
+++ b/patch/unfloatvisible.c
@@ -0,0 +1,14 @@
+void
+unfloatvisible(const Arg *arg)
+{
+ Client *c;
+
+ for (c = selmon->clients; c; c = c->next)
+ if (ISVISIBLE(c) && c->isfloating)
+ c->isfloating = c->isfixed;
+
+ if (arg && arg->v)
+ setlayout(arg);
+ else
+ arrange(selmon);
+} \ No newline at end of file
diff --git a/patch/unfloatvisible.h b/patch/unfloatvisible.h
new file mode 100644
index 0000000..690b6ef
--- /dev/null
+++ b/patch/unfloatvisible.h
@@ -0,0 +1 @@
+static void unfloatvisible(const Arg *arg); \ No newline at end of file