diff options
author | Leonard Kugis <leonard@kug.is> | 2025-05-23 11:41:09 +0000 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2025-05-23 11:41:09 +0000 |
commit | c70505d7c7b7b48600f273357694b56ccf5d2a15 (patch) | |
tree | 21c27ac6ffced8d6d904e35bdb39baa5d685d829 /dwl-patches/patches/winview | |
download | dotfiles-master.tar.gz dotfiles-master.tar.bz2 dotfiles-master.zip |
Diffstat (limited to 'dwl-patches/patches/winview')
-rw-r--r-- | dwl-patches/patches/winview/README.md | 35 | ||||
-rw-r--r-- | dwl-patches/patches/winview/winview-20240606.patch | 42 | ||||
-rw-r--r-- | dwl-patches/patches/winview/winview.patch | 42 |
3 files changed, 119 insertions, 0 deletions
diff --git a/dwl-patches/patches/winview/README.md b/dwl-patches/patches/winview/README.md new file mode 100644 index 0000000..4fb8dd5 --- /dev/null +++ b/dwl-patches/patches/winview/README.md @@ -0,0 +1,35 @@ +### Description +Implements the function `winview` which switches the visible tags to the tags on which the current client is visible. + +This patch is inspired from <https://dwm.suckless.org/patches/winview/>. Citing the description of the dwm patch: + +> Dwm tags are a powerfull feature that allows organizing windows in workspaces. Sometime it can be difficult to remember the tag to activate to unhide a window. With the winview patch the window to unhide can be selected from the all-window view. The user switches to the all-window view (Mod1-0), selects the window (Mod1-j/k or using the mouse) and press Mod1-o. The key Mod1-o switches the view to the selected window tag. +> +> #### Recommend patches +> +> The grid layout is well adapted to display many windows in a limited space. Using both grid and pertag patches you will be able to select this layout for the all-window view while keeping your preferred layout for the other views. +> Configuration and Installation +> Using the default configuration file +> +> Make sure the directory where you build dwm does not contain a config.h file; +> Apply the patch; +> Run make and make install. +> +> Using an existing customised configuration file +> +> Apply the patch; Add the following element in the keys array: +> +> `{ MODKEY, XK_o, winview, {0} },` +> +> Run make and make install. +> +> An example of how to insert this line can be found in the default config file template, config.def.h. + +### Download +- [2024-09-18](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/winview/winview.patch) +- [2024-06-06](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/winview/winview-20240606.patch) +- [git branch](https://codeberg.org/dhruva_sambrani/dwl/src/branch/winview) + +### Authors +- [Dhruva Sambrani](https://codeberg.org/dhruva_sambrani) + diff --git a/dwl-patches/patches/winview/winview-20240606.patch b/dwl-patches/patches/winview/winview-20240606.patch new file mode 100644 index 0000000..d3fc099 --- /dev/null +++ b/dwl-patches/patches/winview/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) + { diff --git a/dwl-patches/patches/winview/winview.patch b/dwl-patches/patches/winview/winview.patch new file mode 100644 index 0000000..66e6b20 --- /dev/null +++ b/dwl-patches/patches/winview/winview.patch @@ -0,0 +1,42 @@ +diff --git a/config.def.h b/config.def.h +index 22d2171..b812525 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -143,6 +143,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 dc0c861..5c6862c 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -351,6 +351,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); +@@ -2942,6 +2943,17 @@ virtualpointer(struct wl_listener *listener, void *data) + wlr_cursor_map_input_to_output(cursor, device, 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) + { |