mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
rc.xml: add <lab><keyboard><layout>
This commit is contained in:
parent
6166e9b370
commit
898d80e04f
3 changed files with 26 additions and 25 deletions
21
README.md
21
README.md
|
|
@ -15,10 +15,10 @@ It is in early development and has the following aims:
|
||||||
- wlroots (>=0.10.0)
|
- wlroots (>=0.10.0)
|
||||||
- wayland-protocols
|
- wayland-protocols
|
||||||
- xwayland
|
- xwayland
|
||||||
|
- libxml2
|
||||||
|
|
||||||
Will soon depend on
|
Will soon depend on
|
||||||
|
|
||||||
- libxml2
|
|
||||||
- cairo, pango, glib
|
- cairo, pango, glib
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
@ -45,24 +45,13 @@ The following were considered before choosing wlroots:
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
### Keyboard Shortcuts
|
See [rc.xml](data/rc.xml) comments for details, incl. keybinds.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
## Integration
|
## Integration
|
||||||
|
|
||||||
- Use grim for scrots
|
Suggested apps:
|
||||||
|
|
||||||
|
- grim - screenshots
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
|
|
|
||||||
21
data/rc.xml
21
data/rc.xml
|
|
@ -1,12 +1,27 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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"
|
<openbox_config xmlns="http://openbox.org/3.4/rc"
|
||||||
xmlns:xi="http://www.w3.org/2001/XInclude">
|
xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||||
|
|
||||||
<!-- wlroots specific settings - not part of openbox -->
|
<!-- labwc specific settings - additional to openbox -->
|
||||||
<wlroots>
|
<lab>
|
||||||
<!-- Use client-side decorations for xdg-shell views -->
|
<!-- Use client-side decorations for xdg-shell views -->
|
||||||
<csd>no</csd>
|
<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>
|
</openbox_config>
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,10 @@ static void entry(xmlNode *node, char *nodename, char *content)
|
||||||
return;
|
return;
|
||||||
if (in_keybind)
|
if (in_keybind)
|
||||||
fill_keybind(node, nodename, content);
|
fill_keybind(node, nodename, content);
|
||||||
if (!strcmp(nodename, "csd.wlroots"))
|
if (!strcmp(nodename, "csd.lab"))
|
||||||
rc.client_side_decorations = get_bool(content);
|
rc.client_side_decorations = get_bool(content);
|
||||||
|
if (!strcmp(nodename, "layout.keyboard.lab"))
|
||||||
|
setenv("XKB_DEFAULT_LAYOUT", content, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void keybind_begin(void)
|
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"))
|
if (node->parent && !strcmp((char *)node->name, "text"))
|
||||||
node = node->parent;
|
node = node->parent;
|
||||||
|
|
||||||
buf += len;
|
|
||||||
*--buf = 0;
|
|
||||||
len--;
|
|
||||||
|
|
||||||
char *p = buf;
|
char *p = buf;
|
||||||
p[--len] = 0;
|
p[--len] = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
@ -152,7 +150,6 @@ static void parse_xml(const char *filename)
|
||||||
fprintf(stderr, "fatal: error reading file '%s'\n", filename);
|
fprintf(stderr, "fatal: error reading file '%s'\n", filename);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
printf("info: reading config file '%s'\n", filename);
|
|
||||||
xml_tree_walk(xmlDocGetRootElement(d));
|
xml_tree_walk(xmlDocGetRootElement(d));
|
||||||
xmlFreeDoc(d);
|
xmlFreeDoc(d);
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue