It was so obvious... :-) ...yet nobody saw it!

Window managers, icon programs, widgets, etc.
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#21 Post by musher0 »

Jasper wrote:Hi musher0,

It would take you only seconds to try it and see how and if it works for
you by displaying a single list of apps ending with the "chooser".

I'm happy and pleased.

My regards and thanks
Hi, jasper.

Yeah, it's ok, but it's still a syntax error to have the beginning menu
command and not the end command. Error notices may pile up in the
/tmp/xerrs.log error log.

You may also want to try this, which provides a straight 1-column list
with no header.

Code: Select all

#!/bin/sh 
# /usr/local/bin/progs-default.sh 
# But : créer un aemenu des logiciels par défaut 
# dans PuppyLinux pour le gest. de fen. aewm, echinus ou autre. 
# Dépendance : aemenu 
# (c) musher0, 30 mai 2015.(English only version with small changes for Jasper) 
#### 
cd /usr/local/bin/ 
ls -Algoh --file-type defau* | awk '$1 !~ /lrw/ && $7 !~ /.cdr/ && $7 !~ /.bak/ && $7 !~ /han/ { print $7 }' > liste-progs 
# echo "menu "Default apps"" 
> progs-default 
for i in `cat liste-progs`;do 
	echo "cmd ${i#*t} $i" >> progs-default 
done 
echo "cmd ">        chooser" /usr/bin/defaults-chooser" >> progs-default 
aemenu -rc /usr/local/bin/progs-default 
rm -f liste-progs
Please note that I remarked the "menu" line.

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Jasper

#22 Post by Jasper »

Hi musher0,

Thank you for taking the time and trouble to not only correct my code, but to also improve it.

My regards

PS My changing the title to "Default apps" may seem petty - so I'm sending you an explanatory PM.

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

#23 Post by musher0 »

Jasper wrote:Hi musher0,

Thank you for taking the time and trouble to not only correct my code, but to also improve it.

My regards

PS My changing the title to "Default apps" may seem petty - so I'm sending you an explanatory PM.
Hi, Jasper.

Glad to see that my little script is being used. That's why I write them! :)
About the change in title : don't worry about it! ;)

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

using ae menu to automate menu making (ae and jwm)

#24 Post by Puppus Dogfellow »

musher0 wrote:Hi, Puppus.

Sorry for the late reply. I was really tired yesterday.

About your implementation of an aemenu two posts up: yep, you got it! :)
Works well. Now you know everything there is to knoiw about aemenu! ;)

BFN.

musher0
well, if there's a way to change the font size to override the rox or gtk settings it's using, it's not readily apparent, so, not quite. also not so sure what to make of the results of my help query:

Code: Select all

sh-4.3# aemenu -h
usage: aemenu [--switch|-s] [--config|-rc <file>]

that aside, it's a fun and cool/nice and easy syntax--i've been using it to automate menu making, or, i've been playing around to see if it's possible and it appears it is.

Code: Select all

 menu "jwm menu maker" # beginning of menu
cmd "jwmxx-leafpad-grab executables" "cd  /usr/share/applications; grep Exec= *.desktop | grep -o 'Exec=.*' | cut -f2- -d'=' > /root/my-documents/Text/jwmxx; leafpad /root/my-documents/Text/jwmxx
cmd "jwmxx-geany-grab executables" "cd  /usr/share/applications; grep Exec= *.desktop | grep -o 'Exec=.*' | cut -f2- -d'=' > /root/my-documents/Text/jwmxx; geany /root/my-documents/Text/jwmxx
 cmd "make a menu entry" "jwmkr"
cmd "add the menu template" "jwmenuplate"

 menu "ae menu maker"
cmd "ae menu item maker" "aeae"
cmd "ae menu slot maker" "aeaem"
end


end # end of menu 

i wasn't able to get the jwmkr, jwmenuplate, aeae, or aeaem scripts to work correctly from either a jwm menu or an ae menu as bare code, but they all work fine if you call them from /root/my-applications/bin by the titles the above ae menu uses.

aeae

Code: Select all

#! /bin/sh
# name aeae
# turn an executable into a menu item (aemenu) 

xclip -o | sed 's/^/cmd "title-here" "/' | sed 's/$/"/' | xclip -selection clipboard
xdotool type "`xclip -out -selection clipboard`"


aeaem

Code: Select all

#! /bin/sh
# name aeaem
# ae menu slot template


xdotool type 'menu "title" 
(your menu here)
end
' 
jwmkr

Code: Select all

#! /bin/sh
# name jwmkr
#  use on executables/ paths to executables
# adds jwm menu tags around a selection of text in any text editor
xclip -o | sed 's/^/<Program label="" icon="">/' | sed 's/$/<\/Program>/' | xclip -selection clipboard
xdotool type "`xclip -out -selection clipboard`"


jwmenuplate

Code: Select all

#! /bin/sh
 #name jwmenuplate 

xdotool type "<Menu label="pick a better title" icon="/path/to/img_wots_opt_icon.jpgpngsvg" height="16">


[delete this and place your entries here]

</Menu> 
"

the two jwmxx entries (jwmxx-leafpad/geany-grab executables) strip the executable commands from the .desktop files in usr/share/applications. to make an off PATH executable, program, or script into a menu item for either aemenu or jwm, highlight its full path and click the appropriate menu-item maker. works for individual commands/paths or batches, separated by line break or space doesn't seem to matter though i usually rely on the former and i'm relying on memory to attest the latter works. you can mix commands and paths--the script (based on miriam's ht-b) appears to be looking for breaks in the continuity of text...

and, as i said, appears to work.

:D

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

#25 Post by musher0 »

Hi Puppus.

It's always great to see your work, but you lost me at jwmkr and sed.

(Is it an allergy? Do I have a couple of neurones missing? But I just can't
understand sed, sorry... )

TWYL.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#26 Post by Puppus Dogfellow »

musher0 wrote:Hi Puppus.

It's always great to see your work, but you lost me at jwmkr and sed.

(Is it an allergy? Do I have a couple of neurones missing? But I just can't
understand sed, sorry... )

TWYL.

musher0
i don't understand/am first becoming familiar with sed awk or grep myself--i mostly just reuse bits and pieces of other people's code. the sed usage above (reused an embolden this text script by miriam) is just to help surround whatever has been highlighted (mouse click or cursor shift, doesn't matter how) with the rest of the code for a menu entry, jwm in one case and ae in the other. i couldn't get the xdotool "type this thing with line breaks" command to work correctly on the menus, so i made separate scripts for them and call those instead. those basically print out a sandwich--label your bread, pick your filling.

jwmkr--make a jwm menu item
aeae --same for ae wm
the two menu scripts are mostly just spitting out what i figured i may be too lazy to type/i may not remember with enough confidence to forgo the second guess and double check.

the only thing that's really a tremendous time saver (assuming you can't type jwm syntax like it's your name) are those little grep and cut deals that give you the executables and open a file for you to work in. despite the names, they're not really jwm specific--a run command's a run command.

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

#27 Post by musher0 »

@Jasper ;)

Code: Select all

>simplest;for i in `ls -1 --file-type /usr/local/bin/default* | egrep -v '@|han|NON|non'`;do echo "cmd \"${i#*t}\" \"$i\"" >> simplest; done; aemenu -rc simplest
In regular script form it reads like this:

Code: Select all

#!/bin/ash
# $MBINS/simplest.sh
####
# As a one-liner:
# > simplest;for i in `ls -1 --file-type /usr/local/bin/default* | egrep -v '@|han|NON'`;do echo "cmd \"${i#*t}\" \"$i\"" >> simplest; done; aemenu -rc simplest;rm -f simplest

# In regular script form:
> simplest

for i in `ls -1 --file-type /usr/local/bin/default* | egrep -v '@|han|NON'`
	do 
		echo "cmd \"${i#*t}\" \"$i\"" >> simplest
	done

aemenu -rc simplest

rm -f simplest

# Note. The interesting thing about this little script is that you can call 
# it from any folder, use it, and it doesn't leave a trace in the folder.
With this script, you can launch the Puppy defaults menu in whichever
folder your console is in, and when finished, it erases the temporary
menu file.

It's not fancy, it just displays the apps alphabetically, but it does the job.
And it leaves your folder clean.

BFN.

musher0
Attachments
simplest.sh(1).zip
(480 Bytes) Downloaded 211 times
Last edited by musher0 on Fri 05 Jun 2015, 17:13, edited 2 times in total.
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

#28 Post by musher0 »

Hello, people.

On the other hand, some may prefer a solution with sub-menus.
(Note: don't be fooled. The picture there is in French, but English is built-in.)

Enjoy! ;)

musher0
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

#29 Post by musher0 »

@Puppus

> despite the names, they're not really jwm specific -- a run command's a run command.

Ah. I see. Thanks for pointing it out. BFN.

musher0
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 »

Hello,

Just a quick note to say that I've updated my 3rd post up with a true script
form and a zip file.

Best regards.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#31 Post by Puppus Dogfellow »

musher, any chance you can get aemenu working in Quirky April 64 7.0.4.1 and/or verify it doesn't?

:cry: /thanks
:)

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

#32 Post by musher0 »

Puppus Dogfellow wrote:musher, any chance you can get aemenu working in Quirky April 64 7.0.4.1 and/or verify it doesn't?

:cry: /thanks
:)
Hello, Puppus.

I don't have a 64-bit machine to test it on. But it should work, shouldn't it?
It's written everywhere that you can run 32-bit apps on a 64-bit machine.

Also, as Shakespeare said, a menu by any other name is still a menu! :)

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#33 Post by Puppus Dogfellow »

musher0 wrote:
Puppus Dogfellow wrote:musher, any chance you can get aemenu working in Quirky April 64 7.0.4.1 and/or verify it doesn't?

:cry: /thanks
:)
Hello, Puppus.

I don't have a 64-bit machine to test it on. But it should work, shouldn't it?
It's written everywhere that you can run 32-bit apps on a 64-bit machine.

Also, as Shakespeare said, a menu by any other name is still a menu! :)

BFN.

musher0
he also said shouda couda wouda--i get a "cannot execute binary" error message.

...not sure why it won't work and am beginning to get superstitious regarding the whole thing, almost considering redoing the installation and leaving out the bad luck steps or whatever i can construe as such...

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

#34 Post by musher0 »

Have you tried compiling aemenu under your 64-bit Puppy?
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#35 Post by Puppus Dogfellow »

musher0 wrote:Have you tried compiling aemenu under your 64-bit Puppy?
all i've been able to track down is that .bz that's just an already executable file. is there some sort of .gz or .src folder somewhere?

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

#36 Post by musher0 »

Hi, Puppus.

The source code is here, but you'll need the "hg" utility to access the
Mercurial depot system at -- https://mercurial.selenic.com/wiki -- in
order to download it.

Here's a 64-bit package for the entire aewm window manager.

I've extracted the aemenu executable from the latter and attached it
below. Let me know if it works? * Thanks.

musher0

~~~~~~~~~
* If it doesn't, there are similar ones at http://pkgs.org/search/aewm for
various versions of Debian and Ubuntu.
Attachments
aemenu64.bz2
Unpack in /usr/bin or /root/my/applications/bin, rename to aemenu, make executable and run.
(7.13 KiB) Downloaded 210 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#37 Post by Puppus Dogfellow »

musher0 wrote:Hi, Puppus.

The source code is here, but you'll need the "hg" utility to access the
Mercurial depot system at
-- https://mercurial.selenic.com/wiki -- in
order to download it.

Here's a 64-bit package for the entire aewm window manager.

I've extracted the aemenu executable from the latter and attached it
below. Let me know if it works? * Thanks.


musher0

~~~~~~~~~
* If it doesn't, there are similar ones at http://pkgs.org/search/aewm for
various versions of Debian and Ubuntu.

works, musher (checked the park for the chess sets, but the royalty was all tied up. long story short, i didn't need tables-- periodic tables nor any other--cos one of mike tyson's (maybe bert's--can't tell the sets apart) pigeons (a little birdy, as they say) told me how and where to get it.

thanks again, musher0!
:)

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

#38 Post by musher0 »

Haha, aemenu works on 64-bits too! I knew it, I knew it! :) :lol:
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Pelo

AEmenu 64 installed in the french Puppy ASRIedu310,

#39 Post by Pelo »

AEmenu 64 installed in the french Puppy ASRIedu310, only within one pupsave, due to security rules at home. Nothing explode.
on test bench... prudence ! :)

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

#40 Post by musher0 »

Hi, pelo.

Nothing exploded, eh? Shucks. :twisted:

BFN. :lol:

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply