summaryrefslogtreecommitdiff
path: root/i3status.c
diff options
context:
space:
mode:
authorGereon Kremer <gereon.kremer@rwth-aachen.de>2013-11-15 00:41:33 +0100
committerMichael Stapelberg <michael@stapelberg.de>2013-11-18 22:31:42 +0100
commit4bd0ba88c896d1ad9beba2eaadc01f1f2d172b5b (patch)
treec1fd550856fe50bc64ed2db853459101c7f2a506 /i3status.c
parent09330976e5b08079014087ce0ac490b5b824c8f8 (diff)
Added different format string for volume in case it is muted.
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).
Diffstat (limited to 'i3status.c')
-rw-r--r--i3status.c2
1 files changed, 2 insertions, 0 deletions
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"));