Each morning I’ve been hooking my MacBook Pro up to my iMac and having to start Target Display Mode (TDM). Every time I disconnected and reconnected the Thunderbolt cable I’d have to re-establish the Target Display Mode, along with when my MBP went to sleep. So, today I created a simple script to observe the network interfaces and detect when a Thunderbolt bridge was established and then fire off the CMD+F2 Target Display Mode shortcut on my iMac.
Check out the repo here – https://github.com/garbit/AutoTDM
I’ve also got a startup script in the project folder if you want to add it to your startup applications.