Honor muted state on initialization and sink change
This commit is contained in:
parent
5d9df5db5f
commit
8916e9a973
|
@ -123,7 +123,7 @@ function widget:run_client()
|
||||||
v, found = line:gsub("^(NewSink:%s+)(/.*%w)", "%2")
|
v, found = line:gsub("^(NewSink:%s+)(/.*%w)", "%2")
|
||||||
if found ~=0 then
|
if found ~=0 then
|
||||||
self:update_sink(v)
|
self:update_sink(v)
|
||||||
local volume = self.sink:get_volume_percent()[1]
|
local volume = self.sink:is_muted() and "Muted" or self.sink:get_volume_percent()[1]
|
||||||
self:update_appearance(volume)
|
self:update_appearance(volume)
|
||||||
widget.notify(volume)
|
widget.notify(volume)
|
||||||
end
|
end
|
||||||
|
@ -157,7 +157,7 @@ function widget:init()
|
||||||
local sink_path = assert(self.core:get_sinks()[1], "No sinks found")
|
local sink_path = assert(self.core:get_sinks()[1], "No sinks found")
|
||||||
|
|
||||||
self:update_sink(sink_path)
|
self:update_sink(sink_path)
|
||||||
local volume = self.sink:get_volume_percent()[1]
|
local volume = self.sink:is_muted() and "Muted" or self.sink:get_volume_percent()[1]
|
||||||
self:update_appearance(volume)
|
self:update_appearance(volume)
|
||||||
|
|
||||||
self:run_client()
|
self:run_client()
|
||||||
|
|
Loading…
Reference in New Issue