200 loops just in case

This commit is contained in:
inigoortega 2019-10-10 23:08:19 +02:00
parent 7ce3f490d7
commit b732d846b0
1 changed files with 6 additions and 5 deletions

View File

@ -15,18 +15,19 @@ get_window_id () {
} }
telegram-desktop telegram-desktop
xdotool key alt+7
telegram_id="$(pgrep Telegram)" telegram_id="$(pgrep Telegram)"
window_id="$(get_window_id "$telegram_id")" window_id="$(get_window_id "$telegram_id")"
i=0
while true while [ "$i" -lt 200 ]
do do
correct="$(xprop -id "$window_id" | grep "window state: Normal")" correct="$(xprop -id "$window_id" | grep "window state: Normal")"
[ -n "$correct" ] && break [ -n "$correct" ] && break || i="$(( $i + 1))"
done done
xdotool key Return if [ "$i" -lt 200 ]; then
xdotool key alt+7 && xdotool key Return
fi