Workaround for volume not being available during startup

This commit is contained in:
Thomas Avé 2023-03-23 09:46:30 +01:00
parent daf0f5ab35
commit 9f1d406ac0
1 changed files with 4 additions and 2 deletions

View File

@ -181,8 +181,10 @@ local function worker(user_args)
elseif mute == 'on' then widget:unmute()
end
local volume_level = string.match(stdout, "(%d?%d?%d)%%") -- (\d?\d?\d)\%)
volume_level = string.format("% 3d", volume_level)
widget:set_volume_level(volume_level)
if volume_level ~= nil then
volume_level = string.format("% 3d", volume_level)
widget:set_volume_level(volume_level)
end
end
function volume:inc(s)