|
|
@ -38,6 +38,7 @@ class App: |
|
|
|
''' |
|
|
|
A class to keep individual app details in. |
|
|
|
''' |
|
|
|
|
|
|
|
def __init__(self, name, icon, command, path): |
|
|
|
self.name = name |
|
|
|
self.icon = icon |
|
|
@ -48,11 +49,13 @@ class App: |
|
|
|
return repr((self.name, self.icon, self.command, |
|
|
|
self.path)) |
|
|
|
|
|
|
|
|
|
|
|
class MenuEntry: |
|
|
|
''' |
|
|
|
A class for each menu entry. Includes the class category and app details |
|
|
|
from the App class. |
|
|
|
''' |
|
|
|
|
|
|
|
def __init__(self, category, app): |
|
|
|
self.category = category |
|
|
|
self.app = app |
|
|
@ -61,11 +64,13 @@ class MenuEntry: |
|
|
|
return repr((self.category, self.app.name, self.app.icon, |
|
|
|
self.app.command, self.app.path)) |
|
|
|
|
|
|
|
|
|
|
|
class MenuCategory: |
|
|
|
''' |
|
|
|
A class for each menu category. Keeps the category name and the list of |
|
|
|
apps that go in that category. |
|
|
|
''' |
|
|
|
|
|
|
|
def __init__(self, category, applist): |
|
|
|
self.category = category |
|
|
|
self.applist = applist |
|
|
@ -271,7 +276,6 @@ def get_entry_info(desktopfile, ico_paths=True): |
|
|
|
else: |
|
|
|
icon = None |
|
|
|
|
|
|
|
|
|
|
|
# removing any %U or %F from the exec line |
|
|
|
command = de.getExec().partition('%')[0] |
|
|
|
|
|
|
@ -409,6 +413,7 @@ def category_icon(category): |
|
|
|
icon = None |
|
|
|
return icon |
|
|
|
|
|
|
|
|
|
|
|
def blackbox(): |
|
|
|
# Blackbox menus are the same as Fluxbox menus. They just don't support |
|
|
|
# icons. |
|
|
@ -416,6 +421,7 @@ def blackbox(): |
|
|
|
seticon = False |
|
|
|
fluxbox() |
|
|
|
|
|
|
|
|
|
|
|
def fluxbox(): |
|
|
|
if submenu: |
|
|
|
spacing = ' ' |
|
|
@ -613,6 +619,7 @@ def jwm(): |
|
|
|
print('</Menu>') |
|
|
|
print('</JWM>') |
|
|
|
|
|
|
|
|
|
|
|
def compizboxmenu(): |
|
|
|
if submenu: |
|
|
|
spacing = ' ' |
|
|
@ -628,7 +635,8 @@ def compizboxmenu(): |
|
|
|
category = menu_category.category |
|
|
|
cat_icon = category_icon(category) |
|
|
|
if seticon and cat_icon is not None: |
|
|
|
print('{s}<menu icon="{i}" name="{c}">'.format(s=spacing, i=cat_icon, c=category)) |
|
|
|
print('{s}<menu icon="{i}" name="{c}">'.format( |
|
|
|
s=spacing, i=cat_icon, c=category)) |
|
|
|
else: |
|
|
|
print('{s}<menu name="{c}">'.format(s=spacing, c=category)) |
|
|
|
for app in menu_category.applist: |
|
|
|