Next Five Minute Lightning Talk: More screen(1) Hacks #7            

Keeping $DISPLAY up-to-date

    if test -z "$WINDOW"
    then export | egrep -- '-x (DISPLAY|XAUTHORITY)=' > ~/.display
    else test -r ~/.display && source ~/.display
    fi