class JiraUrlPlugin(plugin.URLHandler): capabilties = ["url_handler"] handler_name = "jira_ticket" config = None plugin_name = "JiraUrlPlugin" def __init__(self): self.config = Config() if self.config.plugin_get_config(self.plugin_name) is None: for key, value in CONFIG_DEFAULTS.iteritems(): self.config.plugin_set(self.plugin_name, key, value) self.config.save() self.match = self.config.plugin_get(self.plugin_name, "match") self.jira_url = self.config.plugin_get(self.plugin_name, "jira_url") def callback(self, url): if not (self.match or self.jira_url): return for item in re.findall(self.match, url): return("%s/%s" % (self.jira_url, item))
from terminatorlib.util import err, dbg from terminatorlib.version import APP_NAME try: gi.require_version('Notify', '0.7') from gi.repository import Notify # Every plugin you want Terminator to load *must* be listed in 'AVAILABLE' # This is inside this try so we only make the plugin available if pynotify # is present on this computer. AVAILABLE = ['ActivityWatch', 'InactivityWatch'] except (ImportError, ValueError): err('ActivityWatch plugin unavailable as we cannot import Notify') config = Config() inactive_period = float( config.plugin_get('InactivityWatch', 'inactive_period', 10.0)) watch_interval = int( config.plugin_get('InactivityWatch', 'watch_interval', 5000)) hush_period = float(config.plugin_get('ActivityWatch', 'hush_period', 10.0)) class ActivityWatch(plugin.MenuItem): """Add custom commands to the terminal menu""" capabilities = ['terminal_menu'] watches = None last_notifies = None timers = None def __init__(self): plugin.MenuItem.__init__(self) if not self.watches:
from terminatorlib.translation import _ from terminatorlib.util import err, dbg from terminatorlib.version import APP_NAME try: gi.require_version('Notify', '0.7') from gi.repository import Notify # Every plugin you want Terminator to load *must* be listed in 'AVAILABLE' # This is inside this try so we only make the plugin available if pynotify # is present on this computer. AVAILABLE = ['ActivityWatch', 'InactivityWatch'] except ImportError: err(_('ActivityWatch plugin unavailable: please install python-notify')) config = Config() inactive_period = float(config.plugin_get('InactivityWatch', 'inactive_period', 10.0)) watch_interval = int(config.plugin_get('InactivityWatch', 'watch_interval', 5000)) hush_period = float(config.plugin_get('ActivityWatch', 'hush_period', 10.0)) class ActivityWatch(plugin.MenuItem): """Add custom commands to the terminal menu""" capabilities = ['terminal_menu'] watches = None last_notifies = None timers = None def __init__(self): plugin.MenuItem.__init__(self) if not self.watches:
from terminatorlib.translation import _ from terminatorlib.util import err, dbg from terminatorlib.version import APP_NAME try: from gi.repository import Notify # Every plugin you want Terminator to load *must* be listed in 'AVAILABLE' # This is inside this try so we only make the plugin available if pynotify # is present on this computer. AVAILABLE = ['ActivityWatch', 'InactivityWatch'] except ImportError: err(_('ActivityWatch plugin unavailable: please install python-notify')) config = Config() inactive_period = float( config.plugin_get('ActivityWatch', 'inactive_period', 10.0)) watch_interval = int(config.plugin_get('ActivityWatch', 'watch_interval', 5000)) class ActivityWatch(plugin.MenuItem): """Add custom commands to the terminal menu""" capabilities = ['terminal_menu'] watches = None last_notifies = None timers = None def __init__(self): plugin.MenuItem.__init__(self) if not self.watches: self.watches = {}
# Public License can be found in `/usr/share/common-licenses/GPL-2'. # Modified by cgw 2011/11/06 # Modified by Technicism 2018/11/19 # - Support config options to change the search engine. # - Embed the license for single file portability. # See https://github.com/choffee/terminator-plugins for original source. NAME = 'SearchPlugin' AVAILABLE = [NAME] _spaces = re.compile(" +") config = Config() base_uri = config.plugin_get(NAME, 'base_uri', 'https://www.google.com/search?q=%s') label = config.plugin_get(NAME, 'label', 'Google Search') class SearchPlugin(plugin.Plugin): capabilities = ['terminal_menu'] def do_search(self, searchMenu): """Launch Google search for string""" if not self.searchstring: return uri = base_uri % urllib.quote(self.searchstring.encode("utf-8")) gtk.show_uri(None, uri, gtk.gdk.CURRENT_TIME) def callback(self, menuitems, menu, terminal): """Add our menu item to the menu""" self.terminal = terminal