diff options
Diffstat (limited to 'dwl.c')
-rw-r--r-- | dwl.c | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -383,6 +383,8 @@ static void setmon(Client *c, Monitor *m, uint32_t newtags); static void setpsel(struct wl_listener *listener, void *data); static void setsel(struct wl_listener *listener, void *data); static void setup(void); +static void shiftboth(const Arg *arg); +static void shiftview(const Arg *arg); static void spawn(const Arg *arg); static void startdrag(struct wl_listener *listener, void *data); static int statusin(int fd, unsigned int mask, void *data); @@ -3069,6 +3071,35 @@ setup(void) } #endif } +void +shiftboth(const Arg *arg) +{ + Arg shifted; + shifted.ui = selmon->tagset[selmon->seltags]; + + if (arg->i > 0) /* left circular shift */ + shifted.ui = ((shifted.ui << arg->i) | (shifted.ui >> (LENGTH(tags) - arg->i))); + else /* right circular shift */ + shifted.ui = ((shifted.ui >> (- arg->i) | shifted.ui << (LENGTH(tags) + arg->i))); + tag(&shifted); + view(&shifted); +} + +void +shiftview(const Arg *arg) +{ + Arg shifted; + shifted.ui = selmon->tagset[selmon->seltags]; + + if (arg->i > 0) { /* left circular shift */ + shifted.ui = (shifted.ui << arg->i) | (shifted.ui >> (LENGTH(tags) - arg->i)); + // shifted.ui &= ~SPTAGMASK; + } else { /* right circular shift */ + shifted.ui = (shifted.ui >> (- arg->i) | shifted.ui << (LENGTH(tags) + arg->i)); + // shifted.ui &= ~SPTAGMASK; + } + view(&shifted); +} void spawn(const Arg *arg) |