sites

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

commit 6e984b611a99ce196c95b523acaac8fe6dc1e492
parent b586df664ade0333b5adafd66fb57645d5f153a6
Author: Wolf Tivy <wolf@tivy.com>
Date:   Sat, 30 Oct 2010 11:00:34 -0700

Added combo patch to dwm patches page.
Diffstat:
Adwm.suckless.org/patches/combo.md | 24++++++++++++++++++++++++
Adwm.suckless.org/patches/dwm-5.9-combo.diff | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 88 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/combo.md b/dwm.suckless.org/patches/combo.md @@ -0,0 +1,24 @@ +# COMBO + +## Description +This patch tweaks the tagging interface so that you can select multiple tags +for tag or view by pressing all the right keys as a combo. For example to +view tags 1 and 3, hold MOD and then press and hold 1 and 3 together. + +This makes selecting multiple tags very easy and fluid. With this patch, +tagging goes from being a cool generalization of workspaces to something +actually usable. + +## Applying +The patch adds two functions that you have to know about: combotag and +comboview. Replace the tag and view functions with these in TAGKEYS and any +other places you want. combotag and comboview are totally compatible with tag +and view so you could replace all usages if you wanted. + +## Download + + * [dwm-5.9-combo.diff](dwm-5.9-combo.diff) (2010-10-30) + +## Author + + * Wolf Tivy - wolf at tivy dot com. diff --git a/dwm.suckless.org/patches/dwm-5.9-combo.diff b/dwm.suckless.org/patches/dwm-5.9-combo.diff @@ -0,0 +1,64 @@ +diff -r c361034c5a1c dwm.c +--- a/dwm.c Sat Sep 11 19:00:18 2010 +0000 ++++ b/dwm.c Wed Sep 22 17:44:34 2010 -0700 +@@ -243,6 +243,11 @@ + static int xerrorstart(Display *dpy, XErrorEvent *ee); + static void zoom(const Arg *arg); + ++static void keyrelease(XEvent *e); ++static void combotag(const Arg *arg); ++static void comboview(const Arg *arg); ++ ++ + /* variables */ + static const char broken[] = "broken"; + static char stext[256]; +@@ -260,6 +265,7 @@ + [EnterNotify] = enternotify, + [Expose] = expose, + [FocusIn] = focusin, ++ [KeyRelease] = keyrelease, + [KeyPress] = keypress, + [MappingNotify] = mappingnotify, + [MapRequest] = maprequest, +@@ -282,6 +288,40 @@ + struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; + + /* function implementations */ ++static int combo = 0; ++ ++void ++keyrelease(XEvent *e) { ++ combo = 0; ++} ++ ++void ++combotag(const Arg *arg) { ++ if(selmon->sel && arg->ui & TAGMASK) { ++ if (combo) { ++ selmon->sel->tags |= arg->ui & TAGMASK; ++ } else { ++ combo = 1; ++ selmon->sel->tags = arg->ui & TAGMASK; ++ } ++ arrange(selmon); ++ } ++} ++ ++void ++comboview(const Arg *arg) { ++ unsigned newtags = arg->ui & TAGMASK; ++ if (combo) { ++ selmon->tagset[selmon->seltags] |= newtags; ++ } else { ++ selmon->seltags ^= 1; /*toggle tagset*/ ++ combo = 1; ++ if (newtags) ++ selmon->tagset[selmon->seltags] = newtags; ++ } ++ arrange(selmon); ++} ++ + void + applyrules(Client *c) { + const char *class, *instance;