From dad40bb1b23a1235cf6cd3c285a534142e20ee48 Mon Sep 17 00:00:00 2001 From: Matt Rose Date: Tue, 22 Sep 2020 17:48:37 -0400 Subject: [PATCH] do not advertise as AVAILABLE if the signal is not present in the Vte library --- terminatorlib/plugins/command_notify.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/terminatorlib/plugins/command_notify.py b/terminatorlib/plugins/command_notify.py index 64b3b48b..83849332 100644 --- a/terminatorlib/plugins/command_notify.py +++ b/terminatorlib/plugins/command_notify.py @@ -18,10 +18,15 @@ import terminatorlib.plugin as plugin from terminatorlib.terminator import Terminator import gi gi.require_version('Notify', '0.7') -from gi.repository import GObject, GLib, Notify +from gi.repository import GObject, GLib, Notify, Vte VERSION = '0.1.0' -AVAILABLE = ['CommandNotify'] +### Test for proper signal +try: + Vte.Terminal().connect('notification-received',lambda *args: None,None) + AVAILABLE = ['CommandNotify'] +except TypeError as e: + pass class CommandNotify(plugin.Plugin): capabilities = ['command_watch'] @@ -49,7 +54,6 @@ class CommandNotify(plugin.Plugin): self.watched = new_watched def update_watched_delayed(self, term, event, arg1 = None): - print('foo: %s / bar: %s / baz: %s' % (str(term),str(event),arg1)) def add_watch(self): self.update_watched() return False