Skip to content

Commit

Permalink
Add support for JWM
Browse files Browse the repository at this point in the history
  • Loading branch information
gapan committed Jul 21, 2014
1 parent 377c636 commit da8ccd9
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/xdgmenumaker
Expand Up @@ -102,6 +102,8 @@ def main(argv):
icewmmenu() icewmmenu()
elif desktop == "pekwm": elif desktop == "pekwm":
pekwmmenu() pekwmmenu()
elif desktop == "jwm":
jwmmenu()
else: else:
usage() usage()
sys.exit(2) sys.exit(2)
Expand Down Expand Up @@ -447,5 +449,46 @@ def pekwmmenu():
if pekwmdynamic is True: if pekwmdynamic is True:
print "}" print "}"


def jwmmenu():
global seticon
global submenu
print '<?xml version="1.0"?>'
print '<JWM>'
if submenu is True:
spacing = ' '
if seticon == True:
app_icon = icon_full_path(applications_icon)
if app_icon is None:
print '<Menu label="'+applications+'">'
else:
print '<Menu icon="'+app_icon+'" label="'+applications+'">'
else:
print '<Menu label="'+applications+'">'
else:
spacing = ''
for i in menu():
category = i[0]
cat_icon = category_icon(category)
cat_icon = icon_full_path(cat_icon)
if seticon is True and cat_icon is not None:
print spacing+'<Menu icon="'+cat_icon+'" label="'+category+'">'
else:
print spacing+'<Menu label="'+category+'">'
for j in i[1]:
name = j[0]
icon = j[1]
command = j[2]
path = j[3]
if path is not None:
command = 'cd '+path+' ; '+command
if seticon is True and icon is not None:
print spacing+' <Program icon="'+icon+'" label="'+name+'">'+command+'</Program>'
else:
print spacing+' <Program label="'+name+'">'+command+'</Program>'
print spacing+'</Menu>'
if submenu is True:
print '</Menu>'
print '</JWM>'

if __name__ == "__main__": if __name__ == "__main__":
main(sys.argv[1:]) main(sys.argv[1:])

0 comments on commit da8ccd9

Please sign in to comment.