updated trunk

This commit is contained in:
Emmanuel Bretelle 2008-02-26 18:30:21 +00:00
commit df5d260f05
3 changed files with 118 additions and 55 deletions

View File

@ -10,73 +10,88 @@ This manual page documents briefly the
The options are defined one per line as \fB'OPTION = VALUE'\fR. The options are described below: The options are defined one per line as \fB'OPTION = VALUE'\fR. The options are described below:
.TP .TP
.B gt_dir .B allow_bold\fR (boolean)
Default value: \fB/apps/gnome\-terminal\fR If true, allow applications in the terminal to make text boldface.
Default value: \fBTrue\fR
.TP .TP
.B _profile_dir .B silent_bell\fR (boolean)
Default value: \fB%s/profiles\fR If true, don't make a noise when applications send the escape sequence for the terminal bell. Flash the terminal instead.
.TP Default value: \fBTrue\fR
.B allow_bold
Boolean value. Default value: \fBTrue\fR
.TP
.B silent_bell
Boolean value. Default value: \fBTrue\fR
.TP .TP
.B background_color .B background_color
Heximal RGB value for the background color. Default value: \fB#000000\fR Default colour of terminal background, as a colour specification (can be HTML-style hex digits, or a colour name such as "red").
Default value: \fB#000000\fR
.TP .TP
.B background_darkness .B background_darkness
Number for the background darkness. Default value: \fB0.5\fR A value between 0.0 and 1.0 indicating how much to darken the background image. 0.0 means no darkness, 1.0 means fully dark. In the current implementation, there are only two levels of darkness possible, so the setting behaves as a boolean, where 0.0 disables the darkening effect.
Default value: \fB0.5\fR
.TP .TP
.B background_type .B background_type
Type of terminal background. May be "solid" for a solid colour, "image" for an image, or "transparent" for full transparency in compositing window managers, otherwise pseudo transparency.
Default value: \fBsolid\fR Default value: \fBsolid\fR
.TP .TP
.B backspace_binding .B backspace_binding
Sets what code the backspace key generates. Possible values are "ascii-del" for the ASCII DEL character, "control-h" for Control-H (AKA the ASCII BS character), "escape-sequence" for the escape sequence typically bound to backspace or delete. "ascii-del" is normally considered the correct setting for the Backspace key.
Default value: \fBascii\-del\fR Default value: \fBascii\-del\fR
.TP .TP
.B delete_binding .B delete_binding
Sets what code the delete key generates. Possible values are "ascii-del" for the ASCII DEL character, "control-h" for Control-H (AKA the ASCII BS character), "escape-sequence" for the escape sequence typically bound to backspace or delete. "escape-sequence" is normally considered the correct setting for the Delete key.
Default value: \fBdelete\-sequence\fR Default value: \fBdelete\-sequence\fR
.TP .TP
.B cursor_blink .B cursor_blink \fR(boolean)
Boolean value. Default value: \fBFalse\fR Controls if the cursor blinks.
Default value: \fBFalse\fR
.TP .TP
.B emulation .B emulation
Sets what type of terminal should be emulated.
Default value: \fBxterm\fR Default value: \fBxterm\fR
.TP .TP
.B font .B font
Value for the font time and size in the format \fBFONTNAME SIZENUMBER\fR. Default value: \fBSerif 10\fR An Pango font name. Examples are "Sans 12" or "Monospace Bold 14".
Default value: \fBSerif 10\fR
.TP .TP
.B foreground_color .B foreground_color
Hexadecimal RGB value for the font color. Default value: \fB#AAAAAA\fR Default colour of text in the terminal, as a colour specification (can be HTML-style hex digits, or a colour name such as "red").
Default value: \fB#AAAAAA\fR
.TP .TP
.B scrollbar_position .B scrollbar_position
Scrollbar position. Options available: right, left and hidden. Default value: \fBright\fR Where to put the terminal scrollbar. Possibilities are "left", "right", and "disabled".
Default value: \fBright\fR
.TP .TP
.B scroll_background .B scroll_background \fR(boolean)
Boolean value. Default value: \fBTrue\fR If true, scroll the background image with the foreground text; if false, keep the image in a fixed position and scroll the text above it.
Default value: \fBTrue\fR
.TP .TP
.B scroll_on_keystroke .B scroll_on_keystroke \fR(boolean)
Boolean value. Default value: \fBFalse\fR If true, pressing a key jumps the scrollbar to the bottom.
.TP
.B scroll_on_output
Boolean value. Default value: \fBFalse\fR
.TP
.B scrollback_lines
Number of lines stored for the scrollbar. Default value: \fB100\fR
.TP
.B focus
Default value: \fBsloppy\fR
.TP
.B child_restart
Default value: \fBFalse\fR Default value: \fBFalse\fR
.TP .TP
.B scroll_on_output \fR(boolean)
If true, whenever there's new output the terminal will scroll to the bottom.
Default value: \fBFalse\fR
.TP
.B scrollback_lines
Number of scrollback lines to keep around. You can scroll back in the terminal by this number of lines; lines that don't fit in the scrollback are discarded. Be careful with this setting; it's the primary factor in determining how much memory the terminal will use.
Default value: \fB100\fR
.TP
.B focus
Sets what type of mouse events should determine terminal focus. Can be "sloppy" or "click". "mouse" is also interpreted as "sloppy".
Default value: \fBsloppy\fR
.TP
.B exit_action
Possible values are "close" to close the terminal, and "restart" to restart the command.
Default value: \fBclose\fR
.TP
.B palette .B palette
Terminals have a 16-colour palette that applications inside the terminal can use. This is that palette, in the form of a colon-separated list of colour names. Colour names should be in hex format e.g. "#FF00FF".
Default value: \fB#000000000000:#CDCD00000000:#0000CDCD0000:#CDCDCDCD0000:#30BF30BFA38E:#A53C212FA53C:#0000CDCDCDCD:#FAFAEBEBD7D7:#404040404040:#FFFF00000000:#0000FFFF0000:#FFFFFFFF0000:#00000000FFFF:#FFFF0000FFFF:#0000FFFFFFFF:#FFFFFFFFFFFF\fR Default value: \fB#000000000000:#CDCD00000000:#0000CDCD0000:#CDCDCDCD0000:#30BF30BFA38E:#A53C212FA53C:#0000CDCDCDCD:#FAFAEBEBD7D7:#404040404040:#FFFF00000000:#0000FFFF0000:#FFFFFFFF0000:#00000000FFFF:#FFFF0000FFFF:#0000FFFFFFFF:#FFFFFFFFFFFF\fR
.TP .TP
.B word_chars .B word_chars
When selecting text by word, sequences of these characters are considered single words. Ranges can be given as "A-Z". Literal hyphen (not expressing a range) should be the first character given.
Default value: \fB\-A\-Za\-z0\-9,./?%&#:_\fR Default value: \fB\-A\-Za\-z0\-9,./?%&#:_\fR
.TP .TP
.B mouse_autohide .B mouse_autohide \fR(boolean)
Boolean value. Default value: \fBTrue\fR Controls whether the mouse cursor should be hidden while typing.
Default value: \fBTrue\fR
.SH "SEE ALSO" .SH "SEE ALSO"
.BR gnome\-terminal(1), .BR gnome\-terminal(1)

View File

@ -54,6 +54,7 @@ setup(name='Terminator',
data_files=[ data_files=[
('share/applications', ['data/terminator.desktop']), ('share/applications', ['data/terminator.desktop']),
('share/man/man1', ['doc/terminator.1']), ('share/man/man1', ['doc/terminator.1']),
('share/man/man5', ['doc/terminatorrc.5']),
('share/pixmaps', ['data/icons/48x48/apps/terminator.png']), ('share/pixmaps', ['data/icons/48x48/apps/terminator.png']),
('share/icons/hicolor/scalable/apps', glob.glob('data/icons/scalable/apps/*.svg')), ('share/icons/hicolor/scalable/apps', glob.glob('data/icons/scalable/apps/*.svg')),
('share/icons/hicolor/16x16/apps', glob.glob('data/icons/16x16/apps/*.png')), ('share/icons/hicolor/16x16/apps', glob.glob('data/icons/16x16/apps/*.png')),

View File

@ -27,13 +27,42 @@ gettext.install ('terminator')
# import unix-lib # import unix-lib
import pwd import pwd
# import gconf if possible, if not construct a fake replacement
class fakegconfclient:
def get_string (self, key):
return ("")
def get_list (self, key, type):
return ([])
def add_dir (self, profile, path):
return (True)
def notify_add (self, profile, callback):
return (True)
def get_bool (self, key):
return (False)
def get (self, key):
return (0)
class fakegconf:
CLIENT_PRELOAD_RECURSIVE = False
VALUE_STRING = ""
VALUE_INT = 0
VALUE_FLOAT = 0.0
VALUE_BOOL = False
def client_get_default (self):
foo = fakegconfclient ()
return (foo)
try:
import gconf
except:
pass
# import gtk libs # import gtk libs
# check just in case anyone runs it on a non-gnome system. # check just in case anyone runs it on a non-gnome system.
try: try:
import gobject, gtk, gconf, pango import gobject, gtk, pango
except: except:
print >> sys.stderr, _("You need to install the python bindings for " \ print >> sys.stderr, _("You need to install the python bindings for " \
"gobject, gtk, gconf and pango to run Terminator.") "gobject, gtk and pango to run Terminator.")
sys.exit(1) sys.exit(1)
# import a library for viewing URLs # import a library for viewing URLs
@ -90,17 +119,6 @@ class TerminatorTerm:
'mouse_autohide' : True, 'mouse_autohide' : True,
} }
if os.path.exists(pwd.getpwuid(os.getuid())[5] + "/.terminatorrc"):
f = open(pwd.getpwuid(os.getuid())[5] + "/.terminatorrc")
config = f.readlines()
f.close()
for line in config:
line = line.strip()
if line:
(key,value) = line.split("=")
defaults[key.strip()]=value.strip()
matches = {} matches = {}
def __init__ (self, terminator, profile = None, command = None, cwd = None): def __init__ (self, terminator, profile = None, command = None, cwd = None):
@ -124,12 +142,25 @@ class TerminatorTerm:
if profile != "Default" and "Default" in profiles: if profile != "Default" and "Default" in profiles:
self.profile = '%s/Default'%(self.defaults['profile_dir']) self.profile = '%s/Default'%(self.defaults['profile_dir'])
if not self.profile:
print >> sys.stderr, _("Warning: unable to find profile %s. Continue with default values...") % profile
if self.profile: if self.profile:
self.gconf_client.add_dir (self.profile, gconf.CLIENT_PRELOAD_RECURSIVE) self.gconf_client.add_dir (self.profile, gconf.CLIENT_PRELOAD_RECURSIVE)
self.gconf_client.notify_add (self.profile, self.on_gconf_notification) self.gconf_client.notify_add (self.profile, self.on_gconf_notification)
else:
if os.path.exists (pwd.getpwuid(os.getuid ())[5] + "/.terminatorrc"):
f = open (pwd.getpwuid (os.getuid ())[5] + "/.terminatorrc")
config = f.readlines ()
f.close ()
for line in config:
try:
line = line.split("#")[0]
line = line.strip ()
if line:
(key,value) = line.split ("=")
print >> sys.stderr, _('''Overriding setting '%s' from default value '%s' to: '%s' ''')%(key.strip (), self.defaults[key.strip ()], value.strip ())
self.defaults[key.strip ()] = value.strip ()
except:
pass
self.gconf_client.add_dir ('/apps/metacity/general', gconf.CLIENT_PRELOAD_RECURSIVE) self.gconf_client.add_dir ('/apps/metacity/general', gconf.CLIENT_PRELOAD_RECURSIVE)
self.gconf_client.notify_add ('/apps/metacity/general/focus_mode', self.on_gconf_notification) self.gconf_client.notify_add ('/apps/metacity/general/focus_mode', self.on_gconf_notification)
@ -170,6 +201,7 @@ class TerminatorTerm:
#for testing purpose: drag-motion #for testing purpose: drag-motion
#self._vte.connect("drag-motion", self.on_drag_motion, self) #self._vte.connect("drag-motion", self.on_drag_motion, self)
self._vte.connect("drag-data-received", self.on_drag_data_received, self) self._vte.connect("drag-data-received", self.on_drag_data_received, self)
self._vte.connect ("composited-changed", self.on_composited_changed) self._vte.connect ("composited-changed", self.on_composited_changed)
# self._vte.connect ("window-title-changed", self.on_vte_title_change) # self._vte.connect ("window-title-changed", self.on_vte_title_change)
@ -342,10 +374,6 @@ class TerminatorTerm:
pane.set_position (position / 2) pane.set_position (position / 2)
def spawn_child (self, event=None): def spawn_child (self, event=None):
update_records = self.gconf_client.get_bool (self.profile + "/update_records") or True update_records = self.gconf_client.get_bool (self.profile + "/update_records") or True
login = self.gconf_client.get_bool (self.profile + "/login_shell") or False login = self.gconf_client.get_bool (self.profile + "/login_shell") or False
@ -984,6 +1012,21 @@ class Terminator:
return self.get_first_parent_paned(parent, vertical) return self.get_first_parent_paned(parent, vertical)
if __name__ == '__main__': if __name__ == '__main__':
try:
if (gconf):
pass
except:
# Install a fake gconf setup
gconf = fakegconf ()
def execute_cb (option, opt, value, parser):
assert value is None
value = []
while parser.rargs:
arg = parser.rargs[0]
value.append (arg)
del (parser.rargs[0])
setattr(parser.values, option.dest, value)
def execute_cb (option, opt, value, parser): def execute_cb (option, opt, value, parser):
assert value is None assert value is None
@ -1003,6 +1046,7 @@ if __name__ == '__main__':
parser.add_option ("-p", "--profile", dest="profile", help="Specify a GNOME Terminal profile to emulate") parser.add_option ("-p", "--profile", dest="profile", help="Specify a GNOME Terminal profile to emulate")
parser.add_option ("-e", "--command", dest="command", help="Execute the argument to this option inside the terminal") parser.add_option ("-e", "--command", dest="command", help="Execute the argument to this option inside the terminal")
parser.add_option ("-x", "--execute", dest="execute", action="callback", callback=execute_cb, help="Execute the remainder of the command line inside the terminal") parser.add_option ("-x", "--execute", dest="execute", action="callback", callback=execute_cb, help="Execute the remainder of the command line inside the terminal")
parser.add_option ("-g", "--no-gconf", dest="nogconf", action="store_true", help="Disable gconf usage, falling back on ~/.terminatorrc and defaults")
(options, args) = parser.parse_args () (options, args) = parser.parse_args ()
if len (args) != 0: if len (args) != 0:
@ -1013,6 +1057,9 @@ if __name__ == '__main__':
command.append (options.command) command.append (options.command)
if (options.execute): if (options.execute):
command = options.execute command = options.execute
if (options.nogconf):
del (gconf)
gconf = fakegconf ()
term = Terminator (options.profile, command) term = Terminator (options.profile, command)