Script for loading menu into Dialog. Loads apps in /tce.menu with others edited into script.
Run from terminal or create icon (I built this for use with dfm). Requires dialog.tcz
note: setup for reading jwm tce.menu/menu. Edit for different wm.
edit: added basename; remove for loading apps not in $PATH
#!/bin/ash
### apps_menu.sh script
#### Loads Apps into Dialog for selection
#### jpeters
#### Add the following apps to menu (create list) :
APPS="/usr/bin/exittc"
#### /Build list from tce.menu:
MENU=`awk '/usr/ {print $3}' /usr/local/tce.menu/menu | cut -f1 -d"<"`
. /etc/init.d/tc-functions
[ -f /tmp/menu ] && sudo rm /tmp/menu /tmp/choice
for I in ${MENU}
do
echo $(basename ${I}) >>/tmp/menu
echo "exec">>/tmp/menu
done
for I in ${APPS}
do
echo $(basename ${I}) >>/tmp/menu
echo "exec">>/tmp/menu
done
dialog --menu "Applications" 20 30 10 `cat /tmp/menu` 2>/tmp/choice
exec `cat /tmp/choice &`