i3/libi3/boolstr.c
Michael Stapelberg abbf6a85d7
Implement showing window icons in titlebar (#4439)
This feature defaults to off, and can be turned on for individual windows,
or (with for_window) for all new windows. See the userguide change.

This commit is partially based on work by:

• Marius Muja
• mickael9
• Esteve Varela Colominas
• Bernardo Menicagli
2021-06-13 08:35:52 +02:00

26 lines
621 B
C

/*
* vim:ts=4:sw=4:expandtab
*
* i3 - an improved dynamic tiling window manager
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
*
*/
#include "libi3.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
/*
* Reports whether str represents the enabled state (1, yes, true, …).
*
*/
bool boolstr(const char *str) {
return (strcasecmp(str, "1") == 0 ||
strcasecmp(str, "yes") == 0 ||
strcasecmp(str, "true") == 0 ||
strcasecmp(str, "on") == 0 ||
strcasecmp(str, "enable") == 0 ||
strcasecmp(str, "active") == 0);
}