Browse Source

Merge remote-tracking branch 'mrbrainsample/master'

pull/1/merge
George Vlahavas 12 years ago
parent
commit
fbb3b87da3
  1. 11
      src/xdgmenumaker

11
src/xdgmenumaker

@ -108,6 +108,12 @@ class MenuEntry:
return repr((self.category, self.name, self.icon, self.command)) return repr((self.category, self.name, self.icon, self.command))
def icon_full_path(icon): def icon_full_path(icon):
# If the icon path is absolute and exists, leave it alone.
# This takes care of software that has its own icons stored
# in non-standard directories
if os.path.exists(icon) == True:
return icon
else:
icon = os.path.basename(icon) icon = os.path.basename(icon)
if icon.endswith('.png'): if icon.endswith('.png'):
icon = icon.replace('.png', '') icon = icon.replace('.png', '')
@ -278,6 +284,9 @@ def fluxboxmenu():
spacing = ' ' spacing = ' '
if seticon == True: if seticon == True:
app_icon = icon_full_path(applications_icon) app_icon = icon_full_path(applications_icon)
if app_icon is None:
print '[submenu] ('+applications+')'
else:
print '[submenu] ('+applications+') <'+app_icon+'>' print '[submenu] ('+applications+') <'+app_icon+'>'
else: else:
print '[submenu] ('+applications+')' print '[submenu] ('+applications+')'
@ -327,6 +336,8 @@ def icewmmenu():
spacing = ' ' spacing = ' '
if seticon == True: if seticon == True:
app_icon = icon_full_path(applications_icon) app_icon = icon_full_path(applications_icon)
if app_icon is None:
app_icon = "_none_"
print 'menu "'+applications+'" '+app_icon+' {' print 'menu "'+applications+'" '+app_icon+' {'
else: else:
print 'menu "'+applications+'" _none_ {' print 'menu "'+applications+'" _none_ {'

Loading…
Cancel
Save