From 3c4de4f7c022224d0b9b7b695531b97bd81041d3 Mon Sep 17 00:00:00 2001 From: angelic-sedition Date: Fri, 13 Feb 2015 00:06:44 -0500 Subject: [PATCH] prevent need to click on initial term/win creation if there is no saved window id, xwininfo -id will be run without an argument and will wait for the user to click on a window; prevent this from happening --- tdrop | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tdrop b/tdrop index 8e26209..f64d2fd 100755 --- a/tdrop +++ b/tdrop @@ -126,8 +126,13 @@ wid_toggle() { # get saved window id if already created wid=$(< /tmp/tdrop/"$term$num") exists=true + if [[ -n $wid ]]; then visibility=$(xwininfo -id "$wid" | awk '/Map State/ {print $3}') - if [[ -z $wid ]] || [[ -z $visibility ]]; then + if [[ -z $visibility ]]; then + # window no longer exists + exists=false + fi + else exists=false fi if $exists && [[ $visibility != IsUnviewable ]]; then