]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/common/parse-bool.c: support on/off boolean values
authorredtide <redtid3@gmail.com>
Tue, 12 Sep 2023 23:06:29 +0000 (01:06 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 13 Sep 2023 04:27:27 +0000 (05:27 +0100)
docs/labwc-config.5.scd
src/common/parse-bool.c

index a68ab7e0eab3c6740850e2411ffaa8463c864a27..023f057829cf62ae90ce3f2195679ab2b9a54afd 100644 (file)
@@ -94,6 +94,12 @@ Elements at the same level can have the same name whereas attributes cannot.
 Therefore, where multiple objects of the same kind are required (for example
 *<action>* and *<keybind>*) the top-node of the object has to be an element.
 
+## BOOLEANS
+
+Note that in this manual, Boolean values are listed as [yes|no] for simplicity,
+but it's also possible to use [true|false] and\/or [on|off];
+this is for compatibility with Openbox.
+
 ## CORE
 
 ```
index 0c10e9de2f4423b85712c41425b42c9c7e46da43..fe5f4f84598e06d11bee2bf2a7a7955701fa8158 100644 (file)
@@ -13,10 +13,14 @@ parse_bool(const char *str, int default_value)
                return true;
        } else if (!strcasecmp(str, "true")) {
                return true;
+       } else if (!strcasecmp(str, "on")) {
+               return true;
        } else if (!strcasecmp(str, "no")) {
                return false;
        } else if (!strcasecmp(str, "false")) {
                return false;
+       } else if (!strcasecmp(str, "off")) {
+               return false;
        }
 error_not_a_boolean:
        wlr_log(WLR_ERROR, "(%s) is not a boolean value", str);