File: insert_term_name.py

package info (click to toggle)
terminator 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,916 kB
  • sloc: python: 11,390; sh: 26; makefile: 15
file content (18 lines) | stat: -rw-r--r-- 477 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from gi.repository import Gtk

import terminatorlib.plugin as plugin

AVAILABLE = ['InsertTermName']

class InsertTermName(plugin.MenuItem):
   capabilities = ['terminal_menu']
   config = None

   def __init__(self):
      plugin.MenuItem.__init__(self)

   def callback(self, menuitems, menu, terminal):
      item = Gtk.MenuItem.new_with_label('Insert terminal name')
      item.connect('activate', lambda x: terminal.emit('insert-term-name'))
      menuitems.append(item)