diff options
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/terminal.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 1455e8e719..43639d5ddd 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 | ||
60 | class 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 | |||
60 | class Konsole(XTerminal): | 74 | class 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 | |||
149 | def 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 | ||