merged trunk
This commit is contained in:
commit
53a6677be9
|
@ -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)
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -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')),
|
||||||
|
|
133
terminator
133
terminator
|
@ -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
|
||||||
|
@ -64,7 +93,6 @@ def openurl (url):
|
||||||
class TerminatorTerm:
|
class TerminatorTerm:
|
||||||
|
|
||||||
# Our settings
|
# Our settings
|
||||||
# FIXME: Add commandline and/or gconf options to change these
|
|
||||||
defaults = {
|
defaults = {
|
||||||
'gt_dir' : '/apps/gnome-terminal',
|
'gt_dir' : '/apps/gnome-terminal',
|
||||||
'_profile_dir' : '%s/profiles',
|
'_profile_dir' : '%s/profiles',
|
||||||
|
@ -91,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):
|
||||||
|
@ -125,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)
|
||||||
|
@ -390,8 +420,8 @@ class TerminatorTerm:
|
||||||
|
|
||||||
if ret == None:
|
if ret == None:
|
||||||
print >> sys.stderr, _('Unknown value requested. Unable to find in gconf profile or default settings: ') + property
|
print >> sys.stderr, _('Unknown value requested. Unable to find in gconf profile or default settings: ') + property
|
||||||
sys.exit (1)
|
|
||||||
return ret
|
return (ret)
|
||||||
|
|
||||||
def reconfigure_vte (self):
|
def reconfigure_vte (self):
|
||||||
# Set our emulation
|
# Set our emulation
|
||||||
|
@ -448,25 +478,6 @@ class TerminatorTerm:
|
||||||
fg_color = gtk.gdk.color_parse (self.reconf ('foreground_color'))
|
fg_color = gtk.gdk.color_parse (self.reconf ('foreground_color'))
|
||||||
bg_color = gtk.gdk.color_parse (self.reconf ('background_color'))
|
bg_color = gtk.gdk.color_parse (self.reconf ('background_color'))
|
||||||
|
|
||||||
# Set our background image, transparency and type
|
|
||||||
background_type = self.reconf ('background_type')
|
|
||||||
|
|
||||||
if background_type == "solid":
|
|
||||||
self._vte.set_background_image_file ('')
|
|
||||||
self._vte.set_background_transparent (False)
|
|
||||||
if background_type == "image":
|
|
||||||
self._vte.set_background_image_file (self.reconf ('background_image'))
|
|
||||||
self._vte.set_scroll_background (self.reconf ('scroll_background'))
|
|
||||||
self._vte.set_background_transparent (False)
|
|
||||||
if background_type == "transparent":
|
|
||||||
darkness = self.reconf ('background_darkness')
|
|
||||||
if self._vte.is_composited():
|
|
||||||
self._vte.set_background_transparent (False)
|
|
||||||
self._vte.set_opacity(int(darkness * 65535))
|
|
||||||
else:
|
|
||||||
self._vte.set_background_transparent (True)
|
|
||||||
self._vte.set_background_saturation (1 - darkness)
|
|
||||||
|
|
||||||
colors = palette.split (':')
|
colors = palette.split (':')
|
||||||
palette = []
|
palette = []
|
||||||
for color in colors:
|
for color in colors:
|
||||||
|
@ -474,6 +485,32 @@ class TerminatorTerm:
|
||||||
palette.append (gtk.gdk.color_parse (color))
|
palette.append (gtk.gdk.color_parse (color))
|
||||||
self._vte.set_colors (fg_color, bg_color, palette)
|
self._vte.set_colors (fg_color, bg_color, palette)
|
||||||
|
|
||||||
|
# Set our background image, transparency and type
|
||||||
|
# Many thanks to the authors of gnome-terminal, on which this code is based.
|
||||||
|
background_type = self.reconf ('background_type')
|
||||||
|
|
||||||
|
# set background image settings
|
||||||
|
if background_type == "image":
|
||||||
|
self._vte.set_background_image_file (self.reconf ('background_image'))
|
||||||
|
self._vte.set_scroll_background (self.reconf('scroll_background'))
|
||||||
|
else:
|
||||||
|
self._vte.set_background_image_file('')
|
||||||
|
self._vte.set_scroll_background(False)
|
||||||
|
|
||||||
|
# set transparency for the background (image)
|
||||||
|
if background_type in ("image", "transparent"):
|
||||||
|
self._vte.set_background_tint_color (bg_color)
|
||||||
|
self._vte.set_background_saturation(1 - (self.reconf ('background_darkness')))
|
||||||
|
self._vte.set_opacity(int(self.reconf('background_darkness') * 65535))
|
||||||
|
else:
|
||||||
|
self._vte.set_background_saturation(1)
|
||||||
|
self._vte.set_opacity(65535)
|
||||||
|
|
||||||
|
if not self._vte.is_composited():
|
||||||
|
self._vte.set_background_transparent (background_type == "transparent")
|
||||||
|
else:
|
||||||
|
self._vte.set_background_transparent (False)
|
||||||
|
|
||||||
# Set our cursor blinkiness
|
# Set our cursor blinkiness
|
||||||
self._vte.set_cursor_blinks = (self.reconf ('cursor_blink'))
|
self._vte.set_cursor_blinks = (self.reconf ('cursor_blink'))
|
||||||
|
|
||||||
|
@ -822,11 +859,13 @@ class Terminator:
|
||||||
|
|
||||||
parent.add (pane)
|
parent.add (pane)
|
||||||
|
|
||||||
position = (vertical) and parent.allocation.height or parent.allocation.width
|
position = (vertical) and parent.allocation.height \
|
||||||
|
or parent.allocation.width
|
||||||
|
|
||||||
if isinstance (parent, gtk.Paned):
|
if isinstance (parent, gtk.Paned):
|
||||||
# We are inside a split term
|
# We are inside a split term
|
||||||
position = (vertical) and widget.get_box().allocation.height or widget.get_box().allocation.width
|
position = (vertical) and widget.get_box().allocation.height \
|
||||||
|
or widget.get_box().allocation.width
|
||||||
|
|
||||||
if (widget.get_box () == parent.get_child1 ()):
|
if (widget.get_box () == parent.get_child1 ()):
|
||||||
widget.get_box ().reparent (pane)
|
widget.get_box ().reparent (pane)
|
||||||
|
@ -968,7 +1007,13 @@ class Terminator:
|
||||||
return parent
|
return parent
|
||||||
return self.get_first_parent_paned(parent, vertical)
|
return self.get_first_parent_paned(parent, vertical)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
try:
|
||||||
|
if (gconf):
|
||||||
|
pass
|
||||||
|
except:
|
||||||
|
# Install a fake gconf setup
|
||||||
|
gconf = fakegconf ()
|
||||||
|
|
||||||
def execute_cb (option, opt, value, parser):
|
def execute_cb (option, opt, value, parser):
|
||||||
assert value is None
|
assert value is None
|
||||||
|
@ -979,8 +1024,6 @@ def execute_cb (option, opt, value, parser):
|
||||||
del (parser.rargs[0])
|
del (parser.rargs[0])
|
||||||
setattr(parser.values, option.dest, value)
|
setattr(parser.values, option.dest, value)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
|
|
||||||
usage = "usage: %prog [options]"
|
usage = "usage: %prog [options]"
|
||||||
parser = OptionParser (usage)
|
parser = OptionParser (usage)
|
||||||
parser.add_option ("-d", "--debug", action="store_true", dest="debug", help="Enable debugging information")
|
parser.add_option ("-d", "--debug", action="store_true", dest="debug", help="Enable debugging information")
|
||||||
|
@ -990,6 +1033,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:
|
||||||
|
@ -1000,6 +1044,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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue