Page 1 of 1

xdgmenumaker enabled for pekwm

Posted: 15. Jan 2014, 19:23
by marin
Expand the usability of xdgmenumaker to produce apps submenus for pekwm:

line 365 from github ver 0.4 xdgmenumaker/src/xdgmenumaker, insert:

Code: Select all

def pekwmmenu():
	global seticon
	global submenu
	print '#!/usr/bin/ruby'
	print '# inclusive app menu for pekwm menu or add to existing menu file:'
	print '# Entry = "" { Actions = "Dynamic /usr/bin/xdgmenumaker -i -f pekwm" }'
	if submenu is True:
		# spacing = '  '
		spacing = '	'
		if seticon == True:
			app_icon = icon_full_path(applications_icon)
			print 'Submenu = "'+applications+'" { Icon = "'+app_icon+'"'
		else:
			print 'Submenu = "'+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+'Submenu = " '+category+'" { Icon = "'+cat_icon+'"'
		else:
			print spacing+'Submenu = "'+category+'" {'
		for j in i[1]:
			name = j[0]
			icon = j[1]
			command = j[2]
			if seticon is True and icon is not None:
				print spacing+spacing+'Entry = " '+name+'" { Icon = "'+icon+'"; Actions = "Exec '+command+'" }'
			else:
				print spacing+'  Entry = "'+name+'" { Actions = "Exec '+command+'" }'
		print spacing+'}'
	if submenu is True:
		print '}'
line 82 insert:

Code: Select all

	elif desktop == "pekwm":
		pekwmmenu()
and probably amend the usage function.

I have mainly copied this code from an old pekwm menu maker from Fedora and/or somwhere at googlecode. I use this in my pekwm desktop.

Whoever uses pekwm (similarly with fluxbox) probably knows this produces only the applications submenu since those WMs have other functions in their main menus (themes/wallpaper selectors, logout and window management items). There is no all-in-one solution for pekwm menus anywhere.

So, the usual usage could be to either:

enter this item into ~/.pekwm/menu:
INCLUDE = "/home/your_username/.pekwm/appsmenu"

than:
/usr/bin/xdgmenumaker -i -f pekwm > ~/.pekwm/appsmenu
(and repeat this step anytime you install something new)


or:

add an entry to ~/.pekwm/appsmenu:
Entry = "" { Actions = "Dynamic /usr/bin/xdgmenumaker -i -f pekwm" }
to make it dynamic at expense of running it everytime you invoke the menu.

I hope Gapan finds this usable. I apologize for sugesting the code this way as I don't know how to attach the diff nor I'm at github.

Re: xdgmenumaker enabled for pekwm

Posted: 15. Jan 2014, 19:56
by mimosa
So you use pekwm? I wasn't sure anybody did :)

That's interesting. You've tested it then, and it works. I don't see why we shouldn't use it.

Re: xdgmenumaker enabled for pekwm

Posted: 16. Jan 2014, 13:10
by gapan
Nice! Many thanks for this, I will certainly take a look and try to include it in an updated xdgmenumaker package in 14.1. Honestly I had thought about adding pekwm support in the past at some point, but since I don't actually use pekwm I just never got down to doing it.

And it would help if you drop me the diff in my email, or you could attach it to a ticket in our bugtracker: http://sourceforge.net/p/salix/tickets/

That way I won't forget. :roll:

Re: xdgmenumaker enabled for pekwm

Posted: 18. Jan 2014, 14:45
by gapan
OK, I have updated xdgmenumaker with pekwm support + some other stuff like XDG Path support. The code is up on git:
https://github.com/gapan/xdgmenumaker

and I will release a 0.5 version shortly.

Re: xdgmenumaker enabled for pekwm

Posted: 24. Jan 2014, 02:19
by marin
Getting rid of double quotes and reserved semicolumns in pekwm menu file is spot on as well as the accompanying explanation in README. Thank you!