General TC > Programming & Scripting - Unofficial

apps-menu.sh

(1/1)

jpeters:
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


--- Code: --- #!/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 &`

--- End code ---

jpeters:
screenshot  with DFM:

[removed due to policy]apps/apps-menu.png

jpeters:
added basename (see screenshot)

Navigation

[0] Message Index

Go to full version