SimplePuppyMenu

Stuff that has yet to be sorted into a category.
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#21 Post by musher0 »

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: Select all

cmd "What's running here" "aemenu --switch"
Simple, eh? :D
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#22 Post by musher0 »

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: Select all

<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.)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#23 Post by musher0 »

@aragon
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: 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.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#24 Post by aragon »

musher0 wrote:Actually, I was only half serious. :twisted:
:lol: 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

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#25 Post by aragon »

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...
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 :P

Code: Select all

#!/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 :D
have to investigate your example now...

aragon

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#26 Post by aragon »

Code: Select all

#!/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 :D

aragon

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#27 Post by dejan555 »

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 :P
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#28 Post by aragon »

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: Select all

#!/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

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#29 Post by musher0 »

Says aragon
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.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#30 Post by musher0 »

@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: Select all

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: Select all

#!/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: Select all

#!/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.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#31 Post by dejan555 »

Screenie of karmen wm /w simple menu:
http://murga-linux.com/puppy/viewtopic. ... 504#382504
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#32 Post by musher0 »

Nice! :)

Q.: I believe the karmen wm allows for only one desktop?
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#33 Post by dejan555 »

Hmm, I think so, didn't find any configuration options, it's really basic wm, has no taskbar/tray/menu or anything, only two buttons on titlebar for minimize/close, plus double clicking titlebar maximizes window. right click on titlebar gives list of running windows though so you can raise another window even if one is already maximized.
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#34 Post by aragon »

dejan, nice screenie.

how did you call the menu within karmen? i know i've used it before, but cannot remember...

aragon

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#35 Post by dejan555 »

i put command in script and place it in rox panel (first icon)
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#36 Post by aragon »

dejan555 wrote:i put command in script and place it in rox panel (first icon)
thanks, seeing the answer i thought "what a dumb question" :roll:

aragon

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#37 Post by aragon »

uploaded version 0.3.

changelog:
- 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.

aragon

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#38 Post by aragon »

uploaded version 0.4.

changelog:
- apps are now sorted case-insensitive.

aragon

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#39 Post by musher0 »

A little but noticeable improvement! Thanks! :)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#40 Post by aragon »

musher0 wrote:A little but noticeable improvement! Thanks! :)
this has bugged me for some time, but finding a solution for the sorting in perl needed time with google...

i think i have now implemented all needed features and will go for a little code cleanup...

aragon

Post Reply