Reputation: 321
I have three shell scripts and I would like to run each script after click on button in yad - lets say - I have one yad session with three buttons - if I click on one button I will open 1. script - second button open 2. script and so on.. See my example bellow -
#!/bin/bash
files=$(yad --width 100 --height 100 --title "Choose the Shell Script" \
--text=" Please enter analysis details:" \
--button="ShellScript1:2" \
--button="ShellScript2:3" \
--button="ShellScript3:3" \
--button="Cancel:1" \
--on-top \
--center \
)
ret=$?
[[ $ret -eq 1 ]] && exit 0
Thank you for any idea or help.
Upvotes: 0
Views: 3048
Reputation: 11
Optionally, you can use:
--button='ShellScript1:bash -c "script or command"'
Plaeae, have a look here:
How to run other bash scripts on YAD button click?
Upvotes: 1
Reputation: 321
I just add condition:
ret=$?
[[ $ret -eq 1 ]] && exit 0
if [[ $ret -eq 2 ]]; then
/path/to/shell/1.sh
fi
if [[ $ret -eq 3 ]]; then
/path/to/shell/2.sh
fi
Upvotes: 0