diff --git a/keybinds.h b/keybinds.h index 121347f..0ef9db6 100644 --- a/keybinds.h +++ b/keybinds.h @@ -52,6 +52,7 @@ static Key keys[] = { { 0, SHIFT, XK_minus, setimgsize, {.i = -100 } }, { 0, SHIFT, XK_0, defaultimg, {0} }, { 0, 0, XK_r, rotateimg, {0} }, + { 0, SHIFT, XK_r, setimgpos, {0} }, { 0, 0, XK_t, toggleimg, {0} }, { 0, 0, XK_h, flipimg, {.i = 1 } }, { 0, 0, XK_v, flipimg, {.i = 0 } }, diff --git a/libs/arg.c b/libs/arg.c index 1faddd3..ecc72f1 100644 --- a/libs/arg.c +++ b/libs/arg.c @@ -322,6 +322,18 @@ flipimg(const Arg *arg) drawmenu(); } +void +setimgpos(const Arg *arg) +{ + if (imageposition++ > 3) { + imageposition = 0; + } else { + imageposition++; + } + + drawmenu(); +} + void rotateimg(const Arg *arg) { diff --git a/libs/arg.h b/libs/arg.h index 3f7f0bb..269b12e 100644 --- a/libs/arg.h +++ b/libs/arg.h @@ -27,3 +27,4 @@ static void toggleimg(const Arg *arg); static void defaultimg(const Arg *arg); static void rotateimg(const Arg *arg); static void flipimg(const Arg *arg); +static void setimgpos(const Arg *arg);