[theme] add monocai theme

pull/672/head
Timothy Stack 5 years ago
parent 147dea9d8c
commit 63e53377c3

@ -1,8 +1,8 @@
lnav v0.8.6:
Features:
* Added support for themes and included a few as well: default,
night-owl, solarized-light, and solarized-dark. The theme can
be changed using the ':config' command, like so:
monocai, night-owl, solarized-light, and solarized-dark. The theme
can be changed using the ':config' command, like so:
:config /ui/theme night-owl
Consult the online documentation for defining a new theme.

@ -29,6 +29,7 @@ default-log-formats-json.c: $(srcdir)/default-log-formats.json bin2c
CONFIG_FILES = \
$(srcdir)/root-config.json \
$(srcdir)/themes/default.json \
$(srcdir)/themes/monocai.json \
$(srcdir)/themes/night-owl.json \
$(srcdir)/themes/solarized-dark.json \
$(srcdir)/themes/solarized-light.json \
@ -145,6 +146,7 @@ dist_noinst_DATA = \
root-config.json \
search-for.lnav \
themes/default.json \
themes/monocai.json \
themes/night-owl.json \
themes/solarized-dark.json \
themes/solarized-light.json

@ -982,14 +982,8 @@ void load_format_extra(sqlite3 *db,
const std::vector<std::string> &extra_paths,
std::vector<std::string> &errors)
{
exec_sql_in_path(db, "/etc/lnav", errors);
exec_sql_in_path(db, SYSCONFDIR "/lnav", errors);
exec_sql_in_path(db, dotlnav_path(""), errors);
for (vector<string>::const_iterator path_iter = extra_paths.begin();
path_iter != extra_paths.end();
++path_iter) {
exec_sql_in_path(db, *path_iter, errors);
for (const auto & extra_path : extra_paths) {
exec_sql_in_path(db, extra_path, errors);
}
}
@ -1064,14 +1058,8 @@ static void find_format_in_path(const string &path,
void find_format_scripts(const vector<string> &extra_paths,
map<string, vector<script_metadata> > &scripts)
{
find_format_in_path("/etc/lnav", scripts);
find_format_in_path(SYSCONFDIR "/lnav", scripts);
find_format_in_path(dotlnav_path(""), scripts);
for (vector<string>::const_iterator path_iter = extra_paths.begin();
path_iter != extra_paths.end();
++path_iter) {
find_format_in_path(*path_iter, scripts);
for (const auto &extra_path : extra_paths) {
find_format_in_path(extra_path, scripts);
}
}
@ -1080,9 +1068,7 @@ void load_format_vtabs(log_vtab_manager *vtab_manager,
{
map<intern_string_t, external_log_format *> &root_formats = LOG_FORMATS;
for (map<intern_string_t, external_log_format *>::iterator iter = root_formats.begin();
iter != root_formats.end();
++iter) {
iter->second->register_vtabs(vtab_manager, errors);
for (auto & root_format : root_formats) {
root_format.second->register_vtabs(vtab_manager, errors);
}
}

@ -0,0 +1,144 @@
{
"ui": {
"theme-defs": {
"monocai": {
"vars": {
"black": "#2d2a2e",
"red": "#f92772",
"green": "#a7e22e",
"yellow": "#fe9720",
"blue": "#5394ec",
"magenta": "#ae81ff",
"cyan": "#66d9ee",
"white": "#808080"
},
"styles": {
"identifier": {
"background-color": "#2d2a2e"
},
"text": {
"color": "#f6f6f6",
"background-color": "#2d2a2e"
},
"alt-text": {
"color": "#f6f6f6",
"background-color": "#2d2a2e",
"bold": true
},
"ok": {
"color": "$green",
"bold": true
},
"error": {
"color": "$red",
"bold": true
},
"warning": {
"color": "$yellow",
"bold": true
},
"hidden": {
"color": "$yellow",
"bold": true
},
"adjusted-time": {
"color": "$magenta"
},
"skewed-time": {
"color": "$yellow"
},
"offset-time": {
"color": "$cyan"
},
"popup": {
"color": "$base00",
"background-color": "$base3"
}
},
"syntax-styles": {
"keyword": {
"color": "#ff6188",
"bold": true
},
"string": {
"color": "#ffd866",
"bold": true
},
"comment": {
"color": "#727072"
},
"variable": {
"color": "#a9dc76"
},
"symbol": {
"color": "#78dce8"
},
"re-special": {
"color": "$cyan"
},
"re-repeat": {
"color": "$yellow"
},
"diff-delete": {
"color": "#8f5247"
},
"diff-add": {
"color": "#294436"
},
"diff-section": {
"color": "#656e76"
},
"file": {
"color": "$blue"
}
},
"status-styles": {
"title": {
"color": "#f6f6f6",
"background-color": "#5394ec",
"bold": true
},
"subtitle": {
"color": "#555",
"background-color": "#66d9ee",
"bold": true
},
"text": {
"color": "#f6f6f6",
"background-color": "#353535"
},
"warn": {
"color": "$yellow",
"background-color": "#353535"
},
"alert": {
"color": "$red",
"background-color": "#353535"
},
"active": {
"color": "$green",
"background-color": "#353535"
},
"inactive": {
"color": "#555",
"background-color": "#2f2f2f"
}
},
"log-level-styles": {
"warning": {
"color": "$yellow"
},
"error": {
"color": "$red"
},
"critical": {
"color": "$red"
},
"fatal": {
"color": "$red"
}
}
}
}
}
}

@ -254,6 +254,8 @@ dist_noinst_DATA = \
bad-config/formats/invalid-sql/init.sql \
bad-config/formats/no-samples/format.json \
bad-config2/formats/invalid-config/config.json \
bad-config2/formats/invalid-config/config.malformed.json \
bad-config2/formats/invalid-config/config.truncated.json \
bad-config-json/formats/invalid-json/format.json \
bad-config-json/formats/invalid-key/format.json \
datafile_simple.0 \

Loading…
Cancel
Save