sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 52fb65a3ecadb3d44f36b71d7b76d987359905bc
parent 51b19debbea299d125aa75029faaba3bbc817346
Author: Philippe Gras <philippe.gras@free.fr>
Date:   Thu, 25 Jul 2013 23:46:43 +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.

Diffstat:
Adwm.suckless.org/patches/dwm-6.0-winview.diff | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/winview.md | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 117 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/dwm-6.0-winview.diff b/dwm.suckless.org/patches/dwm-6.0-winview.diff @@ -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 +@@ -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 +@@ -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 +@@ -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); +@@ -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 @@ -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>` +