From d5088c5f6f7831d19dbacf83b2e8294d6bd48a56 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 10 Jan 2015 16:56:03 +0100 Subject: [PATCH] naughty: Fix builds without dbus The new notification action code tried to emit dbus signals even if awesome was build without notification support. Fix this by adding the necessary "if". (This also removes an unused return value which wasn't marked as "local" and thus triggered my "complain if something messes with the global env"-script) Signed-off-by: Uli Schlachter --- lib/naughty.lua.in | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/naughty.lua.in b/lib/naughty.lua.in index 3c2fb072a..0e3de8fc0 100644 --- a/lib/naughty.lua.in +++ b/lib/naughty.lua.in @@ -259,17 +259,21 @@ local function getById(id) end local function sendActionInvoked(notificationId, action) - res = capi.dbus.emit_signal("session", "/org/freedesktop/Notifications", - "org.freedesktop.Notifications", "ActionInvoked", - "i", notificationId, - "s", action) + if capi.dbus then + capi.dbus.emit_signal("session", "/org/freedesktop/Notifications", + "org.freedesktop.Notifications", "ActionInvoked", + "i", notificationId, + "s", action) + end end local function sendNotificationClosed(notificationId, reason) - res = capi.dbus.emit_signal("session", "/org/freedesktop/Notifications", - "org.freedesktop.Notifications", "NotificationClosed", - "i", notificationId, - "i", reason) + if capi.dbus then + capi.dbus.emit_signal("session", "/org/freedesktop/Notifications", + "org.freedesktop.Notifications", "NotificationClosed", + "i", notificationId, + "i", reason) + end end --- Create notification. args is a dictionary of (optional) arguments.