View Single Post
Saturn's Avatar
Posts: 1,648 | Thanked: 2,122 times | Joined on Mar 2007 @ UNKLE's Never Never Land
#6
Hi fareed_xtreme,

Here some example code that might be useful to you.

To make a selection menu:

Code:
#!/bin/sh

selection=
until [ "$selection" = "0" ]; do
    echo ""
    echo "MENU"
    echo "1 - first command"
    echo "2 - second command"
    echo "3 - third command"
    echo ""
    echo "0 - exit program"
    echo ""
    echo -n "Enter selection: "
    read selection
    echo ""
    case $selection in
        0) exit ;;
	1) cd /home/user/;;
	2) ls -al;;
	3) ssh user@192.168.0.3;;
	*) echo "Please enter 1, 2, or 0"
    esac
done

The .desktop file should be put here:
Code:
/usr/share/applications/hildon/myScript.desktop
and the contents should look like this:
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=myScript
Exec=/usr/bin/osso-xterm "/home/user/myscripts/myScript.sh"
Icon=terminal
X-Osso-Type=application/x-executable
Good luck.
 

The Following 2 Users Say Thank You to Saturn For This Useful Post: