[wiki] [sites] Added focusadjacenttag patch || fabio
commit 1f223208e53904fcde80805bb74ddcecfcbcaa3d
Author: fabio <fbanfi90_AT_gmail.com>
Date: Tue Jun 24 17:55:29 2014 +0200
Added focusadjacenttag patch
diff --git a/dwm.suckless.org/patches/dwm-6.0-focusadjacenttag.diff b/dwm.suckless.org/patches/dwm-6.0-focusadjacenttag.diff
new file mode 100644
index 0000000..cd34fc6
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.0-focusadjacenttag.diff
_AT_@ -0,0 +1,115 @@
+diff -up a/config.h b/config.h
+--- a/config.h 2014-06-23 18:04:29.536917000 +0200
++++ b/config.h 2014-06-24 08:15:51.857173332 +0200
+_AT_@ -74,6 +74,10 @@ static Key keys[] = {
+ { MODKEY, XK_period, focusmon, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
+ { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
++ { MODKEY, XK_Left, viewtoleft, {0} },
++ { MODKEY, XK_Right, viewtoright, {0} },
++ { MODKEY|ShiftMask, XK_Left, tagtoleft, {0} },
++ { MODKEY|ShiftMask, XK_Right, tagtoright, {0} },
+ TAGKEYS( XK_1, 0)
+ TAGKEYS( XK_2, 1)
+ TAGKEYS( XK_3, 2)
+diff -up a/dwm.1 b/dwm.1
+--- a/dwm.1 2014-06-23 18:04:29.532917821 +0200
++++ b/dwm.1 2014-06-23 21:52:54.095867809 +0200
+_AT_@ -71,6 +71,18 @@ Send focused window to previous screen,
+ .B Mod1\-Shift\-.
+ Send focused window to next screen, if any.
+ .TP
++.B Mod1\-Right
++Focus tag on the right, if any.
++.TP
++.B Mod1\-Left
++Focus tag on the left, if any.
++.TP
++.B Mod1\-Shift\-Right
++Send focused window to tag on the right, if any.
++.TP
++.B Mod1\-Shift\-Left
++Send focused window to tag on the left, if any.
++.TP
+ .B Mod1\-b
+ Toggles bar on and off.
+ .TP
+diff -up a/dwm.c b/dwm.c
+--- a/dwm.c 2014-06-23 18:04:29.532917821 +0200
++++ b/dwm.c 2014-06-24 08:17:40.921714154 +0200
+_AT_@ -226,6 +226,8 @@ static void sigchld(int unused);
+ static void spawn(const Arg *arg);
+ static void tag(const Arg *arg);
+ static void tagmon(const Arg *arg);
++static void tagtoleft(const Arg *arg);
++static void tagtoright(const Arg *arg);
+ static int textnw(const char *text, unsigned int len);
+ static void tile(Monitor *);
+ static void togglebar(const Arg *arg);
+_AT_@ -245,6 +247,8 @@ static void updatewindowtype(Client *c);
+ static void updatetitle(Client *c);
+ static void updatewmhints(Client *c);
+ static void view(const Arg *arg);
++static void viewtoleft(const Arg *arg);
++static void viewtoright(const Arg *arg);
+ static Client *wintoclient(Window w);
+ static Monitor *wintomon(Window w);
+ static int xerror(Display *dpy, XErrorEvent *ee);
+_AT_@ -1690,6 +1694,28 @@ tagmon(const Arg *arg) {
+ sendmon(selmon->sel, dirtomon(arg->i));
+ }
+
++void
++tagtoleft(const Arg *arg) {
++ if(selmon->sel != NULL
++ && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
++ && selmon->tagset[selmon->seltags] > 1) {
++ selmon->sel->tags >>= 1;
++ focus(NULL);
++ arrange(selmon);
++ }
++}
++
++void
++tagtoright(const Arg *arg) {
++ if(selmon->sel != NULL
++ && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
++ && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
++ selmon->sel->tags <<= 1;
++ focus(NULL);
++ arrange(selmon);
++ }
++}
++
+ int
+ textnw(const char *text, unsigned int len) {
+ XRectangle r;
+_AT_@ -2052,6 +2078,28 @@ view(const Arg *arg) {
+ arrange(selmon);
+ }
+
++void
++viewtoleft(const Arg *arg) {
++ if(__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
++ && selmon->tagset[selmon->seltags] > 1) {
++ selmon->seltags ^= 1; /* toggle sel tagset */
++ selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1;
++ focus(NULL);
++ arrange(selmon);
++ }
++}
++
++void
++viewtoright(const Arg *arg) {
++ if(__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
++ && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
++ selmon->seltags ^= 1; /* toggle sel tagset */
++ selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1;
++ focus(NULL);
++ arrange(selmon);
++ }
++}
++
+ Client *
+ wintoclient(Window w) {
+ Client *c;
diff --git a/dwm.suckless.org/patches/focusadjacenttag.md b/dwm.suckless.org/patches/focusadjacenttag.md
new file mode 100644
index 0000000..f4b9b9c
--- /dev/null
+++ b/dwm.suckless.org/patches/focusadjacenttag.md
_AT_@ -0,0 +1,28 @@
+focus adjacent tag
+==================
+
+Description
+-----------
+
+This patch provides the ability to focus the tag on the immediate left or right
+of the currently focused tag. It also allows to send the focused window either
+on the left or the right tag.
+
+Default key bindings
+--------------------
+
+ Key | Description
+:-------------------:|:--------------------------------------------------
+ `Mod-Left` | Focus tag on the left, if any.
+ `Mod-Right` | Focus tag on the right, if any.
+ `Mod-Shift-Left` | Send focused window to tag on the left, if any.
+ `Mod-Shift-Right` | Send focused window to tag on the right, if any.
+
+Download
+--------
+
+ * [dwm-6.0-focusadjacenttag.diff](dwm-6.0-focusadjacenttag.diff) (3740b) (20140624)
+
+Authors
+-------
+ * Fabio Banfi - `<fbanfi90 at gmail dot com>`
\ No newline at end of file
Received on Tue Jun 24 2014 - 17:56:20 CEST
This archive was generated by hypermail 2.3.0
: Thu Jun 18 2015 - 17:39:09 CEST