|
@ -231,6 +231,8 @@ def main(argv): |
|
|
jwm() |
|
|
jwm() |
|
|
elif desktop == "compizboxmenu": |
|
|
elif desktop == "compizboxmenu": |
|
|
compizboxmenu() |
|
|
compizboxmenu() |
|
|
|
|
|
elif desktop == "twm": |
|
|
|
|
|
twm() |
|
|
else: |
|
|
else: |
|
|
usage() |
|
|
usage() |
|
|
sys.exit(2) |
|
|
sys.exit(2) |
|
@ -241,8 +243,8 @@ def usage(): |
|
|
print() |
|
|
print() |
|
|
print('OPTIONS:') |
|
|
print('OPTIONS:') |
|
|
print(' -f, --format the output format to use.') |
|
|
print(' -f, --format the output format to use.') |
|
|
print(' Valid options are blackbox, compizboxmenu,') |
|
|
print(' Valid options are blackbox, compizboxmenu, fluxbox,') |
|
|
print(' fluxbox, fvwm, icewm, jwm, windowmaker and pekwm') |
|
|
print(' fvwm, twm, icewm, jwm, windowmaker and pekwm') |
|
|
print(' -i, --icons enable support for icons in the') |
|
|
print(' -i, --icons enable support for icons in the') |
|
|
print(' menus. Does not work with windowmaker') |
|
|
print(' menus. Does not work with windowmaker') |
|
|
print(' -s, --size preferred icon size in pixels (default: 16)') |
|
|
print(' -s, --size preferred icon size in pixels (default: 16)') |
|
@ -783,5 +785,34 @@ def compizboxmenu(): |
|
|
if submenu: |
|
|
if submenu: |
|
|
print('</menu>') |
|
|
print('</menu>') |
|
|
|
|
|
|
|
|
|
|
|
def twm(): |
|
|
|
|
|
if submenu: |
|
|
|
|
|
print('menu "xdgmenu"') |
|
|
|
|
|
print("{") |
|
|
|
|
|
for menu_category in menu(): |
|
|
|
|
|
category = menu_category.category |
|
|
|
|
|
cat_name = category.decode() |
|
|
|
|
|
print(' "{c}" f.menu "{c}"'.format(c=cat_name)) |
|
|
|
|
|
print("}") |
|
|
|
|
|
for menu_category in menu(): |
|
|
|
|
|
category = menu_category.category |
|
|
|
|
|
cat_name = category.decode() |
|
|
|
|
|
print('menu "{}"'.format(cat_name)) |
|
|
|
|
|
print("{") |
|
|
|
|
|
for app in menu_category.applist: |
|
|
|
|
|
name = app.name.decode() |
|
|
|
|
|
command = app.command |
|
|
|
|
|
# for some apps (like netbeans) the command is launched with |
|
|
|
|
|
# /bin/sh "command" |
|
|
|
|
|
# and the quotes get mixed up with the quotes twm puts |
|
|
|
|
|
# around the command, so we're just stripping the quotes |
|
|
|
|
|
command = app.command.replace('"', '') |
|
|
|
|
|
path = app.path |
|
|
|
|
|
if path is not None: |
|
|
|
|
|
print(' "{n}" f.exec "cd {p} ; {c} &"'.format(n=name, p=path, c=command)) |
|
|
|
|
|
else: |
|
|
|
|
|
print(' "{n}" f.exec "{c} &"'.format(n=name, c=command)) |
|
|
|
|
|
print("}") |
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
if __name__ == "__main__": |
|
|
main(sys.argv[1:]) |
|
|
main(sys.argv[1:]) |
|
|