Created
April 29, 2012 11:02
-
-
Save anonymous/2549414 to your computer and use it in GitHub Desktop.
Mainloop with zenity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment