View Single Post
fareed_xtreme's Avatar
Posts: 238 | Thanked: 291 times | Joined on Mar 2010 @ London, UK
#7
Originally Posted by Saturn View Post
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.
Just the thing I was searching for. Now Iet me get my lazy *** to work. :P maybe in a week or so ill try to get something ready :P