diff --git a/README.md b/README.md index c4bdbda..64fadf6 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,8 @@ Require the module: -- require *after* `beautiful.init` or the theme will be inconsistent! local pulse = require("pulseaudio_widget") +-- Optionally, change the notification timeout default of 1 second to 5. +pulse.notification_timeout_seconds = 5 ``` Add the widget to your layout: diff --git a/pulseaudio_widget.lua b/pulseaudio_widget.lua index 71eaf92..ba3923e 100644 --- a/pulseaudio_widget.lua +++ b/pulseaudio_widget.lua @@ -74,7 +74,12 @@ function widget:notify(v) naughty.destroy(self.notification, naughty.notificationClosedReason.dismissedByCommand) end - self.notification = naughty.notify({text=msg, timeout=1}) + self.notification = naughty.notify( + { + text=msg, + timeout=self.notification_timeout_seconds + } + ) end @@ -177,6 +182,7 @@ function widget:init() end self.mixer = "pavucontrol" + self.notification_timeout_seconds = 1 self.connection = pulse.get_connection(address) self.core = pulse.get_core(self.connection)