[wiki] [sites] wiki updated

From: <hg_AT_suckless.org>
Date: Fri, 24 Dec 2010 17:18:09 +0000 (UTC)

changeset: 666:d9fa8a2ad430
tag: tip
user: Rob Pilling <my name at gmail dot com>
date: Fri Dec 24 17:17:27 2010 +0000
files: dwm.suckless.org/patches/nextprev.md dwm.suckless.org/patches/nextprevtag.c
description:
Added nextprevtag 'patch'


diff -r 938fa466c102 -r d9fa8a2ad430 dwm.suckless.org/patches/nextprev.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/nextprev.md Fri Dec 24 17:17:27 2010 +0000
_AT_@ -0,0 +1,30 @@
+# NEXT PREV TAG
+
+## Description
+
+ * increment or decrement the selected tag
+
+## Download
+
+ * [nextprevtag.c](nextprevtag.c)
+
+## Example Usage
+
+ static Key keys[] = {
+ /* ... */
+ { MODKEY, XK_i, view_adjacent, { .i = +1 } },
+ { MODKEY, XK_u, view_adjacent, { .i = -1 } },
+ /* ... */
+ };
+
+ static Button buttons[] = {
+ /* ... */
+ { ClkTagBar, 0, Button4, view_adjacent, { .i = -1 } },
+ { ClkTagBar, 0, Button5, view_adjacent, { .i = +1 } },
+ /* ... */
+ };
+
+
+## Author
+
+ * Rob Pilling - robpilling gmail com
diff -r 938fa466c102 -r d9fa8a2ad430 dwm.suckless.org/patches/nextprevtag.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/nextprevtag.c Fri Dec 24 17:17:27 2010 +0000
_AT_@ -0,0 +1,21 @@
+void
+view_adjacent(const Arg *arg)
+{
+ int i, curtags;
+ int seltag = 0;
+ Arg a;
+
+ curtags = selmon->tagset[selmon->seltags];
+ for(i = 0; i < LENGTH(tags); i++)
+ if(curtags & (1 << i)){
+ seltag = i;
+ break;
+ }
+
+ seltag = (seltag + arg->i) % (int)LENGTH(tags);
+ if(seltag < 0)
+ seltag += LENGTH(tags);
+
+ a.i = (1 << seltag);
+ view(&a);
+}
Received on Fri Dec 24 2010 - 18:18:09 CET

This archive was generated by hypermail 2.3.0 : Thu Sep 13 2012 - 19:31:34 CEST