Building DPupBuster64 from Woof-CE

For talk and support relating specifically to Puppy derivatives
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#21 Post by musher0 »

TWIMC, here are the desktop categories icewm-menu-fdo recognizes.

Extracted from the executable with

Code: Select all

hexdump -C /usr/bin/icewm-menu-fdo
then, long story short, fiddling with

Code: Select all

awk -F"|" '{print $2}' icewm-menu-fdo.categs > icewm-menu-fdo.categs-proper
and

Code: Select all

cat icewm-menu-fdo.categs-proper | tr . "\n" > icewm-menu-fdo.categs-proper2
and editing in geany for the finishing touch.

Allow me a gripe:
This probably would have been a lot easier if this DPupBuster recipe had
offered the < strings > utility, but it doesn't, so I had to be inventive!
2DGraphics
folder
3DGraphics
Accessibility
Accessories
ActionGame
Adult
Adventure
Game
Amusement
ArcadeGame
Archiving
Art
ArtificialIntelligence
Astronomy
Audio
AudioVideo
AudioVideoEditing
Biology
BlocksGame
BoardGame
Building
Calculator
Calendar
CardGame
Chat
Chemistry
Clock
Compression
ComputerScience
Construction
ContactManagement
Core
DataVisualization
Database
Debugger
DesktopSettings
Dialup
Dictionary
DiscBurning
Documentation
Economy
Editors
Education
Electricity
Electronics
Email
Engineering
Feed
FileManager
FileTools
FileTransfer
Filesystem
Finance
FlowChart
GUIDesigner
Geography
Geology
Geoscience
HamRadio
HardwareSettings
History
Humanities
IDE
IRCClient
ImageProcessing
InstantMessaging
KidsGame
Languages
Literature
LogicGame
Maps
Math
MedicalSoftware
Midi
Mixer
Monitor
Motif
Multimedia
Music
Network
News
NumericalAnalysis
OCR
Office
P2P
PDA
PackageManager
ParallelComputing
Photography
Physics
Player
Presentation
Printing
Profiling
ProjectManagement
Publishing
RasterGraphics
Recorder
RemoteAccess
RevisionControl
Robotics
RolePlaying
Scanning
Screensavers
Security
Sequencer
Shooter
Simulation
Spirituality
Sports
SportsGame
Spreadsheet
StrategyGame
System
TV
Telephony
TelephonyTools
TerminalEmulator
TextEditor
TextTools
Translation
Tuner
Utility
VectorGraphics
VideoConference
Viewer
WINE
WebBrowser
WebDevelopment
WordProcessor
They are pretty much the categories mentioned at
https://specifications.freedesktop.org/ ... t/apa.html.

And allow me another gripe (it's probably the awful steamy heat in the air in
these parts today):
The above does not mean that parsing by icewm-menu-fdo is successful every
time, even if the Categories in the *.desktop files are good. :twisted:
(This to humor foxpup!)

IHTH
TWYL
Last edited by musher0 on Thu 09 Jul 2020, 20:01, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
foxpup
Posts: 1132
Joined: Fri 29 Jul 2016, 21:08

#22 Post by foxpup »

musher0 wrote:No disrespect or offense intended, none at all,
but I may wish to try another way of obtaining
a menu for icewm.

TWYL
No problem musher0. It's your Puppy.

I am looking forward to try it. Your Puppys are different. I like that.
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#23 Post by musher0 »

Hi guys.

Here is a new and easy menu creator script for icewm.

Sorry, icewm-menu-dfo and xgd-menu! :twisted:

Everything is in the script, so please read the remarks.
Thanks.

Basically all written in bash, with a bit of awk and grep.
Enjoy!

Code: Select all

#!/bin/bash
# /root/.icewm/lister.sh
# Copy from this forum thread and save 
# at the directory and with the filename above.
##################################
# Please read note on lines 42-43.
##################################
# (c) Christian L'Écuyer (aka musher0), Gatineau (Qc), Canada, Thursday July 9, 2020. 
# Licence: GPL2 
####
cd /usr/share/applications
grep -m 1 Categories *.desktop | grep -E -v "default|jwm" | awk -F":" '{print $2";"$1}' | awk -F"=" '{print $2}' | awk -F";" '{print $1";"$NF}' | sort > liste
# grep -E "Categories|Name|Exec" *.desktop | grep -E -v "TryExec|Generic|]|jwm|default" | more
> liste2
while read line;do 
	if [ "${line:0:2}" = "X-" ];then 
		line="${line:2}"
	fi
	echo $line >> liste2
done < liste
sort liste2 > liste
rm liste2
#
mkdir -p /root/.icewm/construction
ConsTr="/root/.icewm/construction"
grep Archiving liste > Archiving.lst
grep Audio liste | grep -v Video | awk -F";" '{print $2}' > $ConsTr/Audio.lst
grep AudioVideo liste | awk -F";" '{print $2}' > $ConsTr/AudioVideo.lst
grep Calculator liste | awk -F";" '{print $2}' > $ConsTr/Calculator.lst
grep Desktop liste | awk -F";" '{print $2}' > $ConsTr/Desktop.lst
grep Disk liste  | awk -F";" '{print $2}' > $ConsTr/Disk.lst
grep -E "Document|Editor" liste | awk -F";" '{print $2}' > $ConsTr/Document.lst
grep File liste  | awk -F";" '{print $2}' > $ConsTr/File.lst
grep Fun liste  | awk -F";" '{print $2}' > $ConsTr/Fun.lst
grep Graphic liste  | awk -F";" '{print $2}' > $ConsTr/Graphic.lst
grep Internet liste  | awk -F";" '{print $2}' > $ConsTr/Internet.lst
grep Network liste  | awk -F";" '{print $2}' > $ConsTr/Network.lst
grep Personal liste  | awk -F";" '{print $2}' > $ConsTr/Personal.lst
grep Security liste  | awk -F";" '{print $2}' > $ConsTr/Security.lst
grep Setup liste  | awk -F";" '{print $2}' > $ConsTr/Setup.lst
grep System liste  | awk -F";" '{print $2}' > $ConsTr/System.lst
grep Terminal liste  | awk -F";" '{print $2}' > $ConsTr/Terminal.lst
grep Utility liste | grep -E -v "Graphic|Personal|Setup" | awk -F";" '{print $2}' > $ConsTr/Utility.lst
#
cd $ConsTr
echo "prog ReList - /root/.icewm/lister.sh
prog Terminal - defaultterminal
# You can insert other useful   <=-
# personal apps on these lines. <=-
separator" > 0.submenu
#
ls -1 *.lst > groupes
while read groupe;do
	Titr="${groupe%.*}"
	> $Titr.submenu
	echo "menu $Titr - {
	separator" >> $Titr.submenu
		while read line;do
			Nom="${line%.*}"
			echo "    prog $Nom - rox /usr/share/applications/$line" >> $Titr.submenu
		done < $groupe
	echo "	separator
	}" >> $Titr.submenu
done < groupes

cat *.submenu > ../menu
# The updated icewm menu is now ready.
Besides the 0.submenu on lines 40-47, or thereabouts, above, you could
create a zzz.submenu at /root/.icewm/Construction directory, with your
material in it, and written with proper icewm menu syntax.

This personal submenu would show at about the middle of your menu,
before the "Windows", "Help", etc., groupings.

IHTH.

BFN
Attachments
Bye-bye_icewm-menu-dfo!.jpg
Menu resulting from running the above script.
(101.4 KiB) Downloaded 161 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
foxpup
Posts: 1132
Joined: Fri 29 Jul 2016, 21:08

#24 Post by foxpup »

Hello musher0

Thank you for the code.
I will try it out.
I may be back with some remarks :idea:
.
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#25 Post by musher0 »

foxpup wrote:Hello musher0

Thank you for the code.
I will try it out.
I may be back with some remarks :idea:
.
Yes please! :)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
foxpup
Posts: 1132
Joined: Fri 29 Jul 2016, 21:08

#26 Post by foxpup »

Hi musher0
musher0 wrote:Yes please!
I am still reading about bash, grep, awk, loops... LOL
Here I go anyway :-)

I don't like these categories, but they are kind of official categories, I suppose.
I like the categories of Puppy better, but I am a complete Puppy addict. :P

You do not use Name and Icon.
It is very clever how you do that, but - you can guess it. can you not? - I miss both.
I cannot solve it (yet), but I am searching, thinking, learning, puzzling.
I've discovered 'join' exists in bash.
And I found this script through ArchWiki:
https://github.com/AndyCrowd/list-desktop-files
It's too much, but it's in the right direction.
.
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#27 Post by musher0 »

Thank you kindly for the remark, foxpup.

I do not use the name and icon tags of the desktop files to save time in creating
the menu and displaying it on screen.

It also makes this script more portable for use with various window managers,
with a minimum of alterations. (This being the technical reason.)

So you feel more "at home" in this Puppy, I may look at a way of incorporating
the app icon in the menu, but not immediately, if I may. (I have another sub-
project on the burner ATM.)

Again, thanks.

TWYL.
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 »

Things went faster than expected, so here you go:
a menu creator script for icewm incorporating icons.

This one spreads more horizontally than the previous one as well.

Code: Select all

#!/bin/bash
# /root/.icewm/lister2-icons.sh
# A more sideways variant.
#
# Copy from this forum thread and save 
# at the directory and with the filename above.
##################################
# Please read note on lines 42-43.
##################################
# (c) Christian L'Écuyer (aka musher0), Gatineau (Qc), Canada, Thursday July 9, 2020. 
# Licence: GPL2 
####
APPS=/usr/share/applications
cd $APPS
grep -m 1 Categories *.desktop | grep -E -v "default|jwm" | awk -F":" '{print $2";"$1}' | awk -F"=" '{print $2}' | awk -F";" '{print $1";"$NF}' | sort > liste
> liste2
while read line;do 
	if [ "${line:0:2}" = "X-" ];then 
		line="${line:2}"
	fi
	echo $line >> liste2
done < liste
sort liste2 > liste
rm liste2
#
mkdir -p /root/.icewm/construction
ConsTr="/root/.icewm/construction"
grep Archiving liste > Archiving.lst
grep Audio liste | grep -v Video | awk -F";" '{print $2}' > $ConsTr/Audio.lst
grep AudioVideo liste | awk -F";" '{print $2}' > $ConsTr/AudioVideo.lst
grep Calculator liste | awk -F";" '{print $2}' > $ConsTr/Calculator.lst
grep Desktop liste | awk -F";" '{print $2}' > $ConsTr/Desktop.lst
grep -E "Disk|File" liste  | awk -F";" '{print $2}' > $ConsTr/Disk.lst
grep -E "Document|Editor" liste | awk -F";" '{print $2}' > $ConsTr/Document.lst
grep File liste  | awk -F";" '{print $2}' > $ConsTr/File.lst
grep Fun liste  | awk -F";" '{print $2}' > $ConsTr/Fun.lst
grep Graphic liste  | awk -F";" '{print $2}' > $ConsTr/Graphic.lst
grep Internet liste  | awk -F";" '{print $2}' > $ConsTr/Internet.lst
grep Network liste  | awk -F";" '{print $2}' > $ConsTr/Network.lst
grep Personal liste  | awk -F";" '{print $2}' > $ConsTr/Personal.lst
grep Security liste  | awk -F";" '{print $2}' > $ConsTr/Security.lst
grep Setup liste  | awk -F";" '{print $2}' > $ConsTr/Setup.lst
grep System liste  | awk -F";" '{print $2}' > $ConsTr/System.lst
grep Terminal liste  | awk -F";" '{print $2}' > $ConsTr/Terminal.lst
grep Utility liste | grep -E -v "Graphic|Personal|Setup" | awk -F";" '{print $2}' > $ConsTr/Utility.lst
#
cd $ConsTr
ls -1 *.lst > groupes
while read groupe;do
	Titr="${groupe%.*}"
	> $Titr.submenu
	echo "menu $Titr folder {
	separator" >> $Titr.submenu
		while read line;do
			Nom="${line%.*}"
			Icn="`grep -m 1 "Icon=" $APPS/$line`"
			Icn="${Icn#*=}" 
			echo "    prog $Nom $Icn rox $APPS/$line" >> $Titr.submenu
		done < $groupe
	echo "	separator
	}" >> $Titr.submenu
done < groupes
rm *.lst
# Grands groupes
echo "menu Activities folder {
separator" > Activities.submenu
cat Au*.submenu Calc*.submenu Do*.submenu Fun.submenu Gra*.submenu Int*.submenu Personal.submenu >> Activities.submenu
echo "separator 
}" >> Activities.submenu

echo "menu Technical folder {
separator" > Technical.submenu
cat Di*.submenu Net*.submenu S*.submenu Term*.submenu Util*.submenu >> Technical.submenu
echo "separator 
}" >> Technical.submenu

# Menu final
cat 000.submen Activ*.submenu Tech*.submenu zzz.submen > ../menu
rm *.submenu
cp ../menu ../menu.bkp
# The updated icewm menu is now ready.
Also this companion file for creating the 000 and zzz personal submenus:

Code: Select all

#!/bin/bash
# /root/.icewm/Construction/000-zzz.sh
# Companion file to lister2-icons.sh
####
echo "prog ReList /root/.icewm/Redo.png /root/.icewm/lister2.sh
# prog ReList - /root/.icewm/lister.sh
# Uncomment the variant you prefer.

# You can insert other useful   <=-
# personal apps on these lines. <=-
separator" > 000.submen

echo "separator
prog Terminal /root/.icewm/xterm.xpm defaultterminal
# You can insert other useful   <=-
# personal apps on these lines. <=-
" > zzz.submen
I'll provide a pet archive later, but you have all you need in this post.

TWYL.
Attachments
icewm-menu-creator-script-icons.jpg
(149.93 KiB) Downloaded 73 times
Redo.png
(13.89 KiB) Downloaded 72 times
xterm.xpm
(3.27 KiB) Not downloaded yet
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
User avatar
josejp2424
Posts: 556
Joined: Sun 01 Aug 2010, 22:35
Contact:

menu icewm

#29 Post by josejp2424 »

I was playing with the icewm menu
my results.

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

Re: menu icewm

#30 Post by musher0 »

josejp2424 wrote:I was playing with the icewm menu
my results.

Image
Interesting!

Were you using one of my scripts, icewm-menu-fdo, xdg-menu, or even something else?

BFN.
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

#31 Post by musher0 »

Hello all.

This menu creator script is in a state of flux!

Changes:
-- In addition to the categories discovered by grep at the beginning, the main
categories from Freedesktop.org have been added to broaden the scope a bit.
-- Check if there is anything in the submenu.lst with

Code: Select all

grep - c Category Some.lst
-- Presented both menu creator scripts in a pet archive. (Please see attached.)
-- I had forgotten the Archiving category previously...

List of included files in the archive:
.
[4.0K] ./root
[ 0] ./tree.lst
[4.0K] ./usr
[4.0K] ./usr/share
[4.0K] ./usr/share/applications
[ 824] ./usr/share/applications/deadbeef.desktop
[1.9K] ./usr/share/applications/deadbeef.original
[ 241] ./usr/share/applications/frisbee.desktop
[ 241] ./usr/share/applications/frisbee.original
[6.6K] ./usr/share/applications/lxinput.desktop
[6.6K] ./usr/share/applications/lxinput.original
[ 225] ./usr/share/applications/pupmixer.desktop
[ 217] ./usr/share/applications/pupmixer.original
[ 826] ./usr/share/applications/xarchive.desktop
[ 824] ./usr/share/applications/xarchive.original

4 directories, 11 files
As you can see, some corrected categories in *.desktop files are included.
Please read the *.original file and I'm sure it will become crystal clear why
the correction was needed. No need for a Ph.D. to understand.

So there:
one menu creator for icewm that creates more of a vertical menu, without icons, and
one menu creator for icewm that creates more of a sideways menu, with icons.
Also a companion script to create (or not, your choice) personal submenus.

Two icons, for the xterm and the Redo menu entries, are also included.

Comments welcome.

I'm not including new captures. Please see above if you need a visual.

BFN.
Attachments
icewm-menu-creator-scripts-01.pet
(20.71 KiB) Downloaded 287 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
User avatar
josejp2424
Posts: 556
Joined: Sun 01 Aug 2010, 22:35
Contact:

Re: menu icewm

#32 Post by josejp2424 »

musher0 wrote:
josejp2424 wrote:I was playing with the icewm menu
my results.

Image
Interesting!

Were you using one of my scripts, icewm-menu-fdo, xdg-menu, or even something else?

BFN.
use xdg-menu .
and it works together with the fixmenu.

test
https://sourceforge.net/projects/dpup/f ... dpup64.pet .

brings fixmenu and xdg-menu
User avatar
josejp2424
Posts: 556
Joined: Sun 01 Aug 2010, 22:35
Contact:

script menu

#33 Post by josejp2424 »

musher0 wrote:Hello all.

This menu creator script is in a state of flux!

Changes:
-- In addition to the categories discovered by grep at the beginning, the main
categories from Freedesktop.org have been added to broaden the scope a bit.
-- Check if there is anything in the submenu.lst with

Code: Select all

grep - c Category Some.lst
-- Presented both menu creator scripts in a pet archive. (Please see attached.)
-- I had forgotten the Archiving category previously...

List of included files in the archive:
.
[4.0K] ./root
[ 0] ./tree.lst
[4.0K] ./usr
[4.0K] ./usr/share
[4.0K] ./usr/share/applications
[ 824] ./usr/share/applications/deadbeef.desktop
[1.9K] ./usr/share/applications/deadbeef.original
[ 241] ./usr/share/applications/frisbee.desktop
[ 241] ./usr/share/applications/frisbee.original
[6.6K] ./usr/share/applications/lxinput.desktop
[6.6K] ./usr/share/applications/lxinput.original
[ 225] ./usr/share/applications/pupmixer.desktop
[ 217] ./usr/share/applications/pupmixer.original
[ 826] ./usr/share/applications/xarchive.desktop
[ 824] ./usr/share/applications/xarchive.original

4 directories, 11 files
As you can see, some corrected categories in *.desktop files are included.
Please read the *.original file and I'm sure it will become crystal clear why
the correction was needed. No need for a Ph.D. to understand.

So there:
one menu creator for icewm that creates more of a vertical menu, without icons, and
one menu creator for icewm that creates more of a sideways menu, with icons.
Also a companion script to create (or not, your choice) personal submenus.

Two icons, for the xterm and the Redo menu entries, are also included.

Comments welcome.

I'm not including new captures. Please see above if you need a visual.

BFN.
.
thank you musher0 ,
I'm already trying it out. I like menu scripts.

I went for the simple and used xdg-menu :(
Post Reply