Prevent multiple instances of username entry dialog from running

This commit is contained in:
Bob Mottram 2017-10-28 20:02:02 +01:00
parent 1d929909ba
commit 239614e8e8
1 changed files with 4 additions and 0 deletions

View File

@ -781,6 +781,10 @@ function mesh_client_startup_applications {
echo '' >> $START_DESKTOP
echo 'INITIAL_TOX_USERNAME=""' >> $START_DESKTOP
echo 'while [ ${#INITIAL_TOX_USERNAME} -eq 0 ]; do' >> $START_DESKTOP
echo ' username_dialog_count=$(ps aux | grep zenity | wc -l)' >> $START_DESKTOP
echo ' if [ $username_dialog_count -gt 1 ]; then' >> $START_DESKTOP
echo ' exit 0' >> $START_DESKTOP
echo ' fi' >> $START_DESKTOP
echo " data=\$(zenity --forms --title=\"$MESH_TITLE\" --text=\"$MESH_SET_USERNAME\" --separator=\",\" --add-entry=\"Username\")" >> $START_DESKTOP
echo ' accepted=$?' >> $START_DESKTOP
echo ' if ((accepted == 0)); then' >> $START_DESKTOP