[wiki] [sites] winview || Philippe Gras
commit 52fb65a3ecadb3d44f36b71d7b76d987359905bc
Author: Philippe Gras <philippe.gras_AT_free.fr>
Date: Thu Jul 25 23:46:43 2013 +0200
winview
Add winview command. The Mod1-o key will switch to the view of the
window in focus. The list of tags to be displayed is matched to the
window tag list.
diff --git a/dwm.suckless.org/patches/dwm-6.0-winview.diff b/dwm.suckless.org/patches/dwm-6.0-winview.diff
new file mode 100644
index 0000000..1b796b5
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.0-winview.diff
_AT_@ -0,0 +1,65 @@
+diff --git a/config.def.h b/config.def.h
+index 77ff358..3ba0efe 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -84,6 +84,7 @@ static Key keys[] = {
+ TAGKEYS( XK_8, 7)
+ TAGKEYS( XK_9, 8)
+ { MODKEY|ShiftMask, XK_q, quit, {0} },
++ { MODKEY, XK_o, winview, {0} },
+ };
+
+ /* button definitions */
+diff --git a/dwm.1 b/dwm.1
+index 5268a06..1188c82 100644
+--- a/dwm.1
++++ b/dwm.1
+_AT_@ -104,6 +104,9 @@ Increase master area size.
+ .B Mod1\-h
+ Decrease master area size.
+ .TP
++.B Mod1\-o
++Select view of the window in focus. The list of tags to be displayed is matched to the window tag list.
++.TP
+ .B Mod1\-Return
+ Zooms/cycles focused window to/from master area (tiled layouts only).
+ .TP
+diff --git a/dwm.c b/dwm.c
+index 1d78655..abf944c 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -247,6 +247,7 @@ static void updatewmhints(Client *c);
+ static void view(const Arg *arg);
+ static Client *wintoclient(Window w);
+ static Monitor *wintomon(Window w);
++static void winview(const Arg* arg);
+ static int xerror(Display *dpy, XErrorEvent *ee);
+ static int xerrordummy(Display *dpy, XErrorEvent *ee);
+ static int xerrorstart(Display *dpy, XErrorEvent *ee);
+_AT_@ -2080,6 +2081,26 @@ wintomon(Window w) {
+ return selmon;
+ }
+
++/* Selects for the view of the focused window. The list of tags */
++/* to be displayed is matched to the focused window tag list. */
++void
++winview(const Arg* arg){
++ Window win, win_r, win_p, *win_c;
++ unsigned nc;
++ int unused;
++ Client* c;
++ Arg a;
++
++ if (!XGetInputFocus(dpy, &win, &unused)) return;
++ while(XQueryTree(dpy, win, &win_r, &win_p, &win_c, &nc)
++ && win_p != win_r) win = win_p;
++
++ if (!(c = wintoclient(win))) return;
++
++ a.ui = c->tags;
++ view(&a);
++}
++
+ /* There's no way to check accesses to destroyed windows, thus those cases are
+ * ignored (especially on UnmapNotify's). Other types of errors call Xlibs
+ * default error handler, which may call exit. */
diff --git a/dwm.suckless.org/patches/winview.md b/dwm.suckless.org/patches/winview.md
new file mode 100644
index 0000000..cf8c7a2
--- /dev/null
+++ b/dwm.suckless.org/patches/winview.md
_AT_@ -0,0 +1,52 @@
+Winview
+========
+
+Description
+-----------
+
+Adds a command to select the view of a window. The list of tags to be displayed
+is matched to the window tag list. This command is typically used from the
+all-window view.
+
+Usage
+-----
+
+The winview command is assigned by default to the key `Mod1-o`. To select the
+view of a window which is not currently displayed, move to the all-window view
+with `Mod1-0` key, give focus to this window (using the mouse or `Mod1-j`/`k`
+keys) and switch to the window view with `Mod1-o`. We recommend [grid](grid)
+layout for the all-window view, this layout is well adapted to display many
+windows in a limited space.
+
+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
+
+<ul>
+<li>Apply the patch;
+<li>Add the following element in the keys array:
+</ul>
+ { MODKEY, XK_o, winview, {0} },
+<ul>
+<li>Run make and make install.
+</ul>
+
+An example of how to insert this line can be found in the default config file
+template, config.def.h.
+
+Download
+--------
+
+ * [dwm-6.0-winview.diff](dwm-6.0-winview.diff)
+
+Author
+------
+ * Philippe Gras - `<philippe dot gras at free dot fr>`
+
Received on Thu Jul 25 2013 - 23:47:22 CEST
This archive was generated by hypermail 2.3.0
: Thu Jun 18 2015 - 17:37:42 CEST