From 4bd0ba88c896d1ad9beba2eaadc01f1f2d172b5b Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Fri, 15 Nov 2013 00:41:33 +0100 Subject: Added different format string for volume in case it is muted. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the volume is muted, the volume level would simply be displayed as zero and the color changed to color_degraded. This patch lets the user define a custom format string for when the volume is muted. The default value is "♪: 0%" ("♪: %volume" being the usual format). --- i3status.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'i3status.c') diff --git a/i3status.c b/i3status.c index e99e627..1b9c595 100644 --- a/i3status.c +++ b/i3status.c @@ -286,6 +286,7 @@ int main(int argc, char *argv[]) { cfg_opt_t volume_opts[] = { CFG_STR("format", "♪: %volume", CFGF_NONE), + CFG_STR("format_muted", "♪: 0%%", CFGF_NONE), CFG_STR("device", "default", CFGF_NONE), CFG_STR("mixer", "Master", CFGF_NONE), CFG_INT("mixer_idx", 0, CFGF_NONE), @@ -513,6 +514,7 @@ int main(int argc, char *argv[]) { CASE_SEC_TITLE("volume") { SEC_OPEN_MAP("volume"); print_volume(json_gen, buffer, cfg_getstr(sec, "format"), + cfg_getstr(sec, "format_muted"), cfg_getstr(sec, "device"), cfg_getstr(sec, "mixer"), cfg_getint(sec, "mixer_idx")); -- cgit v1.2.3