]> git.mdlowis.com Git - proto/labwc.git/commitdiff
rcxml: add some default keybinds
authorJohan Malm <jgm323@gmail.com>
Sun, 22 Aug 2021 16:00:22 +0000 (17:00 +0100)
committerJohan Malm <jgm323@gmail.com>
Sun, 22 Aug 2021 16:00:22 +0000 (17:00 +0100)
super-return - alacritty
alt-F4       - close window
super-a      - toggle maximize
alt-arrow    - move window to edge

README.md
src/config/rcxml.c

index a205e30da49f51a80eb5a908e723d6f55ddf6a3c..c6fc7885bef558ebd8a6b0caadb9103a966d1901 100644 (file)
--- a/README.md
+++ b/README.md
@@ -98,10 +98,13 @@ If you have not created an rc.xml config file, default binds will be:
 | ------------------- | ------
 | `alt`-`tab`         | activate next window
 | `alt`-`escape`      | exit
-| `alt`-`F3`          | launch bemenu
-| `alt`-`F4`          | close active window
+| `super`-`return`    | alacritty
+| `alt`-`F3`          | bemenu
+| `alt`-`F4`          | close window
+| `super`-`a`         | toggle maximize
 | `alt`-`mouse-left`  | move window
 | `alt`-`mouse-right` | resize window
+| `alt`-`arrow`       | move window to edge
 
 ## 6. Integrate
 
index f21122efa7ed59f2f0cee8185cfc7e9d2b9eedbc..7fdc7d18cbd4d17c69bf81a3ba6f1be74b4133c6 100644 (file)
@@ -29,6 +29,8 @@ enum font_place {
        /* TODO: Add all places based on Openbox's rc.xml */
 };
 
+static void load_default_key_bindings(void);
+
 static void
 fill_keybind(char *nodename, char *content)
 {
@@ -280,14 +282,27 @@ bind(const char *binding, const char *action, const char *command)
        }
 }
 
+static void
+load_default_key_bindings(void)
+{
+       bind("A-Tab", "NextWindow", NULL);
+       bind("A-Escape", "Exit", NULL);
+       bind("W-Return", "Execute", "alacritty");
+       bind("A-F3", "Execute", "bemenu-run");
+       bind("A-F4", "Close", NULL);
+       bind("W-a", "ToggleMaximize", NULL);
+       bind("A-Left", "MoveToEdge", "left");
+       bind("A-Right", "MoveToEdge", "right");
+       bind("A-Up", "MoveToEdge", "up");
+       bind("A-Down", "MoveToEdge", "down");
+}
+
 static void
 post_processing(void)
 {
        if (!wl_list_length(&rc.keybinds)) {
                wlr_log(WLR_INFO, "load default key bindings");
-               bind("A-Escape", "Exit", NULL);
-               bind("A-Tab", "NextWindow", NULL);
-               bind("A-F3", "Execute", "bemenu-run");
+               load_default_key_bindings();
        }
 
        if (!rc.font_name_activewindow) {