Browse Source

Use standard terminal on debian-like distributions.

pull/1/head
Gregor Bollerhey 11 years ago
parent
commit
4f36bd8f2f
  1. 13
      src/xdgmenumaker

13
src/xdgmenumaker

@ -1,6 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
import os import os
import os.path
import sys import sys
import getopt import getopt
import gtk import gtk
@ -13,6 +14,12 @@ seticon = False
desktop = False desktop = False
submenu = True 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') de = dentry.DesktopEntry(filename = '/usr/share/desktop-directories/xdgmenumaker-applications.directory')
applications = de.getName().encode('utf-8') applications = de.getName().encode('utf-8')
applications_icon = de.getIcon() applications_icon = de.getIcon()
@ -155,9 +162,9 @@ def get_entry_info(desktopfile):
if depath: if depath:
command = 'cd %s && %s' % (depath, command) command = 'cd %s && %s' % (depath, command)
terminal = de.getTerminal() use_terminal = de.getTerminal()
if terminal is True: if use_terminal is True:
command = 'xterm -e '+command command = '%s -e %s' % (terminal, command)
# cleaning up categories and keeping only registered freedesktop.org main categories # cleaning up categories and keeping only registered freedesktop.org main categories
categories = de.getCategories() categories = de.getCategories()

Loading…
Cancel
Save