]> git.mdlowis.com Git - proto/labwc.git/commitdiff
rc.xml: add <lab><keyboard><layout>
authorJohan Malm <jgm323@gmail.com>
Mon, 8 Jun 2020 18:49:19 +0000 (19:49 +0100)
committerJohan Malm <jgm323@gmail.com>
Mon, 8 Jun 2020 18:49:19 +0000 (19:49 +0100)
README.md
data/rc.xml
src/config/rcxml.c

index a92a03dfb2ba99b188e62c1385bfef16ced4e849..23daeacf381bd60484e8ebce2c4de10656581c6f 100644 (file)
--- 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
 
index 032d68aac4a8a0872670572c5ee0d452d439c098..49975ca2b12b03bcc1c4e6774c887436e0db69d4 100644 (file)
@@ -1,12 +1,27 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
+<!-- Use <openbox_config> as root element for openbox compatibility -->
 <openbox_config xmlns="http://openbox.org/3.4/rc"
                xmlns:xi="http://www.w3.org/2001/XInclude">
 
-<!-- wlroots specific settings - not part of openbox -->
-<wlroots>
+<!-- labwc specific settings - additional to openbox -->
+<lab>
   <!-- Use client-side decorations for xdg-shell views -->
   <csd>no</csd>
-</wlroots>
+
+  <!-- See xkeyboard-config(7) for details on these keyboard settings -->
+  <keyboard>
+    <layout>gb</layout>
+  </keyboard>
+</lab>
+
+<!-- keybinds have not been implemented yet. For the time being, we use the
+     following:
+      - Alt+Escape  Exit labwc
+      - Alt+F2      Cycle windows
+      - Alt+F3      Launch dmenu -->
+<keyboard>
+
+</keyboard>
 
 </openbox_config>
index 495e528652db625d24da8f19ca29b0842409b097..fc7b677e36df8377459966f6bce0583289d9631e 100644 (file)
@@ -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();