Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 02 Sep 2014, 16:18
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
SimplePuppyMenu
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 4 [47 Posts]   Goto page: 1, 2, 3, 4 Next
Author Message
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: Fri 08 Jan 2010, 11:32    Post subject:  SimplePuppyMenu
Subject description: Menu for light wm without own menusystem
 

Plaese see here for SimplePuppyMenu2: http://www.murga-linux.com/puppy/viewtopic.php?p=602434

SimplePuppyMenu (spm) is a menu system for 'menuless' wm like echinus. the menu is similar to the jwm-menu, but no icons and no differentiated subcategories. the menu itself is run via aemenu.

spm consists of two scripts:
1. spm-parser
a perl script that parses the desktop-files in /usr/share/applications and writes them to a rc-file for aemenu.

2. spm
a wrapper for all actions:
spm -m launch the menu
spm -u update the menu-file
spm -h display help
spm -v display version

to make use of spm, you should assign a keyboard-shortcut to 'spm -m'. how to do that depends on your wm.

if you want to update on every startup, make a script with 'spm -u &' in /root/Startup.

Dependencies are aemenu (attached) and perl (puppy-version is sufficient).

------------
Version 0.4 2010/01/19
------------
- apps are now sorted case-insensitive.
------------
Version 0.3 2010/01/18
------------
- changed fixed path /root to $HOME to support multiuser-environments.
- moved SAMPLEspm-bottom and SAMPLEspm-top from /root/.config/spm to /usr/share/doc/spm.
------------
Version 0.2 2010/01/11
------------
The rcdir has changed to /root/.config/spm as this seems to be the correct place.
But you won't feel a difference. As /root/.spm is no longer needed, you could delete
it after you've run 'spm -u' once.

The spm-parser now only generates the items from the desktop-files. Additional
(user-generated) items at top and/or bottom of the menu are now handled by spm
using the 2 template files

/root/.config/spm/spm-top
/root/.config/spm/spm-bottom

i've included samples for each in the named dir. So if you want a menu with
help and Poweroff-Submenu simple rename the SAMPLEspm-bottom.

I've also added a html-help /usr/share/doc/spm.html and a changelog
/usr/share/doc/spm/changelog. Help (spm -h) is also updated.
------------

Tested in Puppy 4.31.

My thanks go to Christian (musher0) who pointed me at aemenu and Chris Rouch who is the author of the original parser-script i've modified for spm.

aragon
spm-0.4.pet
Description 
pet

 Download 
Filename  spm-0.4.pet 
Filesize  4.85 KB 
Downloaded  630 Time(s) 
spm-0.3.pet
Description  only for documentation, please use the actual release
pet

 Download 
Filename  spm-0.3.pet 
Filesize  4.79 KB 
Downloaded  545 Time(s) 
spm-0.2.pet
Description  only for documentation, please use the actual release
pet

 Download 
Filename  spm-0.2.pet 
Filesize  4.78 KB 
Downloaded  568 Time(s) 
spm.png
 Description   
 Filesize   34.7 KB
 Viewed   2353 Time(s)

spm.png

spm-0.1.pet
Description  only for documentation, please use the actual release
pet

 Download 
Filename  spm-0.1.pet 
Filesize  3.72 KB 
Downloaded  585 Time(s) 
aemenu-1.2.12.pet
Description 
pet

 Download 
Filename  aemenu-1.2.12.pet 
Filesize  7.91 KB 
Downloaded  636 Time(s) 

_________________
PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html

Last edited by aragon on Mon 06 Feb 2012, 13:36; edited 4 times in total
Back to top
View user's profile Send private message 
trapster


Joined: 28 Nov 2005
Posts: 1999
Location: Maine, USA

PostPosted: Fri 08 Jan 2010, 13:27    Post subject:  

Hmm, this might go nice with wmii. I will have to give it a try!
_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Puppeee4.31 + 1.0, Puppy4.10 + Lupu52
Currently using Slacko AND lupu52 w/ fluxbox
Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 2240

PostPosted: Fri 08 Jan 2010, 13:45    Post subject:  

aemenu is nice, I use it in a couple of ROX AppDirs to provide pop-up menu items.
aragon, have you figured out how to get it to display icons -IIRC it is supposed to bt I never figured out the right syntax -or perhaps it is broken and waiting to be fixed....
Back to top
View user's profile Send private message 
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: Fri 08 Jan 2010, 16:24    Post subject:  

@trapster
yes, go for it. on my trials to do such a base menu system i have some tests with other apps (ratmenu,...) but aemenu is a definite winner (if you like 'straight' solutions).

@amigo
never heard of that aemenu could display icons (and never had thought that it might could). but that's ok for me. i've the feeling that it often gets complicated if you want to display menu-icons, i've had problems with that in much wm.

@all
what i've forgotten to mention:
the psm-parser could be easy adapted for all kind of menu-systems also if your wm has a menu system e.g. you could generate a root-menu for pekwm.

aragon

_________________
PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html
Back to top
View user's profile Send private message 
dejan555


Joined: 30 Nov 2008
Posts: 2648
Location: Montenegro

PostPosted: Sun 10 Jan 2010, 08:33    Post subject:  

This is cool aragon, works here in dpup, I'm using it /w karmen wm and rox panel/pinboard combination. Also this aemenu rc syntax seems good for making this kind of stuff, practically similar to most other menu rc.
_________________


Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
dejan555


Joined: 30 Nov 2008
Posts: 2648
Location: Montenegro

PostPosted: Sun 10 Jan 2010, 08:45    Post subject:  

Is there some template or script to edit to make it remember som changes like for example, I don't want it to make Shutdown submenu but to launch pshutdown dialog, so I edit /root/.spm/spm-rc:

Code:
cmd "Shutdown" "exec /usr/bin/shutdownjwm"


But if I update spm it rolls back to shutdown submenu.

_________________


Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: Sun 10 Jan 2010, 15:51    Post subject:  

dejan,

the generation of the help-item and the shutdown-submenu are coded into spm-parser. look at the last lines, i think you'll get the syntax.

aragon

_________________
PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html
Back to top
View user's profile Send private message 
dejan555


Joined: 30 Nov 2008
Posts: 2648
Location: Montenegro

PostPosted: Sun 10 Jan 2010, 15:52    Post subject:  

K, thanks
_________________


Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: Mon 11 Jan 2010, 05:23    Post subject:  

dejan made a valid point about user-items for the menu. i will update the package (i think tomorrow).

the implemented changes will be:
1. psm-parser will only create the menu-items from the desktop-file.
2. there will be user-changeable rc-files for top- and bottom where users can put 'their' own commands and submenus. these will be added to the top/bottom of the menu-file if the user runs 'psm -u' to update the menu.

aragon

_________________
PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html
Back to top
View user's profile Send private message 
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: Tue 12 Jan 2010, 05:34    Post subject:  

Version 0.2 uploaded. See main post for changelog and pet.

aragon

_________________
PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4231
Location: Gatineau (Qc), Canada

PostPosted: Tue 12 Jan 2010, 11:33    Post subject:  

Hello, aragon.

Nice job, as far as I can see. I haven't tried your adaptation but I'm familiar enough with aemenu since I've incorporated it in my compiles of echinus and wmx.

I'll just say this: good job, but this is only the surface of possibilities with aemenu. For one thing, it has the possibility to call itself, therefore you can have a metamenu with a chain of aemenus calling each other not only to launch programs but to group them in the way you yourself use your computer. Regroup the programs you use the most often in thematic menus, for example. Shut the rox-panel, reopen it, control wmctrl for ready-made window sizes, access your disks and other parts of the linux hierarchy (/ and down).

One important menu entry that is missing, I think, is "edit this menu". It's amazing what a little recursivity can do, and how much time it can save you.

If you choose to edit it and you're a non-Anglophone, you will need leafpad, because it is easier to save the menu in ISO or UTF-8 with leafpad.

For the time being, here is my bookmarks.xml for rox. I think it is general enough. It could complete your spm nicely. Adapt it for your own needs /computer. (Icon to the right of the house in the rox-filer bar.) It goes in
~/.config/rox.sourceforge.net/ROX-Filer. Save your old one first. This will remove the need for an aemenu to access the linux hierarchy / directory structure. Advantage: it's ready-made!

And this is as good a place as any to post it, since no puppy user or developer seems to have noticed this possiblity in ROX in any thread. (AFAIK). It will be a good complement to your spm.

Enjoy. BFN.

bookmarks.xml

Code:
<?xml version="1.0"?>
<bookmarks>
  <bookmark title="/">/</bookmark>
  <bookmark title="/etc">/etc</bookmark>
  <bookmark title="/etc/rc.d">/etc/rc.d</bookmark>
  <bookmark title="/opt">/opt</bookmark>
  <bookmark title="/usr">/usr</bookmark>
  <bookmark title="/usr/bin">/usr/bin</bookmark>
  <bookmark title="/usr/lib">/usr/lib</bookmark>
  <bookmark title="/usr/sbin">/usr/sbin</bookmark>
  <bookmark title="/usr/share">/usr/share</bookmark>
  <bookmark title="/usr/share/applications">/usr/share/applications</bookmark>
  <bookmark title="/usr/share/backgrounds">/usr/share/backgrounds</bookmark>
  <bookmark title="/usr/share/themes">/usr/share/themes</bookmark>
  <bookmark title="/usr/X11R7/bin">/usr/X11R7/bin</bookmark>
  <bookmark title="/usr/local">/usr/local</bookmark>
  <bookmark title="/usr/local/bin">/usr/local/bin</bookmark>
  <bookmark title="/usr/local/lib">/usr/local/lib</bookmark>
  <bookmark title="/usr/local/lib/X11">/usr/local/lib/X11</bookmark>
  <bookmark title="/usr/local/share">/usr/local/share</bookmark>
  <bookmark title="/mnt">/mnt</bookmark>
  <bookmark title="/mnt/home">/mnt/home</bookmark>
  <bookmark title="/mnt/sda6">/mnt/sda6</bookmark>
  <bookmark title="/mnt/sda7">/mnt/sda7</bookmark>
  <bookmark title="/mnt/sdb5">/mnt/sdb5</bookmark>
  <bookmark title="/mnt/sdb5/Windows">/mnt/sdb5/Windows</bookmark>
  <bookmark title="/mnt/sdb6">/mnt/sdb6</bookmark>
  <bookmark title="/mnt/sdc1">/mnt/sdc1</bookmark>
  <bookmark title="/root">/root</bookmark>
  <bookmark title="/root/Bureau">/root/Bureau</bookmark>
  <bookmark title="/root/Choices">/root/Choices</bookmark>
  <bookmark title="/root/.config">/root/.config</bookmark>
  <bookmark title="/root/Downloads">/root/Downloads</bookmark>
  <bookmark title="/root/Mes-dossiers">/root/Mes-dossiers</bookmark>
  <bookmark title="/root/my-applications">/root/my-applications</bookmark>
  <bookmark title="/root/my-applications/ae">/root/my-applications/ae</bookmark>
  <bookmark title="/root/my-applications/bin">/root/my-applications/bin</bookmark>
  <bookmark title="/root/my-documents">/root/my-documents</bookmark>
  <bookmark title="/root/my-documents/icones">/root/my-documents/icones</bookmark>
  <bookmark title="/root/puppy-reference">/root/puppy-reference</bookmark>
  <bookmark title="/root/Startup">/root/Startup</bookmark>
  <bookmark title="/root/Startup-non">/root/Startup-non</bookmark>
  <bookmark title="/root/.wmx">/root/.wmx</bookmark>
</bookmarks>

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 4231
Location: Gatineau (Qc), Canada

PostPosted: Tue 12 Jan 2010, 11:47    Post subject:  

This is my script for an spm. It's derived from jemimah's gen_menu_wmx and a little display bit adapted from MU's fixmenus. It takes the input from the jwm menu, rather than from the *.desktop files.

It has two parts. This is the dynamic part, which creates and refreshes the Puppy menu The static part is below this one.

Code:
#!/bin/bash
# gen_aemenu.sh # Pour générer le aemenu de Puppy
# Dérivé du gen_menu_wmx.sh de jemimah, sur le forum murga-Puppy. "wmx"
# Remanié par musher0, 26 décembre 2009.

# Activer débogage
# set -xv
fixmenus &
# [...]
# message avec "xmessage" remplacé par
    /usr/X11R7/bin/yaf-splash -text " |\ Building aemenu for Puppy /|\  Construction du menu ae pour Puppy /|" -outline 0 -fg AntiqueWhite1 -bg firebrick4 -timeout 3 -margin 30 -bd AntiqueWhite1 &
#  (musher0)

cd /root/my-applications/ae
#
rm -rf /root/my-applications/ae/menuPuppy0
echo -wide config file "for" aewm clients >menuPuppy0
# echo cmd "\""-=- menu Puppy -=-"\"" "\"" "\"" >>menuPuppy00
echo menu "\""-=- menu Puppy -=-"\"" >>menuPuppy0
echo cmd "\""-=-=-=-=-=-=-=-=-=-=-"\"" "\"""\"" >>menuPuppy0
# next 19 lines adapted from jemimah's gen_menu_wmx.sh
cat /root/.jwmrc | while read LINE ; do
#echo $LINE
if [[ "$LINE" =~ "<Menu label*" ]] ; then
    sousmenu=`echo $LINE | cut -f2 -d\"`
    echo menu "\""$sousmenu"\"">>menuPuppy0
    echo cmd "\""=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="\"" "\"" "\"" >>menuPuppy0
fi
if [[ "$LINE" =~ "</Menu*" ]] ; then
   echo end >>menuPuppy0
fi
if [[ "$LINE" =~ "<Program label*" ]] ; then
    nomprog=`echo $LINE | cut -f2 -d\" |sed -e 's/\//_/g' -e 's/^-//'`
    prog=`echo $LINE | cut -f2 -d\> | cut -f1 -d\<`
    echo cmd "\""$nomprog"\"" "\""$prog"\"">>menuPuppy0
# echo cmd a $nomprog a a $prog a >>menuPuppy0
fi
done
# end of code adapted from jemimah
echo cmd "\""Regen. menu Puppy"\"" "\""/usr/sbin/gen_aemenu.sh"\"" >>menuPuppy0
echo cmd "\""Éditer ce menu"\"" "\""leafpad ~/my-applications/ae/menuPuppy"\"" >>menuPuppy0

# fin du menu dynamique
# Maintenant, concaténation du menu statique
sleep 1s
cd /root/my-applications/ae
more menuPuppy0 >menuPuppy
more menuPuppy-statique.txt >>menuPuppy
echo "#""#""#" fin "#""#""#" >>menuPuppy

# Désactiver débogage
set +xv
#
### fin ###


Static part:

Code:

# le menu dynamique vient ici (musher0, 26 déc. 2009)
cmd "-=-=-=-=-=-=-=-=-=-=-" ""
cmd "Centre de contrôle" "pcp2 || pcp3-wrapper"
# cmd "Control Centre" "pcp2 || pcp3-wrapper"
cmd "Console" "rxvt -geometry 78x28+300+300 -bg MidnightBlue -fg cornsilk
# -menu /root/.rxvt2.menu"
cmd "-=-=-=-=-=-=-=-=-=-=-" ""
cmd "Aller -=> " "~/my-applications/ae/Aller.sh"
cmd "<=- Retour" "~/my-applications/ae/Retour.sh"
cmd "<=- Barres" "/usr/X11R7/bin/barres.sh"
cmd "<=- Redimensionner" "/usr/X11R7/bin/redimensionner.sh"
cmd "-=-=-=-=-=-=-=-=-=-=-" ""
cmd "<=-<=- Boussole" "~/my-applications/ae/boussole.sh"
# cmd "<=-<=- Compass" "~/my-applications/ae/compass.sh"
cmd "<=-<=- Disques" "~/my-applications/ae/disques3.sh"
cmd "<=-<=- Fichiers" "aemenu -rc /etc/X11/aewm/fichiers"
# cmd "<=-<=- Disques / Disks" "~/my-applications/ae/disques3.sh"
cmd "<=-<=- Bureautique" "/usr/X11R7/bin/Bureautique.sh"
# cmd "<=-<=- Metamenu" "~/my-applications/ae/aemenu.sh"
cmd "-=-=-=-=-=-=-=-=-=-=-" ""
cmd "<=-<=- Méta-menu" "aemenu"
cmd "-=-=-=-=-=-=-=-=-=-=-" ""
cmd "Exit" "/usr/bin/shutdownjwm"
### fin ###


Actually, the latter is not code per se, it is a simple txt file.

The result is this, with much more potential than the usual puppy menu:
menuPuppy.png
 Description   
 Filesize   56.39 KB
 Viewed   2202 Time(s)

menuPuppy.png


_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 4231
Location: Gatineau (Qc), Canada

PostPosted: Tue 12 Jan 2010, 12:18    Post subject:  

dejan555 wrote:
Is there some template or script to edit to make it remember som changes like for example, I don't want it to make Shutdown submenu but to launch pshutdown dialog, so I edit /root/.spm/spm-rc:

Code:
cmd "Shutdown" "exec /usr/bin/shutdownjwm"


But if I update spm it rolls back to shutdown submenu.


Hi, dejan.

the syntax for aemenu is:

aemenu -rc [somefile]

the syntax for a command in aemenu is:
cmd "name of program" "program"

for submenus it is
menu "title of submenu"
cmd "name of program 1" "program1"
cmd "name of program 2" "program2"
end

It does not have to have a "rc" ending.

this will be recognized

aemenu -rc /root/my-applications/ae/filemanagers

To have it "remember", as you say, simply use a text editor. leafpad is better because from it, it is simpler to change the character set from iso to utf at saving time, if you need to.

(Make a backup of your old menu file first, of course.)

You do not need the "exec" command. You save a few bytes this way. You can call a bash script (/usr/local/bin/babebibobu.sh, for example) as a program.

BFN.

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: Wed 13 Jan 2010, 11:05    Post subject:  

Hi Christian,

thanks for your posts. Yes aemenu can do lots of fancy things, but my focus had been another:

i wanted to have an (xdg-)menu that is automatically build from the desktop-files. spm does that in a very nice way (my opinion Very Happy ) as it does not need another menu-file or something like that it only needs the desktop-files (and puppys cutdown perl).

to be flexible, the user could add own items to the top and the bottom the will be merged into the menu-file for aemenu and will not be overwritten by an update of the (generated) menu.

so it's only a part of your solution (the one you're using jemimahs snippet for) with the flexibility for the user to add own items if she/he whiches.

aragon

_________________
PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4231
Location: Gatineau (Qc), Canada

PostPosted: Wed 13 Jan 2010, 12:06    Post subject:  

Hello, aragon.

Ahh... We see the master's hand in the elegant coding! Very Happy

Also, spm is a "liberation" in the sense that the aemenu can be constructed by spm from the *.desktop files directly rather than from the menu of another wm.

Out of curiosity,
1) I wonder how the original author of aewm did it? I gather that his recipe was lost like an old Egyptian papyrus? Maybe I was not looking in the right places, but I could not find on the Web any menu creator for aemenu or aewm++ (aka sapphire).
2) would your spm work in another distro which uses aemenu?

Finally, would it be much trouble to come up with an "spdm" (simple puppy disk menu) to show / access the mounted disks ? Then, one could reduce the number of puppy disk icons at the bottom left of the screen to one (the essential minimum). Users of smaller screens (eee computers, etc.) may find this handy.

Again, well done, aragon! Smile

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 4 [47 Posts]   Goto page: 1, 2, 3, 4 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1222s ][ Queries: 13 (0.0114s) ][ GZIP on ]