From bc9539f187d81fe3e191dacf292b09885eec8ab8 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Thu, 28 Jun 2012 15:38:01 +0200 Subject: [PATCH] Adds ability to override the WMCLASS_NAME of a window. --- doc/terminator.1 | 3 +++ terminatorlib/optionparse.py | 2 ++ terminatorlib/window.py | 3 +++ 3 files changed, 8 insertions(+) diff --git a/doc/terminator.1 b/doc/terminator.1 index 4b746484..da6217ea 100644 --- a/doc/terminator.1 +++ b/doc/terminator.1 @@ -56,6 +56,9 @@ Set the terminal's working directory .B \-r, \-\-role=ROLE Set a custom WM_WINDOW_ROLE property on the window .TP +.B \-c, \-\-classname=CLASSNAME +Set a custom name (WM_CLASS) property on the window +.TP .B \-l, \-\-layout=LAYOUT Start Terminator with a specific layout. The argument here is the name of a saved layout. diff --git a/terminatorlib/optionparse.py b/terminatorlib/optionparse.py index 13a2a09d..0ab23ba2 100755 --- a/terminatorlib/optionparse.py +++ b/terminatorlib/optionparse.py @@ -66,6 +66,8 @@ command to execute inside the terminal, and its arguments')) dest='working_directory', help=_('Set the working directory')) parser.add_option('-r', '--role', dest='role', help=_('Set a custom \ WM_WINDOW_ROLE property on the window')) + parser.add_option('-c', '--classname', dest='classname', help=_('Set a \ +custom name (WM_CLASS) property on the window')) parser.add_option('-l', '--layout', dest='layout', help=_('Select a layout')) parser.add_option('-p', '--profile', dest='profile', help=_('Use a \ different profile as the default')) diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 50fe79c9..cb4be4f4 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -75,6 +75,9 @@ class Window(Container, gtk.Window): if options.role is not None: self.set_role(options.role) + + if options.classname is not None: + self.set_wmclass(options.classname, self.wmclass_class) if options.geometry is not None: if not self.parse_geometry(options.geometry):