aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/conf.c9
-rw-r--r--src/options.c1
-rw-r--r--src/options.h1
-rw-r--r--src/screen.c8
4 files changed, 15 insertions, 4 deletions
diff --git a/src/conf.c b/src/conf.c
index 38d508954..67d048ae6 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -72,6 +72,7 @@
#define CONF_SCROLL_SEP "scroll-sep"
#define CONF_VISIBLE_BITRATE "visible-bitrate"
#define CONF_WELCOME_SCREEN_LIST "welcome-screen-list"
+#define CONF_DISPLAY_TIME "display-time"
static bool
str2bool(char *str)
@@ -448,7 +449,13 @@ parse_line(char *line)
else if (!strcasecmp(CONF_SCROLL_SEP, name)) {
g_free(options.scroll_sep);
options.scroll_sep = get_format(value);
- } else
+ } else if (!strcasecmp(CONF_DISPLAY_TIME, name))
+#ifdef NCMPC_MINI
+ {}
+#else
+ options.display_time = str2bool(value);
+#endif
+ else
match_found = false;
if (!match_found)
diff --git a/src/options.c b/src/options.c
index 5bb5fbadd..3f784d11c 100644
--- a/src/options.c
+++ b/src/options.c
@@ -61,6 +61,7 @@ options_t options = {
#ifndef NCMPC_MINI
.scroll = DEFAULT_SCROLL,
.welcome_screen_list = true,
+ .display_time = true,
#endif
};
diff --git a/src/options.h b/src/options.h
index 671107a76..c48d1b390 100644
--- a/src/options.h
+++ b/src/options.h
@@ -69,6 +69,7 @@ typedef struct {
bool scroll;
bool visible_bitrate;
bool welcome_screen_list;
+ bool display_time;
#endif
} options_t;
diff --git a/src/screen.c b/src/screen.c
index 1f44f7398..924cf4bd8 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -338,10 +338,12 @@ paint_status_window(mpdclient_t *c)
}
#ifndef NCMPC_MINI
} else {
- time_t timep;
+ if (options.display_time) {
+ time_t timep;
- time(&timep);
- strftime(screen.buf, screen.buf_size, "%X ",localtime(&timep));
+ time(&timep);
+ strftime(screen.buf, screen.buf_size, "%X ",localtime(&timep));
+ }
#endif
}