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) (From OE-Core rev: 149cc418dbcbe014225c86d16b5ef696496e3a39) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
0524f419cf
commit
2dbcd4154c
|
@ -57,6 +57,20 @@ class Gnome(XTerminal):
|
||||||
command = 'gnome-terminal --disable-factory -t "{title}" -x {command}'
|
command = 'gnome-terminal --disable-factory -t "{title}" -x {command}'
|
||||||
priority = 2
|
priority = 2
|
||||||
|
|
||||||
|
class Xfce(XTerminal):
|
||||||
|
command = 'Terminal -T "{title}" -e "{command}"'
|
||||||
|
priority = 2
|
||||||
|
|
||||||
|
def __init__(self, command, title=None, env=None):
|
||||||
|
# Upstream binary name is Terminal but Debian/Ubuntu use
|
||||||
|
# xfce4-terminal to avoid possible(?) conflicts
|
||||||
|
distro = distro_name()
|
||||||
|
if distro == 'ubuntu' or distro == 'debian':
|
||||||
|
cmd = 'xfce4-terminal -T "{title}" -e "{command}"'
|
||||||
|
else:
|
||||||
|
cmd = command
|
||||||
|
XTerminal.__init__(self, cmd, title, env)
|
||||||
|
|
||||||
class Konsole(XTerminal):
|
class Konsole(XTerminal):
|
||||||
command = 'konsole -T "{title}" -e {command}'
|
command = 'konsole -T "{title}" -e {command}'
|
||||||
priority = 2
|
priority = 2
|
||||||
|
@ -131,3 +145,12 @@ def check_konsole_version(konsole):
|
||||||
if ver.startswith('Konsole'):
|
if ver.startswith('Konsole'):
|
||||||
vernum = ver.split(' ')[-1]
|
vernum = ver.split(' ')[-1]
|
||||||
return vernum
|
return vernum
|
||||||
|
|
||||||
|
def distro_name():
|
||||||
|
try:
|
||||||
|
p = Popen(['lsb_release', '-i'])
|
||||||
|
out, err = p.communicate()
|
||||||
|
distro = out.split(':')[1].strip().lower()
|
||||||
|
except:
|
||||||
|
distro = "unknown"
|
||||||
|
return distro
|
||||||
|
|
Loading…
Reference in New Issue