Skip to content

Commit

Permalink
Provision for when there is DBUS on the system but notifications are …
Browse files Browse the repository at this point in the history
…not configured
  • Loading branch information
zlatinb committed Jul 28, 2024
1 parent 651c9f3 commit 141c70d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.freedesktop.dbus.connections.impl.DBusConnection
import org.freedesktop.dbus.connections.impl.DBusConnectionBuilder
import org.freedesktop.dbus.errors.NoReply
import org.freedesktop.dbus.exceptions.DBusException
import org.freedesktop.dbus.errors.ServiceUnknown
import org.freedesktop.dbus.interfaces.DBusInterface
import org.freedesktop.dbus.types.UInt32
import org.freedesktop.dbus.types.UInt64
Expand All @@ -25,7 +26,7 @@ class DBUSNotifyService {
notifications = DBusConnectionBuilder.forSessionBus().build().
getRemoteObject(BUS_NAME, BUS_PATH, Notifications.class)
sound = notifications.GetCapabilities().contains("sound")
} catch (DBusException | NoReply bad) {
} catch (DBusException | NoReply | ServiceUnknown bad) {
sound = false
}
NOTIFICATIONS = notifications
Expand Down

0 comments on commit 141c70d

Please sign in to comment.