command line argument "-r"added

This commit is contained in:
boh 2009-11-19 19:03:21 +04:00
parent a8af71a45c
commit 1ea81ce205
2 changed files with 8 additions and 2 deletions

View File

@ -97,6 +97,8 @@ if __name__ == '__main__':
inside the terminal")
parser.add_option ("--working-directory", metavar="DIR",
dest="working_directory", help="Set the terminal's working directory")
parser.add_option ("-r", "--role", dest="role",
help="Set custom WM_WINDOW_ROLE property")
for item in ['--sm-client-id', '--sm-config-prefix', '--screen']:
parser.add_option (item, dest="dummy", action="store", help=SUPPRESS_HELP)
@ -160,7 +162,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.forcedtitle)
options.geometry, options.hidden, options.forcedtitle, options.role)
term.origcwd = origcwd

View File

@ -45,6 +45,7 @@ class TerminatorWindowTitle:
_window = None
text = None
_forced = False
_role = None
def __init__ (self, window):
self._window = window
@ -168,7 +169,7 @@ class Terminator:
def __init__ (self, profile = None, command = None, fullscreen = False,
maximise = False, borderless = False, no_gconf = False,
geometry = None, hidden = False, forcedtitle = None):
geometry = None, hidden = False, forcedtitle = None, role=None):
self.profile = profile
self.command = command
@ -267,6 +268,9 @@ class Terminator:
self.set_closebutton_style ()
self.window = gtk.Window ()
if role:
self.window.set_role(role)
self.windowtitle = TerminatorWindowTitle (self.window)
if forcedtitle:
self.windowtitle.force_title (forcedtitle)