From b7573c8d361b9c15e35b697401686684d50cbc23 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Sun, 22 Aug 2021 19:09:31 +0100 Subject: [PATCH] rcxml: load default keybinds on This is an addition to the openbox specification and provides a way to keep config files simpler whilst allowing user-specific keybinds. docs/rc.xml shows a simple config file with docs/rc.xml.full shows the full config --- README.md | 3 ++ docs/labwc-config.5.scd | 32 +++++++++--------- docs/rc.xml | 31 +++-------------- docs/rc.xml.all | 74 +++++++++++++++++++++++++++++++++++++++++ src/config/rcxml.c | 7 ++++ 5 files changed, 105 insertions(+), 42 deletions(-) create mode 100644 docs/rc.xml.all diff --git a/README.md b/README.md index c6fc7885..b46c449c 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,8 @@ Labwc uses the files listed below for configuration and theming. | [environment] | ~/.config/labwc/ | [labwc-environment(5)] | [themerc] | ~/.local/share/themes/\/openbox-3/ | [labwc-theme(5)] +The example [rc.xml] has been kept simple. For all options and default values, see [rc.xml.full] + Configuration and theme files are re-loaded on receiving SIGHUP (e.g. `killall -SIGHUP labwc`) For keyboard settings, see [environment] and [xkeyboard-config(7)] @@ -140,6 +142,7 @@ High-level summary of items which are not inteded to be implemented: [openbox-3.4]: https://github.com/danakj/openbox [rc.xml]: docs/rc.xml +[rc.xml.full]: docs/rc.xml.full [menu.xml]: docs/menu.xml [autostart]: docs/autostart [environment]: docs/environment diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index 494c58e0..a343875c 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -25,8 +25,8 @@ Configuration must be wrapped in a root-node. Default is server. ** - The gap in pixels between views and output edges when using movement - actions, for example MoveToEdge. Default is 0. + The distance in pixels between views and output edges when using + movement actions, for example MoveToEdge. Default is 0. # FOCUS @@ -71,22 +71,22 @@ Configuration must be wrapped in a root-node. ** Keybind action. See labwc-action(5) -Default key-binds if no rc.xml is found: +** + Load the default keybinds listed below. This is an addition to the + openbox specification and provides a way to keep config files simpler + whilst allowing your specific keybinds. + Note that if no rc.xml is found, or if no entries + exist, the same default keybinds will be loaded even if the + element is not provided. ``` - - - - - - - - - - bemenu-run - - - + A-Tab - next window + A-Escape - exit + W-Return - alacritty + A-F3 - run bemenu + A-F4 - close window + W-a - toggle maximize + A- - move window to edge ``` # SEE ALSO diff --git a/docs/rc.xml b/docs/rc.xml index 7ec6c6d7..9f4bff4f 100644 --- a/docs/rc.xml +++ b/docs/rc.xml @@ -8,35 +8,14 @@ 8 - Sans12 + sans10 - - no - no - - - - - - - sakura - bemenu-run - - - - left - right - up - down + + + sakura + diff --git a/docs/rc.xml.all b/docs/rc.xml.all new file mode 100644 index 00000000..48fcf7ac --- /dev/null +++ b/docs/rc.xml.all @@ -0,0 +1,74 @@ + + + + + + + + server + 10 + + + + + 8 + + + sans10 + sans10 + + + + no + no + + + + + + + + + + + + + + + + alacritty + + + bemenu-run + + + + + + + + + left + + + right + + + up + + + down + + + + diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 7fdc7d18..2371482c 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -152,6 +152,13 @@ entry(xmlNode *node, char *nodename, char *content) printf("%s: %s\n", nodename, content); } + /* handle nodes without content, e.g. */ + if (!strcmp(nodename, "default.keyboard")) { + load_default_key_bindings(); + return; + } + + /* handle the rest */ if (!content) { return; } -- 2.52.0