xdgmenumaker enabled for pekwm

If you have any suggestions or ideas about improving Salix, here's the place to post them.
Post Reply
User avatar
marin
Posts: 11
Joined: 7. Apr 2013, 00:00

xdgmenumaker enabled for pekwm

Post 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.
Last edited by marin on 16. Jan 2014, 00:25, edited 1 time in total.
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: xdgmenumaker enabled for pekwm

Post 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.
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: xdgmenumaker enabled for pekwm

Post 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:
Image
Image
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: xdgmenumaker enabled for pekwm

Post 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.
Image
Image
User avatar
marin
Posts: 11
Joined: 7. Apr 2013, 00:00

Re: xdgmenumaker enabled for pekwm

Post 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!
Post Reply