|
|
@ -108,6 +108,12 @@ class MenuEntry: |
|
|
|
return repr((self.category, self.name, self.icon, self.command)) |
|
|
|
|
|
|
|
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) |
|
|
|
if icon.endswith('.png'): |
|
|
|
icon = icon.replace('.png', '') |
|
|
@ -278,6 +284,9 @@ def fluxboxmenu(): |
|
|
|
spacing = ' ' |
|
|
|
if seticon == True: |
|
|
|
app_icon = icon_full_path(applications_icon) |
|
|
|
if app_icon is None: |
|
|
|
print '[submenu] ('+applications+')' |
|
|
|
else: |
|
|
|
print '[submenu] ('+applications+') <'+app_icon+'>' |
|
|
|
else: |
|
|
|
print '[submenu] ('+applications+')' |
|
|
@ -327,6 +336,8 @@ def icewmmenu(): |
|
|
|
spacing = ' ' |
|
|
|
if seticon == True: |
|
|
|
app_icon = icon_full_path(applications_icon) |
|
|
|
if app_icon is None: |
|
|
|
app_icon = "_none_" |
|
|
|
print 'menu "'+applications+'" '+app_icon+' {' |
|
|
|
else: |
|
|
|
print 'menu "'+applications+'" _none_ {' |
|
|
|