[core] Add support for custom colorsets (e.g. pywal)

In a theme file, it is now possible to provide an array of "color
definitions", which allow you to use names instead of colors throughout
the theme file.

Currently, only the colorset "wal" is supported, which reads all colors
from the wal JSON file (~/.cache/wal/colors.json) and makes them usable
in the theme (as "foreground", "background", "cursor", "color12", etc.).

An example of this can be found in the theme wal-powerline.

see #185
This commit is contained in:
Tobias Witek 2017-10-08 08:13:10 +02:00
parent f3fe67e681
commit 5d1d994dce
2 changed files with 65 additions and 3 deletions

42
themes/wal-powerline.json Normal file
View file

@ -0,0 +1,42 @@
{
"icons": [ "awesome-fonts" ],
"colors": [ "wal" ],
"defaults": {
"separator-block-width": 0,
"critical": {
"fg": "cursor",
"bg": "color5"
},
"warning": {
"fg": "cursor",
"bg": "color6"
},
"default_separators": false
},
"cycle": [
{
"fg": "foreground",
"bg": "background"
},
{
"fg": "background",
"bg": "foreground"
}
],
"dnf": {
"good": {
"fg": "background",
"bg": "color3"
}
},
"battery": {
"charged": {
"fg": "background",
"bg": "color3"
},
"AC": {
"fg": "background",
"bg": "color3"
}
}
}