chiark / gitweb /
bin/wakey.sh: Don't vomit at the terminal if the active window is dead.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 22 Apr 2020 21:04:31 +0000 (22:04 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 22 Apr 2020 21:04:31 +0000 (22:04 +0100)
I don't care about the error here: if `xwininfo' fails, then all that
happens is that I miss some (or all) of the window-ids, which is fine by
me.  In particular, if this happens with the terminal window, then I've
got nothing to complain into anyway.

bin/wakey.sh

index 1a1aab207c4dffbe03fffac03f12d173e92cb629..9a052580a9e8f34342426933ca6112900deebee9 100644 (file)
@@ -35,7 +35,7 @@ __wakey_precmd () {
            if (( win == WINDOWID )); then
              suppress=t
            else
-             for i in $(xwininfo -tree -id $win |
+             for i in $(xwininfo -tree -id $win 2>/dev/null |
                              sed -n '/^ *[0-9]\+ child\(ren\)\?[.:]$/,$ {
                                /^ *\(0x[0-9a-f]\+\) (.*$/s//\1/p
                              }')