rcxml: add some default keybinds

super-return - alacritty
alt-F4       - close window
super-a      - toggle maximize
alt-arrow    - move window to edge
This commit is contained in:
Johan Malm 2021-08-22 17:00:22 +01:00
parent 0aee42473b
commit 93244cfbe1
2 changed files with 23 additions and 5 deletions

View file

@ -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

View 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) {