diff --git a/debian/control b/debian/control index 1c5d103c..dae7b51c 100644 --- a/debian/control +++ b/debian/control @@ -13,6 +13,7 @@ Package: terminator Architecture: all Depends: ${python:Depends}, python-vte, python-gconf, gconf2 XB-Python-Version: ${python:Versions} +Recommends: xdg-utils, python-xdg Description: Multiple GNOME terminals in one window This is a project to produce an efficient way of filling a large area of screen space with terminals. This is done by diff --git a/doc/terminatorrc.5 b/doc/terminatorrc.5 index 9beaf8de..4e945823 100644 --- a/doc/terminatorrc.5 +++ b/doc/terminatorrc.5 @@ -1,6 +1,7 @@ .TH "TERMINATORRC" "5" "Feb 22, 2008" "Nicolas Valcarcel " "" .SH "NAME" -~/.terminatorrc \- the config file for terminator terminal emulator. +${XDG_CONFIG_HOME}/terminator/terminatorrc (usually ~/.config/terminator/terminatorrc) +or ~/.terminatorrc \- the config file for terminator terminal emulator. .SH "DESCRIPTION" This manual page documents briefly the .B termiatorrc config file. diff --git a/terminator b/terminator index beb2d9a3..deec6402 100755 --- a/terminator +++ b/terminator @@ -69,6 +69,7 @@ except: "gobject, gtk and pango to run Terminator.") sys.exit(1) + # import a library for viewing URLs try: # gnome.url_show() is really useful @@ -88,11 +89,18 @@ except: error.run() sys.exit (1) +def exec_command(executable, *parameters): + command = [executable] + command.extend(parameters) + + return os.system(command[0] + " \"%s\"" %command[1]) + def openurl (url): - try: - url_show (url) - except: - pass + if exec_command("xdg-open", url): + try: + url_show (url) + except: + pass class TerminatorTerm (gtk.VBox): diff --git a/terminatorlib/config.py b/terminatorlib/config.py index c5643d58..d88baeaf 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -37,6 +37,12 @@ import os, sys, re # import unix-lib import pwd +HAS_XDG = True +try: + import xdg.BaseDirectory +except: + HAS_XDG = False + # set this to true to enable debugging output debug = True @@ -142,7 +148,11 @@ class TerminatorConfValuestoreRC (TerminatorConfValuestore): # that can be re-used when rc changes. def __init__ (self): self.type = "RCFile" - self.rcfilename = os.path.join(os.path.expanduser("~"), ".terminatorrc") + if HAS_XDG and xdg.BaseDirectory.load_first_config('terminator'): + self.rcfilename = os.path.join(xdg.BaseDirectory.load_first_config('terminator'), "terminatorrc") + else: + self.rcfilename = os.path.join(os.path.expanduser("~"), ".terminatorrc") + if os.path.exists (self.rcfilename): rcfile = open (self.rcfilename) rc = rcfile.readlines ()