From 4f36bd8f2f8fbe56822f67d1e11ea4ef1139cb25 Mon Sep 17 00:00:00 2001 From: Gregor Bollerhey Date: Sat, 11 Jan 2014 06:00:38 +0100 Subject: [PATCH] Use standard terminal on debian-like distributions. --- src/xdgmenumaker | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/xdgmenumaker b/src/xdgmenumaker index 67ade6e..47f1847 100755 --- a/src/xdgmenumaker +++ b/src/xdgmenumaker @@ -1,6 +1,7 @@ #!/usr/bin/env python import os +import os.path import sys import getopt import gtk @@ -13,6 +14,12 @@ seticon = False desktop = False submenu = True +# use debians alternative system if available +if os.path.exists('/etc/alternatives/x-terminal-emulator'): + terminal = 'x-terminal-emulator' +else: + terminal = 'xterm' + de = dentry.DesktopEntry(filename = '/usr/share/desktop-directories/xdgmenumaker-applications.directory') applications = de.getName().encode('utf-8') applications_icon = de.getIcon() @@ -155,9 +162,9 @@ def get_entry_info(desktopfile): if depath: command = 'cd %s && %s' % (depath, command) - terminal = de.getTerminal() - if terminal is True: - command = 'xterm -e '+command + use_terminal = de.getTerminal() + if use_terminal is True: + command = '%s -e %s' % (terminal, command) # cleaning up categories and keeping only registered freedesktop.org main categories categories = de.getCategories()