WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: apps-menu.sh  (Read 3224 times)

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
apps-menu.sh
« on: November 19, 2009, 04:59:35 PM »
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: [Select]
#!/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 &`
« Last Edit: November 21, 2009, 04:59:03 AM by jpeters »

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: apps-menu.sh
« Reply #1 on: November 19, 2009, 07:59:49 PM »
screenshot  with DFM:

[removed due to policy]apps/apps-menu.png
« Last Edit: November 19, 2009, 08:45:38 PM by jpeters »

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: apps-menu.sh
« Reply #2 on: November 19, 2009, 08:46:03 PM »
added basename (see screenshot)