From 31571be7f83b377044714889eee0dc98388ce541 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 15 May 2021 22:20:34 +0200 Subject: Copy of Christian Chiarulli's config --- patches/shiftview.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 patches/shiftview.c (limited to 'patches/shiftview.c') diff --git a/patches/shiftview.c b/patches/shiftview.c new file mode 100644 index 0000000..e82053a --- /dev/null +++ b/patches/shiftview.c @@ -0,0 +1,19 @@ +/** Function to shift the current view to the left/right + * + * @param: "arg->i" stores the number of tags to shift right (positive value) + * or left (negative value) + */ +void +shiftview(const Arg *arg) { + Arg shifted; + + if(arg->i > 0) // left circular shift + 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); +} -- cgit v1.2.3-70-g09d2