From ee1490dc4a85e13d0fe4e05b824a59803d26198f Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 4 May 2009 02:00:44 +0100 Subject: [PATCH] Add a commandline argument to allow specifying the window title. Closes LP #370064 --- ChangeLog | 1 + doc/terminator.1 | 4 ++++ terminator | 4 +++- terminatorlib/terminator.py | 4 +++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 34a98afe..56b5b759 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ terminator 0.13: * The tab bar can now be hidden and/or scrolled. * Add configurability of cursor colour and shape * Support various VoIP URIs + * Addcommand line option to force a particular window title terminator 0.12: * Bug fixes diff --git a/doc/terminator.1 b/doc/terminator.1 index f4649a4c..88fa455e 100644 --- a/doc/terminator.1 +++ b/doc/terminator.1 @@ -37,6 +37,10 @@ Terminator window (good with \-m) Hide the Terminator window by default. Its visibility can be toggled with the \fBhide_window\fR keyboard shortcut (Ctrl-Shift-Alt-a by default) .TP +.B \-T, \-\-title +Force the Terminator window to use a specific name rather than updating it dynamically +based on the wishes of the child shell. +.TP .B \-\-no_gconf Ignore the gconf settings of gnome-terminal .TP diff --git a/terminator b/terminator index 1b16f8ee..bfb65d45 100755 --- a/terminator +++ b/terminator @@ -90,6 +90,8 @@ if __name__ == '__main__': dest="borderless", help="Turn off the window's borders") parser.add_option("-H", "--hidden", action="store_true", dest="hidden", help="Open the %s window hidden"%APP_NAME.capitalize()) + parser.add_option("-T", "--title", dest="forcedtitle", + help="Specify a title to use for the window") parser.add_option ("-n", "--no-gconf", dest="no_gconf", action="store_true", help="ignore gnome-terminal gconf settings") parser.add_option ("-p", "--profile", dest="profile", action="callback", @@ -166,7 +168,7 @@ See the following bug report for more details: dbg ('profile_cb: settled on profile: "%s"' % options.profile) term = Terminator (options.profile, command, options.fullscreen, options.maximise, options.borderless, options.no_gconf, - options.geometry, options.hidden) + options.geometry, options.hidden, options.forcedtitle) if options.debug > 1: import terminatorlib.debugserver as debugserver diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index ba70f637..1dc22dd5 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -212,7 +212,7 @@ class Terminator: def __init__ (self, profile = None, command = None, fullscreen = False, maximise = False, borderless = False, no_gconf = False, - geometry = None, hidden = False): + geometry = None, hidden = False, forcedtitle = None): self.profile = profile self.command = command @@ -306,6 +306,8 @@ class Terminator: self.window = gtk.Window () self.windowtitle = TerminatorWindowTitle (self.window) + if forcedtitle: + self.windowtitle.force_title (forcedtitle) self.windowtitle.update () if self._geometry is not None: