|
@ -35,6 +35,7 @@ iconsize = 16 |
|
|
desktop = False |
|
|
desktop = False |
|
|
submenu = True |
|
|
submenu = True |
|
|
pekwmdynamic = False |
|
|
pekwmdynamic = False |
|
|
|
|
|
twmtitles = False |
|
|
max_icon_size = False |
|
|
max_icon_size = False |
|
|
|
|
|
|
|
|
# the following line gets changed by the Makefile. If it is set to |
|
|
# the following line gets changed by the Makefile. If it is set to |
|
@ -168,11 +169,13 @@ def main(argv): |
|
|
global iconsize |
|
|
global iconsize |
|
|
global submenu |
|
|
global submenu |
|
|
global pekwmdynamic |
|
|
global pekwmdynamic |
|
|
|
|
|
global twmtitles |
|
|
global max_icon_size |
|
|
global max_icon_size |
|
|
try: |
|
|
try: |
|
|
opts, args = getopt.getopt(argv, "hins:f:", ["help", "icons", |
|
|
opts, args = getopt.getopt(argv, "hins:f:", ["help", "icons", |
|
|
"no-submenu", |
|
|
"no-submenu", |
|
|
"pekwm-dynamic", |
|
|
"pekwm-dynamic", |
|
|
|
|
|
"twm-titles", |
|
|
"max-icon-size", |
|
|
"max-icon-size", |
|
|
"size=", |
|
|
"size=", |
|
|
"format="]) |
|
|
"format="]) |
|
@ -195,6 +198,8 @@ def main(argv): |
|
|
submenu = False |
|
|
submenu = False |
|
|
elif opt in ("--pekwm-dynamic",): |
|
|
elif opt in ("--pekwm-dynamic",): |
|
|
pekwmdynamic = True |
|
|
pekwmdynamic = True |
|
|
|
|
|
elif opt in ("--twm-titles",): |
|
|
|
|
|
twmtitles = True |
|
|
elif opt in ("--max-icon-size",): |
|
|
elif opt in ("--max-icon-size",): |
|
|
try: |
|
|
try: |
|
|
# Pillow is optional and loaded only if we want to restrict the |
|
|
# Pillow is optional and loaded only if we want to restrict the |
|
@ -252,6 +257,7 @@ def usage(): |
|
|
print(' windowmaker') |
|
|
print(' windowmaker') |
|
|
print(' --max-icon-size restrict the icon sizes to the specified size') |
|
|
print(' --max-icon-size restrict the icon sizes to the specified size') |
|
|
print(' --pekwm-dynamic generate dynamic menus for pekwm') |
|
|
print(' --pekwm-dynamic generate dynamic menus for pekwm') |
|
|
|
|
|
print(' --twm-titles show menu titles in twm menus') |
|
|
print(' -h, --help show this help message') |
|
|
print(' -h, --help show this help message') |
|
|
print(' You have to specify the output format using the -f switch.') |
|
|
print(' You have to specify the output format using the -f switch.') |
|
|
print() |
|
|
print() |
|
@ -790,6 +796,8 @@ def twm(): |
|
|
if submenu: |
|
|
if submenu: |
|
|
print('menu "xdgmenu"') |
|
|
print('menu "xdgmenu"') |
|
|
print("{") |
|
|
print("{") |
|
|
|
|
|
if twmtitles: |
|
|
|
|
|
print(' "{a}" f.title'.format(a=apps_name)) |
|
|
for menu_category in menu(): |
|
|
for menu_category in menu(): |
|
|
category = menu_category.category |
|
|
category = menu_category.category |
|
|
cat_name = category.decode() |
|
|
cat_name = category.decode() |
|
@ -800,6 +808,8 @@ def twm(): |
|
|
cat_name = category.decode() |
|
|
cat_name = category.decode() |
|
|
print('menu "{}"'.format(cat_name)) |
|
|
print('menu "{}"'.format(cat_name)) |
|
|
print("{") |
|
|
print("{") |
|
|
|
|
|
if twmtitles: |
|
|
|
|
|
print(' "{c}" f.title'.format(c=cat_name)) |
|
|
for app in menu_category.applist: |
|
|
for app in menu_category.applist: |
|
|
name = app.name.decode() |
|
|
name = app.name.decode() |
|
|
# for some apps (like netbeans) the command is launched with |
|
|
# for some apps (like netbeans) the command is launched with |
|
|