[kupfer] custom_terminal: A plugin that lets you customize terminal emulator



commit ebe861bc6b1175d2c14cc7e258eb50085da94dde
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Mon Mar 21 15:22:40 2011 +0100

    custom_terminal: A plugin that lets you customize terminal emulator
    
    This plugin adds a 'Custom Terminal' alternative to the 'terminal'
    category.
    
    Launchpad-bug: https://bugs.launchpad.net/kupfer/+bug/733345

 kupfer/plugin/custom_terminal.py |   44 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/custom_terminal.py b/kupfer/plugin/custom_terminal.py
new file mode 100644
index 0000000..e5e62c1
--- /dev/null
+++ b/kupfer/plugin/custom_terminal.py
@@ -0,0 +1,44 @@
+__kupfer_name__ = _("Custom Terminal")
+__description__ = _("Configure a custom terminal emulator")
+__version__ = ""
+__author__ = "Ulrik Sverdrup"
+
+from kupfer import plugin_support
+from kupfer import utils
+
+__kupfer_settings__ = plugin_support.PluginSettings(
+		{
+			"key": "command",
+			"label": _("Command"),
+			"type": str,
+			"value": "",
+		},
+		{
+			"key": "exearg",
+			"label": _("Execute flag"),
+			"type": str,
+			"value": "-e",
+			"tooltip": ("The flag which makes the terminal execute"
+			            " everything following it in the argument string. ")
+		},
+	)
+
+
+
+def initialize_plugin(name):
+	__kupfer_settings__.connect_settings_changed_cb(_update_alternative)
+	_update_alternative()
+
+def _update_alternative(*args):
+	command = __kupfer_settings__["command"]
+	exearg = __kupfer_settings__["exearg"]
+	argv = utils.argv_for_commandline(command)
+	if not argv or not utils.lookup_exec_path(argv[0]):
+		return
+	plugin_support.register_alternative(__name__, 'terminal', 'custom1',
+			name=_("Custom Terminal"),
+			argv=argv,
+			exearg=exearg,
+			desktopid="",
+			startup_notify=True)
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]