From 993ffef6668d272ff44d81c05dc9f0b5a62aae05 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 20 Apr 2017 22:31:17 +0200 Subject: [PATCH] Add the ignore_suspend flag to naughty (#1729) Possible use-case could be a do-not-disturb mode where notifications should be suspended, but some notifications triggered directly by a user interaction (e.g. change of keyboard layout, etc.) should still be shown. Fixes: https://github.com/awesomeWM/awesome/issues/1728 --- lib/naughty/core.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/naughty/core.lua b/lib/naughty/core.lua index 98afd2e8..f1216c0f 100644 --- a/lib/naughty/core.lua +++ b/lib/naughty/core.lua @@ -494,6 +494,8 @@ end -- Note: this function is only relevant to notifications sent via dbus. -- @tparam[opt] table args.actions Mapping that maps a string to a callback when this -- action is selected. +-- @bool[opt=false] args.ignore_suspend If set to true this notification +-- will be shown even if notifications are suspended via `naughty.suspend`. -- @usage naughty.notify({ title = "Achtung!", text = "You're idling", timeout = 0 }) -- @treturn ?table The notification object, or nil in case a notification was -- not displayed. @@ -755,7 +757,7 @@ function naughty.notify(args) -- insert the notification to the table table.insert(naughty.notifications[s][notification.position], notification) - if suspended then + if suspended and not args.ignore_suspend then notification.box.visible = false table.insert(naughty.notifications.suspended, notification) end