summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-03-09 16:23:47 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-03-09 16:23:47 +0530
commitfe143f5a101b3932fbfab3009a09e8ec549bda26 (patch)
tree9e6906439771461db4235dd3d3a5a95f145ac95e
parent38a1bfdcd5857eb8ade5bfa973044da9456e49e0 (diff)
Personal changes to applied adjacenttag-skipvacant patch
-rw-r--r--config.h6
-rwxr-xr-xdwmbin80648 -> 80456 bytes
-rw-r--r--dwm.c61
-rw-r--r--dwm.obin77816 -> 76992 bytes
4 files changed, 9 insertions, 58 deletions
diff --git a/config.h b/config.h
index bfe056d..90a083f 100644
--- a/config.h
+++ b/config.h
@@ -107,10 +107,8 @@ 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_Right, viewnext, {0} },
- { MODKEY, XK_Left, viewprev, {0} },
- { MODKEY|ShiftMask, XK_Right, tagtonext, {0} },
- { MODKEY|ShiftMask, XK_Left, tagtoprev, {0} },
+ { ALTKEY, XK_Tab, viewnext, {0} },
+ { ALTKEY|ShiftMask, XK_Tab, viewnextnoskip, {0} },
{ MODKEY, XK_minus, setgaps, {.i = -1 } },
{ MODKEY, XK_equal, setgaps, {.i = +1 } },
{ MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
diff --git a/dwm b/dwm
index c6272a5..08d4086 100755
--- a/dwm
+++ b/dwm
Binary files differ
diff --git a/dwm.c b/dwm.c
index 20c2696..98d6ece 100644
--- a/dwm.c
+++ b/dwm.c
@@ -241,7 +241,7 @@ static void movemouse(const Arg *arg);
static unsigned int nexttag(void);
static Client *nexttiled(Client *c);
static void pop(Client *);
-static unsigned int prevtag(void);
+static unsigned int nexttagnoskip(void);
static void propertynotify(XEvent *e);
static void quit(const Arg *arg);
static Monitor *recttomon(int x, int y, int w, int h);
@@ -272,8 +272,6 @@ static void spawn(const Arg *arg);
static Monitor *systraytomon(Monitor *m);
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
-static void tagtonext(const Arg *arg);
-static void tagtoprev(const Arg *arg);
static void tile(Monitor *);
static void togglebar(const Arg *arg);
static void togglefloating(const Arg *arg);
@@ -298,7 +296,7 @@ static void updatewindowtype(Client *c);
static void updatewmhints(Client *c);
static void view(const Arg *arg);
static void viewnext(const Arg *arg);
-static void viewprev(const Arg *arg);
+static void viewnextnoskip(const Arg *arg);
static Client *wintoclient(Window w);
static Monitor *wintomon(Window w);
static Client *wintosystrayicon(Window w);
@@ -1526,25 +1524,10 @@ pop(Client *c)
}
unsigned int
-prevtag(void)
+nexttagnoskip(void)
{
- unsigned int seltag = selmon->tagset[selmon->seltags];
- unsigned int usedtags = 0;
- Client *c = selmon->clients;
- if (!c)
- return seltag;
-
- /* skip vacant tags */
- do {
- usedtags |= c->tags;
- c = c->next;
- } while (c);
-
- do {
- seltag = seltag == 1 ? (1 << (LENGTH(tags) - 1)) : seltag >> 1;
- } while (!(seltag & usedtags));
-
- return seltag;
+ unsigned int seltag = selmon->tagset[selmon->seltags];
+ return seltag == (1 << (LENGTH(tags) - 1)) ? 1 : seltag << 1;
}
void
@@ -2104,36 +2087,6 @@ tagmon(const Arg *arg)
}
void
-tagtonext(const Arg *arg)
-{
- unsigned int tmp;
-
- if (selmon->sel == NULL)
- return;
-
- if ((tmp = nexttag()) == selmon->tagset[selmon->seltags])
- return;
-
- tag(&(const Arg){.ui = tmp });
- view(&(const Arg){.ui = tmp });
-}
-
-void
-tagtoprev(const Arg *arg)
-{
- unsigned int tmp;
-
- if (selmon->sel == NULL)
- return;
-
- if ((tmp = prevtag()) == selmon->tagset[selmon->seltags])
- return;
-
- tag(&(const Arg){.ui = tmp });
- view(&(const Arg){.ui = tmp });
-}
-
-void
tile(Monitor *m)
{
unsigned int i, n, h, mw, my, ty;
@@ -2821,9 +2774,9 @@ viewnext(const Arg *arg)
}
void
-viewprev(const Arg *arg)
+viewnextnoskip(const Arg *arg)
{
- view(&(const Arg){.ui = prevtag()});
+ view(&(const Arg){.ui = nexttagnoskip()});
}
Client *
diff --git a/dwm.o b/dwm.o
index 3b5f68c..d412ae4 100644
--- a/dwm.o
+++ b/dwm.o
Binary files differ