Update: cloned to here: https://apple.stackexchange.com/q/460841/209336
I'd like to have a bash script along the lines of this:
# set terminal window profile to profile2
sleep 300
# set terminal window profile to profile1
during that sleep, I might go off and start using a different application than Terminal, or I might be using a different Window of Terminal. So the approaches which send a message to the active or front terminal window don't work. Can I grab the current terminal window ID at the start and re-use it later ?