aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-11-08 19:39:24 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-11-08 19:40:29 +0100
commit01bf9576d2e777810f56c17d4787fd035f4f5266 (patch)
treed48461de8af878a7ab845acda7cc7bdc2d39727c
parent17cc551cf78117c5b546df03ba36a77fcc86595a (diff)
downloadvis-01bf9576d2e777810f56c17d4787fd035f4f5266.tar.gz
vis-01bf9576d2e777810f56c17d4787fd035f4f5266.tar.xz
ui: warn if theme loading failed
-rw-r--r--ui-curses.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ui-curses.c b/ui-curses.c
index ef397c0..30cf516 100644
--- a/ui-curses.c
+++ b/ui-curses.c
@@ -1000,8 +1000,14 @@ static bool ui_init(Ui *ui, Vis *vis) {
UiCurses *uic = (UiCurses*)ui;
uic->vis = vis;
const char *theme = getenv("VIS_THEME");
- if (!theme || !theme[0] || !vis_theme_load(vis, theme))
- vis_theme_load(vis, COLORS <= 16 ? "default-16" : "default-256");
+ if (theme && theme[0]) {
+ if (!vis_theme_load(vis, theme))
+ vis_info_show(vis, "Warning: failed to load theme `%s'", theme);
+ } else {
+ theme = COLORS <= 16 ? "default-16" : "default-256";
+ if (!vis_theme_load(vis, theme))
+ vis_info_show(vis, "Warning: failed to load theme `%s' set $VIS_PATH", theme);
+ }
return true;
}