dwm-flexipatch/patch/shiftview.c

16 lines
395 B
C
Raw Normal View History

2020-01-29 13:22:24 +00:00
void
shiftview(const Arg *arg)
{
Arg shifted;
2020-05-03 14:09:05 +00:00
if (arg->i > 0) // left circular shift
2020-01-29 13:22:24 +00:00
shifted.ui = (selmon->tagset[selmon->seltags] << arg->i)
| (selmon->tagset[selmon->seltags] >> (LENGTH(tags) - arg->i));
else // right circular shift
shifted.ui = selmon->tagset[selmon->seltags] >> (- arg->i)
| selmon->tagset[selmon->seltags] << (LENGTH(tags) + arg->i);
view(&shifted);
2020-05-03 14:09:05 +00:00
}