From 898d80e04f68f68c00145146ccf5227e55d95f4e Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Mon, 8 Jun 2020 19:49:19 +0100 Subject: [PATCH] rc.xml: add --- README.md | 21 +++++---------------- data/rc.xml | 21 ++++++++++++++++++--- src/config/rcxml.c | 9 +++------ 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index a92a03df..23daeacf 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ It is in early development and has the following aims: - wlroots (>=0.10.0) - wayland-protocols - xwayland +- libxml2 Will soon depend on -- libxml2 - cairo, pango, glib ## Roadmap @@ -45,24 +45,13 @@ The following were considered before choosing wlroots: ## Configuration -### Keyboard Shortcuts - -We will support rc.xml keybinds, but for the time being: - -``` -Alt+Escape Exit labwc -Alt+F2 Cycle windows -Alt+F3 Launch dmenu -``` - -### Keyboard Layout - -Set environment variable `XKB_DEFAULT_LAYOUT` for your keyboard layout, for -example `gb`. Read `xkeyboard-config(7)` for details. +See [rc.xml](data/rc.xml) comments for details, incl. keybinds. ## Integration -- Use grim for scrots +Suggested apps: + +- grim - screenshots ## Build diff --git a/data/rc.xml b/data/rc.xml index 032d68aa..49975ca2 100644 --- a/data/rc.xml +++ b/data/rc.xml @@ -1,12 +1,27 @@ + - - + + no - + + + + gb + + + + + + + diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 495e5286..fc7b677e 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -56,8 +56,10 @@ static void entry(xmlNode *node, char *nodename, char *content) return; if (in_keybind) fill_keybind(node, nodename, content); - if (!strcmp(nodename, "csd.wlroots")) + if (!strcmp(nodename, "csd.lab")) rc.client_side_decorations = get_bool(content); + if (!strcmp(nodename, "layout.keyboard.lab")) + setenv("XKB_DEFAULT_LAYOUT", content, 1); } static void keybind_begin(void) @@ -81,10 +83,6 @@ static char *nodename(xmlNode *node, char *buf, int len) if (node->parent && !strcmp((char *)node->name, "text")) node = node->parent; - buf += len; - *--buf = 0; - len--; - char *p = buf; p[--len] = 0; for (;;) { @@ -152,7 +150,6 @@ static void parse_xml(const char *filename) fprintf(stderr, "fatal: error reading file '%s'\n", filename); exit(EXIT_FAILURE); } - printf("info: reading config file '%s'\n", filename); xml_tree_walk(xmlDocGetRootElement(d)); xmlFreeDoc(d); xmlCleanupParser();