From: Luke Bonham Date: Fri, 25 Aug 2017 08:26:30 +0000 (+0200) Subject: {alsa,pulse}bar: show percentage even when muted X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/12f0258dc82b8a1affa3a32549d3aabc62f6cada?ds=sidebyside;hp=--cc {alsa,pulse}bar: show percentage even when muted --- 12f0258dc82b8a1affa3a32549d3aabc62f6cada diff --git a/widget/alsabar.lua b/widget/alsabar.lua index fb9c2e4..81fbe29 100644 --- a/widget/alsabar.lua +++ b/widget/alsabar.lua @@ -107,11 +107,11 @@ local function factory(args) function alsabar.notify() alsabar.update(function() local preset = alsabar.notification_preset + + preset.title = string.format("%s - %s%%", alsabar.channel, alsabar._current_level) if alsabar._playback == "off" then - preset.title = string.format("%s - Muted", alsabar.channel) - else - preset.title = string.format("%s - %s%%", alsabar.channel, alsabar._current_level) + preset.title = preset.title .. " Muted" end int = math.modf((alsabar._current_level / 100) * awful.screen.focused().mywibox.height) diff --git a/widget/pulsebar.lua b/widget/pulsebar.lua index 8914a4e..83bfe5e 100644 --- a/widget/pulsebar.lua +++ b/widget/pulsebar.lua @@ -118,11 +118,11 @@ local function factory(args) function pulsebar.notify() pulsebar.update(function() local preset = pulsebar.notification_preset + + preset.title = string.format("Sink %s - %s%%", pulsebar.sink, pulsebar._current_level) if pulsebar._mute == "yes" then - preset.title = string.format("Sink %s - Muted", pulsebar.sink) - else - preset.title = string.format("Sink %s - %s%%", pulsebar.sink, pulsebar._current_level) + preset.title = preset.title .. " Muted" end int = math.modf((pulsebar._current_level / 100) * awful.screen.focused().mywibox.height)