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 Wed 26 Nov 2014, 05:01
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 2 of 4 Posts_count   Goto page: Previous 1, 2, 3, 4 Next
Author Message
dejan555


Joined: 30 Nov 2008
Posts: 2717
Location: Montenegro

PostPosted: Wed 13 Jan 2010, 12:30    Post_subject:  

I'm not familiar with xdg menu specification but I think extracting and building menu from desktop files shouldn't be hard for experienced coder, all the info is in desktop txt files like category, execute command, program name, you just reorganize it to suit your wm's specific menu format or a standalone menu like this one.

I don't know bash much, but I think this could be even done with bash and maybe some graphical dialog

_________________
Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works
Back to top
View user's profile Send_private_message Visit_website MSNM 
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: Wed 13 Jan 2010, 16:00    Post_subject:  

musher0 wrote:
Hello, aragon.

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

Shocked
if so (and i can't say if it's elegant) this goes to Chris Rouch who is the original author of the parser scrip i modified for my needs.
Quote:
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.

yes.
Quote:
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).

the simple answer (afaik): you do it yourself with a text-editor. you'll find that concept on most wm, the user has full control (and i like that very much). but i always wanted to be able to have both...
Quote:
2) would your spm work in another distro which uses aemenu?

yes, buuttt... (there always has to be a but and the following is a typical puppy-but): the package and the spm-script is configured wrong for 'the outer world'. it used /root instead of $HOME, what is ok for puppy but not for the others... but maybe i'm able to correct this for an update...
Quote:
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.

this should be possible, but wouldn't one of the following 2 very simple solutions also work
a) make an item for "rox /mnt"
b) make an item for pmount

but i will look into it, it seems to be a nice exercise...

aragon

_________________
PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4379

PostPosted: Wed 13 Jan 2010, 17:17    Post_subject:  

@dejan
If you want to look at some code that does this - see Barry's dir2pet script. It parses desktop files and does most of this (except for adding the markup/xml)... see fixmenus for the rest

btw jwm can have separate menus for left, middle and right click (root id of 1,2,3) in most Puppies it is set to 3 (right click) - and is also the one in the tray
if you set the one in the tray to 0 or 4-9 that would allow you to use all 3 others however you want - and set it up in /etc/xdg/templates so that it gets rebuilt with fixmenus - you don't really need aemenu if you already have jwm


I have posted several other jwm tricks here:
http://www.murga-linux.com/puppy/viewtopic.php?t=51200

_________________
Web Programming - Pet Packaging 100 & 101

Edited_time_total
Back to top
View user's profile Send_private_message 
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: Wed 13 Jan 2010, 17:42    Post_subject:  

@dejan & technosaurus

i don't know exactly what you want to say... i'm not searching for that code, i've already found it (at least for my needs).

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: 2717
Location: Montenegro

PostPosted: Wed 13 Jan 2010, 18:30    Post_subject:  

Simple Puppy Menu is great aragon, and now customizable too, you did great job with it, well done, I'm just thinkering of different ways to parse desktop files, here's a really simple two liner launcher-like Xdialog combobox I've come up with Razz

Code:

#!/bin/sh
PROGRAM=$(Xdialog --combobox Run 0 0 `ls /usr/share/applications/ | grep ".desktop"` 2>&1)
exec $(cat /usr/share/applications/$PROGRAM | grep "Exec" | grep -v "TryExec=" | sed 's/Exec=//') &

_________________
Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works
Back to top
View user's profile Send_private_message Visit_website MSNM 
musher0


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

PostPosted: Thu 14 Jan 2010, 02:20    Post_subject:  

Hello, bunch!

Here's a nice and useful little line you can add at the top or bottom of the spm to poke for what's on your desktop:
Code:
cmd "What's running here" "aemenu --switch"

Simple, eh? Very Happy

_________________
"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_website 
musher0


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

PostPosted: Thu 14 Jan 2010, 02:38    Post_subject:  

Hello, technosaurus!

technosaurus wrote:
@dejan
[...]

btw jwm can have separate menus for left, middle and right click (root id of 1,2,3) in most Puppies it is set to 3 (right click) - and is also the one in the tray
if you set the one in the tray to 0 or 4-9 that would allow you to use all 3 others however you want - and set it up in /etc/xdg/templates so that it gets rebuilt with fixmenus - you don't really need aemenu if you already have jwm
[...]


Well... that's a matter of opinion / conviction, I suppose. Once you get the knack of it, you'll want to create aemenus to have very easy access to your files / groupings / programs / directories / disks.

I use it in jwm too. I have added this line in my jwmrc-personal file:

Code:
<Key mask="C" key="Escape">exec:/root/my-applications/ae/aemenu.sh</Key>


You need a pianist's touch on the Ctrl-Escape key combination, but it does the job without having to change the root:n configuration, an alternate menu pops up on screen. (For the record, my particular aemenu script above doesn't duplicate the jwm puppy menu.)

_________________
"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_website 
musher0


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

PostPosted: Thu 14 Jan 2010, 02:50    Post_subject:  

@aragon

Quote:
this should be possible, but wouldn't one of the following 2 very simple solutions also work
a) make an item for "rox /mnt"
b) make an item for pmount

but i will look into it, it seems to be a nice exercise...


Actually, I was only half serious. Twisted Evil I have a bash script for that, so if you feel it's not essential, do not do it for me? Meaning: I have come up with a solution for myself. But if others think there is a need....

My solution is essentially based on parsing fstab (dynamic part), plus a static part that is concatenated to add rox /mnt and pmount, and various disk utilities, etc. as you mentioned.

_________________
"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_website 
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: Thu 14 Jan 2010, 05:20    Post_subject:  

musher0 wrote:
Actually, I was only half serious. Twisted Evil

Laughing this is a common problem with us non-natives. we could interpret subtext only by keywords, so jokes, sarcasm and irony often get lost. and if we interpret by keywords, it's mostly wrong.

but i take those things not too seriously, they just happen ...

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: Thu 14 Jan 2010, 05:29    Post_subject:  

dejan555 wrote:
Simple Puppy Menu is great aragon, and now customizable too, you did great job with it, well done,

no offense intended no eulogy needed, there was just a 'missing link' (for me) between the thread and the posts...
Quote:
I'm just thinkering of different ways to parse desktop files, here's a really simple two liner launcher-like Xdialog combobox I've come up with Razz
Code:

#!/bin/sh
PROGRAM=$(Xdialog --combobox Run 0 0 `ls /usr/share/applications/ | grep ".desktop"` 2>&1)
exec $(cat /usr/share/applications/$PROGRAM | grep "Exec" | grep -v "TryExec=" | sed 's/Exec=//') &

now i see the missing link Very Happy
have to investigate your example now...

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: Thu 14 Jan 2010, 05:46    Post_subject:  

Quote:
Code:
#!/bin/sh
PROGRAM=$(Xdialog --combobox Run 0 0 `ls /usr/share/applications/ | grep ".desktop"` 2>&1)
exec $(cat /usr/share/applications/$PROGRAM | grep "Exec" | grep -v "TryExec=" | sed 's/Exec=//') &

whow, in 2 lines, very nice Very Happy

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: 2717
Location: Montenegro

PostPosted: Thu 14 Jan 2010, 06:09    Post_subject:  

Yeah, well it's not categorized or anything, real menu would need more work, but it's nice as a simple launcher with all programs on one pile Razz
_________________
Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works
Back to top
View user's profile Send_private_message Visit_website MSNM 
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: Thu 14 Jan 2010, 07:51    Post_subject:  

musher0 wrote:
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.

only half-serious meant but nevertheless here are possible solutions you might try

Code:
#!/bin/sh
## show filesystems that are mounted on /mnt with aemenu
## aragon, 2010.01.14

## variables
mntmenu="/tmp/aemenu-drives" #name of menu-file

## some possibilities to look for mounted filesystems in /mnt
##
## 1. looks for non empty directories under /mnt
##    fast but fails if drive is mounted but empty
##    shows all directories either it is a mounted filesystem or not
## mounts=`find /mnt -mindepth 1 -maxdepth 1 -type d -follow ! -empty`
#
## 2. use mount to show filesystems that are mounted on /mnt
##    seems correct but is lame.
##    shows only mounted filesystems
## mounts=`mount -l | cut -d " " -f3 | grep ^\/mnt\/`
#
## 3. use df to look for filesystems that are mounted on /mnt
##    seems correct but is lame (not as lame as 2)
##    shows only mounted filesystems
## mounts=`df | tr -s " " | cut -d " " -f6 | grep ^\/mnt\/`
#
## 4. use /etc/mtab to look for filesystems that are mounted on /mnt
##    seems correct and is not as lame as 2 and 3
##    shows only mounted filesystems
mounts=`cat /etc/mtab | cut -d " " -f2 | grep ^\/mnt\/`

## create the menu-file
echo "menu \"Drives\"" > $mntmenu
for i in $mounts
do
        echo "cmd \"$i\" \"rox $i\"" >> $mntmenu
done
echo "end" >> $mntmenu

## launch the aemenu with the menu-file
aemenu -rc $mntmenu &

if anyone knows other/faster methods to look for mounts on /mnt, please let me know.

NOTE: Only tested in Virtualbox, results may vary on normal run.

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: 4339
Location: Gatineau (Qc), Canada

PostPosted: Thu 14 Jan 2010, 11:52    Post_subject:  

Says aragon
Quote:
this is a common problem with us non-natives.


But we're all natives, to some particular land, are we not?

In any case, thanks for the code for disks. I'll try it.

_________________
"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_website 
musher0


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

PostPosted: Thu 14 Jan 2010, 21:12    Post_subject:  

@aragon:

Please forgive me if I ruffled some feathers earlier. I'm a "non-native" too...

In any case, we can attenuate the "lameness" by putting
Code:
mount -a

at the top of the script, no?

In any case, I've opted for your solution #1, because it allows to show all disks. With the > mount -a < at the beginning and the "puppyevent" hot-plug manager, I find it acceptable for my needs.

Here's what I've decided to use:
Code:

#!/bin/sh

# ajouts de musher0 :
mount -a
cd /root/my-applications/ae
# Ajouté aussi "|sort" à la fin des commandes et
# modifié ancienne destination dans /tmp à la présente
# (musher0)

## show filesystems that are mounted on /mnt with aemenu
## aragon, 2010.01.14

## variables
mntmenu="/root/my-applications/ae/aemenu-drives" #name of menu-file

## some possibilities to look for mounted filesystems in /mnt
##
## 1. looks for non empty directories under /mnt
##    fast but fails if drive is mounted but empty
##    shows all directories either it is a mounted filesystem or not
mounts=`find /mnt -mindepth 1 -maxdepth 1 -type d -follow ! -empty |sort`
#
## Trois autres solutions non probantes, selon moi, retirées

## create the menu-file
# echo "menu \"Drives\"" > $mntmenu
echo menu "\""-=-Lecteurs/Drives-=-"\"" > $mntmenu
echo cmd "\""-=-=-=-=-=-"\"" "\"" "\"" >> $mntmenu
# disques30
for i in $mounts
do
        echo "cmd \"$i\" \"rox $i\"" >> $mntmenu
done
# echo "end" >> $mntmenu (retrait par musher0)

# concaténation par musher0
echo cmd "\"""\("Si montés / If mounted"\)" "\"" "\"" "\"" >disques30
echo "end" >>disques30
sleep 1s
cd /root/my-applications/ae
more aemenu-drives >disques3
# $mounts
more disques30 >> disques3
more disques3-statique.txt >>disques3
echo "#""#""#" fin "#""#""#" >>disques3

## launch the aemenu with the menu-file
aemenu -rc disques3 &


Since the parsing takes a little more time with the sort, I've also created an additional little script containing separately the last line, to call the aemenu-disks in regular usage. Simply,

Code:
#!/bin/sh
# menu "disques"
# script disques3.sh pour aemenu
# musher0, 26 déc. 2009 et 14 janv. 2010

# killall aemenu & # parfois nécessaire / sometimes necessary
cd ~/my-applications/ae/
aemenu -rc disques3


Many thanks for your contribution, aragon.

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_website 
Display_posts:   Sort by:   
Page 2 of 4 Posts_count   Goto page: Previous 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:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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