|
|
@ -22,7 +22,7 @@ local get_app_volume = function(pid) |
|
|
|
for key,process in pairs(get_pactl_data()) do |
|
|
|
-- Match app by pid |
|
|
|
if process:match("application.process.id = \""..tostring(pid).."\"") then |
|
|
|
return process:match("Volume: .-(%d?%d?%d)%%") |
|
|
|
return tonumber(process:match("Volume: .-(%d?%d?%d)%%")) |
|
|
|
end |
|
|
|
end |
|
|
|
-- Return nil and an error if not found matching process |
|
|
@ -93,7 +93,7 @@ return function(args) |
|
|
|
if value then |
|
|
|
slider.value = value |
|
|
|
widget.children[2] = slider |
|
|
|
widget.children[1].image = get_icon(tonumber(value)) |
|
|
|
widget.children[1].image = get_icon(value) |
|
|
|
else |
|
|
|
warning_text.markup = err |
|
|
|
widget.children[2] = warning_text |
|
|
@ -102,7 +102,7 @@ return function(args) |
|
|
|
end) |
|
|
|
slider:connect_signal("widget::redraw_needed",function() |
|
|
|
set_app_volume(client.focus.pid,slider.value) |
|
|
|
widget.children[1].image = get_icon(tonumber(slider.value)) |
|
|
|
widget.children[1].image = get_icon(slider.value) |
|
|
|
end) |
|
|
|
else |
|
|
|
warning_text.markup = "pactl is not available" |
|
|
|