From 7aabe6a5e3bab5c234b2a7a4b327c142b0e64947 Mon Sep 17 00:00:00 2001 From: gapan Date: Sun, 24 Jun 2012 11:22:25 +0000 Subject: [PATCH] Added support for creating menus for icewm --- src/xdgmenumaker | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/xdgmenumaker b/src/xdgmenumaker index 74b0007..408e1cb 100755 --- a/src/xdgmenumaker +++ b/src/xdgmenumaker @@ -73,6 +73,8 @@ def main(argv): elif desktop == "windowmaker": seticon = False windowmakermenu() + elif desktop == "icewm": + icewmmenu() else: usage() sys.exit(2) @@ -296,5 +298,25 @@ def windowmakermenu(): print ' "'+category+'" END' print '"'+applications+'" END' +def icewmmenu(): + global seticon + 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 'menu "'+category+'" '+cat_icon+' {' + else: + print 'menu "'+category+'" _none_ {' + for j in i[1]: + name = j[0] + icon = j[1] + command = j[2] + if seticon is True and icon is not None: + print ' prog "'+name+'" '+icon+' '+command + else: + print ' prog "'+name+'" _none_ '+command + print '}' + if __name__ == "__main__": main(sys.argv[1:])