From 49774897a4b1cdb809cc54ed0fc65feca9f059a1 Mon Sep 17 00:00:00 2001 From: Anurag Priyam Date: Sat, 23 Jul 2011 12:47:34 +0530 Subject: [PATCH] naughty: add helper function, toggle() - suspend/resume notifications Signed-off-by: Anurag Priyam Signed-off-by: Uli Schlachter --- lib/naughty.lua.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/naughty.lua.in b/lib/naughty.lua.in index b3e04c433..df04125f9 100644 --- a/lib/naughty.lua.in +++ b/lib/naughty.lua.in @@ -139,6 +139,15 @@ function resume() notifications.suspended = { } end +--- Toggle notification state +function toggle() + if suspended then + resume() + else + suspend() + end +end + -- Evaluate desired position of the notification by index - internal -- @param idx Index of the notification -- @param position top_right | top_left | bottom_right | bottom_left