bash – How to execute a command when selecting a option and pressing ‘ok’ button in yad

I’m using bad to create a “app store” with a gui and I can’t find any tutorial on how to execute a command when I select an option from a list and click on the ‘ok’ button (‘ok’ will be replaced with ‘install’). I want to use shell script only.

this is the script I wrote, its a simple list with 2 columns and 2 items in them. the windows icon is just a test.

yad --list --center --width=800 --height=600 --window-#icon=/home/pi/Downloads/ssr-icon.png --title "pi-apps" --column "app name" --column "description" SimpleScreenRecorder " powerful feature packed yet simple and easy to use screen recorder" System-Tools "system maintanance commands all done for you"