Skip to content

Commit

Permalink
do not advertise as AVAILABLE if the signal is not present in the Vte…
Browse files Browse the repository at this point in the history
… library
  • Loading branch information
mattrose committed Sep 22, 2020
1 parent 98d1192 commit dad40bb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions terminatorlib/plugins/command_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
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']
Expand Down Expand Up @@ -49,7 +54,6 @@ def update_watched(self):
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
Expand Down

0 comments on commit dad40bb

Please sign in to comment.