summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2025-03-02 15:28:10 +0100
committerJoe <rbo@gmx.us>2025-03-02 15:28:10 +0100
commit8a3d0bd0dc0c1b9d0353672f112d6ecb0de20c6e (patch)
treeb1b93a3f4db9c2d476f2a899fc3c0f63499ea08c
parentnice nice (diff)
downloaddwl-8a3d0bd0dc0c1b9d0353672f112d6ecb0de20c6e.tar.gz
dwl-8a3d0bd0dc0c1b9d0353672f112d6ecb0de20c6e.tar.bz2
dwl-8a3d0bd0dc0c1b9d0353672f112d6ecb0de20c6e.tar.xz
dwl-8a3d0bd0dc0c1b9d0353672f112d6ecb0de20c6e.tar.zst
dwl-8a3d0bd0dc0c1b9d0353672f112d6ecb0de20c6e.zip
winviewed
-rw-r--r--config.def.h1
-rw-r--r--dwl.c12
-rw-r--r--patches/applied/winview-20240606.patch42
3 files changed, 55 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h
index 7593441..ef6bf0b 100644
--- a/config.def.h
+++ b/config.def.h
@@ -259,6 +259,7 @@ static const Key keys[] = {
{ MODKEY|META, XKB_KEY_l, shiftboth, { .i = +1 } },
{ MODKEY|SHIFT, XKB_KEY_Return, zoom, {0} },
{ META, XKB_KEY_Escape, view, {0} },
+ { MODKEY, XKB_KEY_o, winview, {0}},
{ MODKEY, XKB_KEY_q, killclient, {0} },
{ MODKEY, XKB_KEY_s, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_v, setlayout, {.v = &layouts[1]} },
diff --git a/dwl.c b/dwl.c
index d7da6e9..85eb527 100644
--- a/dwl.c
+++ b/dwl.c
@@ -414,6 +414,7 @@ static void urgent(struct wl_listener *listener, void *data);
static void view(const Arg *arg);
static void virtualkeyboard(struct wl_listener *listener, void *data);
static void virtualpointer(struct wl_listener *listener, void *data);
+static void winview(const Arg *a);
static void wmenuspawn(const Arg *arg);
static Monitor *xytomon(double x, double y);
static void xytonode(double x, double y, struct wlr_surface **psurface,
@@ -3757,6 +3758,17 @@ wmenuspawn(const Arg *arg)
free(cmd);
}
+void
+winview(const Arg *a) {
+ Arg b = {0};
+ Client *sel = focustop(selmon);
+ if(!sel)
+ return;
+ b.ui = sel -> tags;
+ view(&b);
+ return;
+}
+
Monitor *
xytomon(double x, double y)
{
diff --git a/patches/applied/winview-20240606.patch b/patches/applied/winview-20240606.patch
new file mode 100644
index 0000000..d3fc099
--- /dev/null
+++ b/patches/applied/winview-20240606.patch
@@ -0,0 +1,42 @@
+diff --git a/config.def.h b/config.def.h
+index a784eb4..d09ee55 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -140,6 +140,7 @@ static const Key keys[] = {
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
+ { MODKEY, XKB_KEY_e, togglefullscreen, {0} },
+ { MODKEY, XKB_KEY_0, view, {.ui = ~0} },
++ { MODKEY, XKB_KEY_o, winview, {0}},
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
+ { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
+ { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
+diff --git a/dwl.c b/dwl.c
+index 6f041a0..65df112 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -346,6 +346,7 @@ static void urgent(struct wl_listener *listener, void *data);
+ static void view(const Arg *arg);
+ static void virtualkeyboard(struct wl_listener *listener, void *data);
+ static void virtualpointer(struct wl_listener *listener, void *data);
++static void winview(const Arg *a);
+ static Monitor *xytomon(double x, double y);
+ static void xytonode(double x, double y, struct wlr_surface **psurface,
+ Client **pc, LayerSurface **pl, double *nx, double *ny);
+@@ -2877,6 +2878,17 @@ virtualpointer(struct wl_listener *listener, void *data)
+ wlr_cursor_map_input_to_output(cursor, &pointer.base, event->suggested_output);
+ }
+
++void
++winview(const Arg *a) {
++ Arg b = {0};
++ Client *sel = focustop(selmon);
++ if(!sel)
++ return;
++ b.ui = sel -> tags;
++ view(&b);
++ return;
++}
++
+ Monitor *
+ xytomon(double x, double y)
+ {