summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-10-31 21:53:14 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-01 14:51:37 (GMT)
commit0f24f2dd70e2ef904ce4e3a8226c5602a6ed6aec (patch)
treecc00dee76d3e61ec007571e6ddd524977c4985db /meta/lib
parentc3c7ff70abd198b2e33f07d5cb3f5fab6aad1e23 (diff)
downloadpoky-0f24f2dd70e2ef904ce4e3a8226c5602a6ed6aec.tar.gz
lib/oe/terminal: add support for XFCE's terminal emulator
That's Terminal on Fedora and xfce4-terminal on Ubuntu/Debian... This could get interesting! (From OE-Core rev: 162b70a36388ac44fc1b39e172cd53579707bff3) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/terminal.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 1455e8e..43639d5 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -57,6 +57,20 @@ class Gnome(XTerminal):
57 command = 'gnome-terminal --disable-factory -t "{title}" -x {command}' 57 command = 'gnome-terminal --disable-factory -t "{title}" -x {command}'
58 priority = 2 58 priority = 2
59 59
60class Xfce(XTerminal):
61 command = 'Terminal -T "{title}" -e "{command}"'
62 priority = 2
63
64 def __init__(self, command, title=None, env=None):
65 # Upstream binary name is Terminal but Debian/Ubuntu use
66 # xfce4-terminal to avoid possible(?) conflicts
67 distro = distro_name()
68 if distro == 'ubuntu' or distro == 'debian':
69 cmd = 'xfce4-terminal -T "{title}" -e "{command}"'
70 else:
71 cmd = command
72 XTerminal.__init__(self, cmd, title, env)
73
60class Konsole(XTerminal): 74class Konsole(XTerminal):
61 command = 'konsole -T "{title}" -e {command}' 75 command = 'konsole -T "{title}" -e {command}'
62 priority = 2 76 priority = 2
@@ -131,3 +145,12 @@ def check_konsole_version(konsole):
131 if ver.startswith('Konsole'): 145 if ver.startswith('Konsole'):
132 vernum = ver.split(' ')[-1] 146 vernum = ver.split(' ')[-1]
133 return vernum 147 return vernum
148
149def distro_name():
150 try:
151 p = Popen(['lsb_release', '-i'])
152 out, err = p.communicate()
153 distro = out.split(':')[1].strip().lower()
154 except:
155 distro = "unknown"
156 return distro