Edit: it wasn't the / in the Name= field... it was " (double quotes) in the Comment= field that caused the problem - .desktop files shouldn't contain quotes anyways AFAIK - I just fixed ayttm.desktop and all is well
the icons should be found if you have puppy 44a or stardust with updatedb and locate commands
This is not by any means a finished product - just a starting point that should be easily tweakable to your liking using other tips from this thread. I have it set up for right-handed touchscreen mode (everything on the right side) but it could still use a lot of formatting for appearance and speed. (ex. for faster start after first run you could write DLG to a file and use it if available)
Code: Select all
#!/bin/ash
# can't use entries with " (double quote) in the comment section maybe others - Ayttm is one example
for x in `ls /usr/share/applications/*.desktop`; do
EXE="`grep "^Exec=" $x |cut -d = -f 2`"
CAT="`grep "^Categories=" $x |cut -d = -f 2`"
NAM="`grep "^Name=" $x |cut -d = -f 2`"
ICO="`grep "^Icon=" $x |cut -d = -f 2`"
##needs full path to icon - will rework later
COM="`grep "^Comment=" $x |cut -d = -f 2`"
NEW="<hbox tooltip-text=\"$COM\"><button><label>$NAM</label><input file>$ICO</input><action>$EXE &</action></button></hbox>"
case $CAT in
*alculat*|*inance|*heet|ProjectManagement) BUS=$BUS$NEW;;
*eskto*|*creensave*|*ccessib*) DSK=$DSK$NEW;;
*ocumen*|*ordProcessor|*ebDevelo*) DOC=$DOC$NEW;;
*ile*) FIL=$FIL$NEW;;
*Game|*olePla*|*imulation|*musement) FUN=$FUN$NEW;;
*raphics|*hotography|*resent*|*art) GFX=$GFX$NEW;;
*udio*|*ideo*|*layer|*ecorder|*usic|*idi|*ixer|*equencer|*uner|TV|*iskBurning) MED=$MED$NEW;;
Dialup|Network|HamRadio|RemoteAccess) NET=$NET$NEW;;
X-PersonalUtility|X-Personal|Calendar|ContactManagement) PER=$PER$NEW;;
*etup*|PackageManager) SET=$SET$NEW;;
*onitor|*ecurity|*ardware*|*ore|*ystem) SYS=$SYS$NEW;;
Utility|Viewer|Development|Building|Debugger|IDE|Profiling|Translation|GUIDesigner|Archiving|TerminalEmulator|Shell) UTL=$UTL$NEW;;
*nternet|*rowser|*mail|*ews|*essaging|*elephony|*lient|*ransfer|P2P) WEB=$WEB$NEW;;
*) MSC=$MSC$NEW;;
esac
done
DLG="<notebook page=\"0\" tab-pos=\"1\" enable-popup=\"true\" labels=\"Business|Desktop|Document|File|Fun|Graphics|Media|Network|Personal|Setup|System|Utility|Web|Miscellaneous\">
<frame Business>$BUS</frame>
<frame Desktop>$DSK</frame>
<frame Document>$DOC</frame>
<frame File>$FIL</frame>
<frame Fun>$FUN</frame>
<frame Graphics>$GFX</frame>
<frame Media>$MED</frame>
<frame Network>$NET</frame>
<frame Personal>$PER</frame>
<frame Setup>$SET</frame>
<frame System>$SYS</frame>
<frame Utility>$UTL</frame>
<frame Web>$WEB</frame>
<frame Misc>$MSC</frame>
</notebook>"
export DLG
gtkdialog3 --program=DLG