1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

[DMenu|Script] Allow theme element updates from script.

This commit is contained in:
Dave Davenport 2022-06-03 19:42:40 +02:00
parent c7776ce9b7
commit b676dfe8ad
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
if [ "$*" = "quit" ]
then
exit 0
fi
if [ "$@" ]
then
# Override the previously set prompt.
echo -en "\0theme\x1felement-text { background-color: "$@";}\n"
echo "red"
echo "lightgreen"
echo "lightblue"
echo "lightyellow"
echo "quit"
else
echo -en "\x00prompt\x1ftesting\n"
echo -en "\0urgent\x1f0,2\n"
echo -en "\0active\x1f1\n"
echo -en "\0message\x1fSpecial <b>bold</b>message\n"
echo "red"
echo "lightgreen"
echo "lightblue"
echo "lightyellow"
echo "quit"
fi

View file

@ -138,6 +138,11 @@ static void parse_header_entry(Mode *sw, char *line, ssize_t length) {
} else if (strcasecmp(line, "data") == 0) {
g_free(pd->data);
pd->data = g_strdup(value);
} else if (strcasecmp(line, "theme") == 0) {
if (rofi_theme_parse_string((const char *)value)) {
g_warning("Failed to parse: '%s'", value);
rofi_clear_error_messages();
}
}
}
}