From 92f6afdf651c448e7303dbdde562949b36812fda Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Fri, 11 Sep 2020 20:51:25 +0100 Subject: [PATCH] rcxml: amend default keybinds A-F2 to cycle view A-F3 to launch dmenu_run --- docs/labwc-config.5.md | 1 + src/config/rcxml.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/labwc-config.5.md b/docs/labwc-config.5.md index 0a646837..57ecf2d7 100644 --- a/docs/labwc-config.5.md +++ b/docs/labwc-config.5.md @@ -105,6 +105,7 @@ If no rc.xml file is found, the following default values will be used: - Alt+Escape: Exit labwc - Alt+Tab: Cycle windows +- Alt+F2: Cycle windows (if running on X11 and alt-tab bind already exists) - Alt+F3: Launch dmenu # SEE ALSO diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 46632814..5ce5ed56 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -219,14 +219,17 @@ static void rcxml_init() LIBXML_TEST_VERSION } -static void bind(const char *binding, const char *action) +static void bind(const char *binding, const char *action, const char *command) { if (!binding || !action) return; struct keybind *k = keybind_create(binding); - if (k) + if (!k) + return; + if (action) k->action = strdup(action); - info("binding %s: %s", binding, action); + if (command) + k->command = strdup(command); } static void set_title_height(void) @@ -241,8 +244,10 @@ static void post_processing(void) { if (!wl_list_length(&rc.keybinds)) { info("loading default key bindings"); - bind("A-Escape", "Exit"); - bind("A-Tab", "NextWindow"); + bind("A-Escape", "Exit", NULL); + bind("A-Tab", "NextWindow", NULL); + bind("A-F2", "NextWindow", NULL); + bind("A-F3", "Execute", "dmenu_run"); } if (!rc.theme_name)