aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.def.h2
-rw-r--r--monsterwm.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h
index 666a11d..1dfe4fe 100644
--- a/config.def.h
+++ b/config.def.h
@@ -61,6 +61,8 @@ static Key keys[] = {
{ MOD1|SHIFT, XK_c, killclient, {NULL}},
{ MOD1, XK_j, next_win, {NULL}},
{ MOD1, XK_k, prev_win, {NULL}},
+ { MOD1|CONTROL, XK_h, rotate, {.i = -1}},
+ { MOD1|CONTROL, XK_l, rotate, {.i = +1}},
{ MOD1, XK_Tab, last_desktop, {NULL}},
{ MOD1, XK_Return, swap_master, {NULL}},
{ MOD1|SHIFT, XK_j, move_down, {NULL}},
diff --git a/monsterwm.c b/monsterwm.c
index 52cbd61..78cb34a 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -90,6 +90,7 @@ static void mousemotion(const Arg *arg);
static void next_win();
static void prev_win();
static void quit(const Arg *arg);
+static void rotate(const Arg *arg);
static void spawn(const Arg *arg);
static void swap_master();
static void switch_mode(const Arg *arg);
@@ -941,6 +942,13 @@ void removeclient(Client *c, Desktop *d) {
}
/**
+ * jump and focus the next or previous desktop
+ */
+void rotate(const Arg *arg) {
+ change_desktop(&(Arg){.i = (DESKTOPS + currdeskidx + arg->i) % DESKTOPS});
+}
+
+/**
* main event loop
* on receival of an event call the appropriate handler
*/