mirror of
https://github.com/LukeSmithxyz/dwm.git
synced 2026-10-05 14:22:31 +03:00
super+shift+g/; to send to prev/next window
i'll merge the functions later maybe lol
This commit is contained in:
+32
@@ -34,3 +34,35 @@ shiftview(const Arg *arg)
|
||||
view(&a);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
shifttag(const Arg *arg)
|
||||
{
|
||||
Arg a;
|
||||
Client *c;
|
||||
unsigned visible = 0;
|
||||
int i = arg->i;
|
||||
int count = 0;
|
||||
int nextseltags, curseltags = selmon->tagset[selmon->seltags];
|
||||
|
||||
do {
|
||||
if(i > 0) // left circular shift
|
||||
nextseltags = (curseltags << i) | (curseltags >> (LENGTH(tags) - i));
|
||||
|
||||
else // right circular shift
|
||||
nextseltags = curseltags >> (- i) | (curseltags << (LENGTH(tags) + i));
|
||||
|
||||
// Check if tag is visible
|
||||
for (c = selmon->clients; c && !visible; c = c->next)
|
||||
if (nextseltags & c->tags) {
|
||||
visible = 1;
|
||||
break;
|
||||
}
|
||||
i += arg->i;
|
||||
} while (!visible && ++count < 10);
|
||||
|
||||
if (count < 10) {
|
||||
a.i = nextseltags;
|
||||
tag(&a);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user