From d9e4c1e866613a75e53d0ce74a346d2a8b0dfced 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 f247f9d0..49b52b42 100644 --- a/lib/naughty.lua.in +++ b/lib/naughty.lua.in @@ -137,6 +137,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