Do not break stuff if pulseaudio is not available
Wrap pulse.get_address with pcall and notify Awesome if an error occurred instead of breaking everything.
This commit is contained in:
parent
b66eed7394
commit
dc52f1c58b
|
@ -45,7 +45,13 @@ local icon = {
|
|||
muted = icon_theme .. "/audio-volume-muted-symbolic" .. icon_extension
|
||||
}
|
||||
|
||||
local address = pulse.get_address()
|
||||
local status, address = pcall(pulse.get_address)
|
||||
if not status then
|
||||
naughty.notify({title="Error while loading PulseAudio",
|
||||
text=address,
|
||||
preset=naughty.config.presets.critical})
|
||||
return widget
|
||||
end
|
||||
|
||||
pulse.listen_for_signal(address, "org.PulseAudio.Core1", "NewSink")
|
||||
local watcher = ldbus.api.watch(address)
|
||||
|
|
Loading…
Reference in New Issue