From e56b82e89639d3699cee8ada8eac7e8507e8c864 Mon Sep 17 00:00:00 2001 From: emersion Date: Sun, 7 Jan 2018 00:37:36 +0100 Subject: rootston: add toggle_outputs command --- rootston/keyboard.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'rootston/keyboard.c') diff --git a/rootston/keyboard.c b/rootston/keyboard.c index 7b281308..14199afd 100644 --- a/rootston/keyboard.c +++ b/rootston/keyboard.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -85,6 +86,8 @@ static void pressed_keysyms_update(xkb_keysym_t *pressed_keysyms, static const char *exec_prefix = "exec "; +static bool outputs_enabled = true; + static void keyboard_binding_execute(struct roots_keyboard *keyboard, const char *command) { struct roots_seat *seat = keyboard->seat; @@ -119,6 +122,12 @@ static void keyboard_binding_execute(struct roots_keyboard *keyboard, } } else if (strcmp(command, "nop") == 0) { wlr_log(L_DEBUG, "nop command"); + } else if (strcmp(command, "toggle_outputs") == 0) { + outputs_enabled = !outputs_enabled; + struct roots_output *output; + wl_list_for_each(output, &keyboard->input->server->desktop->outputs, link) { + wlr_output_enable(output->wlr_output, outputs_enabled); + } } else { wlr_log(L_ERROR, "unknown binding command: %s", command); } -- cgit v1.2.3