Was also looking for a (less documented) zenity combo thingy like this ;-)
It makes it possible to create a tiny program with a lot of possibilities.
I know there is also yad, and I like it too, but sometimes it feels like it's easier to work with zenity in script.
Less (no) 'export' and 'bash -c', less 'echo > /dev/tty' with zenity.
My example of sth (a 7z 'guified' script) I'm working on (yes, on Mint):
VAR_WINIC="/usr/share/icons/Mint-Y/apps/32/zen-icon.png" # will become sth else probably. If you place it in every zenity, it always shows in panel aka taskbar.
fun_7z_menu (){
VAR_MENU=$(zenity --window-icon="${VAR_WINIC}" --width="600" --height="100" --entry --title="7z" --text="MENU"
--entry-text=
"01. Choice One"
"02. Choice Two"
"03. Etcetera"
--cancel-label="Exit" --ok-label="Select")
No space after '' at the end of the lines!
Escape & Closure:
VAR_RET=$? # Close program in case of cancel-button (Exit) or Esc (window X, for zenity the Esc is 252, included 255 anyway)
case ${VAR_RET} in
1|252|255)
exit 0
;;
esac
Menu items:
case ${VAR_MENU} in
"01"*) # Be careful if you have another number '01' within the entry-text. You could also just paste the whole entry-text-line here.
echo "Sth" # Possibly return sth to the terminal
possibly launch some fun_function here
fun_7z_menu # This relaunches aka keeps alive the zenity combo window after an item has been selected or another function has been executed.
;;
"02"*)
echo "Sth else"
possibly launch some fun_function here
fun_7z_menu
;;
"03"*)
echo "Sth etcetera"
possibly launch some fun_function here
fun_7z_menu
;;
esac
}
fun_7z_menu
There are probably other ways, but this gives possibilities I think.
Cheerio.