public
anonymous / foo.sh
Created

Mainloop with zenity

  • Download Gist
foo.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/bin/bash
function washcar()
{
echo "Car washed."
}
 
function mow()
{
echo "Lawn mown."
}
 
while true; do
CHOICE=$(zenity --list --radiolist \
--title="Lazy man's menu" \
--column="Selection" \
--column="Name" \
--column="Description" \
--width=550 --height=625 \
'FALSE' "Do Something" "Wash my car" \
'FALSE' "Do Something Else" "Mow the lawn" \
'FALSE' "Exit" "Exit")
case $CHOICE in
"Do Something") washcar ;;
"Do Something Else") mow ;;
"Exit") exit 0 ;;
esac
done

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.