#!/bin/bash # /home/pi/arduinoproject/arduinostream.sh RET=0 SELOPT=$(zenity --list --width=350 --height=250 --radiolist \ --title="arduino stream python service: Choose option" \ --column "Select" --column="service option" TRUE "start" FALSE "stop" FALSE "restart" FALSE "status" ) RET=$? echo $SELOPT #echo $RET # 0 == ok , 1 = cancel button if [ "$SELOPT" = "start" ]; then sudo /etc/init.d/arduinostream start # echo "start" elif [ "$SELOPT" = "stop" ]; then sudo /etc/init.d/arduinostream stop # echo "stop" elif [ "$SELOPT" = "restart" ]; then sudo /etc/init.d/arduinostream restart # echo "restart" elif [ "$SELOPT" = "status" ]; then sudo /etc/init.d/arduinostream status # echo "status" else echo "cancel" fi # desktop starts this in terminal window and that would close, unless i give you time to read terminal window zenity --info --title="selected" --text="info \n you selected option:\n $SELOPT \n see terminal window for the results"