]> git.mdlowis.com Git - proto/labwc.git/commitdiff
rcxml: amend default keybinds
authorJohan Malm <jgm323@gmail.com>
Fri, 11 Sep 2020 19:51:25 +0000 (20:51 +0100)
committerJohan Malm <jgm323@gmail.com>
Fri, 11 Sep 2020 19:51:25 +0000 (20:51 +0100)
A-F2 to cycle view
A-F3 to launch dmenu_run

docs/labwc-config.5.md
src/config/rcxml.c

index 0a6468377666c774d6c8a68a07c671045dab40a5..57ecf2d77c86c0542ca06f402dd12c60af69226e 100644 (file)
@@ -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
index 46632814cf39d60e2a2ef7ead1a469b13d78d9a3..5ce5ed5617d0e47bc506cd797d85daf86ae35fed 100644 (file)
@@ -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)