rcxml: amend default keybinds

A-F2 to cycle view
A-F3 to launch dmenu_run
This commit is contained in:
Johan Malm 2020-09-11 20:51:25 +01:00
parent fb6f7d42a5
commit 92f6afdf65
2 changed files with 11 additions and 5 deletions

View 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

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