{alsa,pulse}bar: consider wibar orientation when calculating notification size; #384

This commit is contained in:
Luca CPZ 2018-02-16 19:49:13 +01:00
parent 24ca5856dc
commit 3136a45015
2 changed files with 18 additions and 4 deletions

View File

@ -113,9 +113,16 @@ local function factory(args)
preset.title = preset.title .. " Muted"
end
int = math.modf((alsabar._current_level / 100) * awful.screen.focused().mywibox.height)
local wib = awful.screen.focused().mywibox
local tot = wib.height
if wib.position == "left" or wib.position == "right" then
tot = wib.width
end
int = math.modf((alsabar._current_level / 100) * tot)
preset.text = string.format("[%s%s]", string.rep("|", int),
string.rep(" ", awful.screen.focused().mywibox.height - int))
string.rep(" ", tot - int))
if alsabar.followtag then preset.screen = awful.screen.focused() end

View File

@ -123,9 +123,16 @@ local function factory(args)
preset.title = preset.title .. " muted"
end
int = math.modf((pulsebar._current_level / 100) * awful.screen.focused().mywibox.height)
local wib = awful.screen.focused().mywibox
local tot = wib.height
if wib.position == "left" or wib.position == "right" then
tot = wib.width
end
int = math.modf((pulsebar._current_level / 100) * tot)
preset.text = string.format("[%s%s]", string.rep("|", int),
string.rep(" ", awful.screen.focused().mywibox.height - int))
string.rep(" ", tot - int))
if pulsebar.followtag then preset.screen = awful.screen.focused() end