DisplayLink issue on Lenovo's docking station for MacOS
I frequently experience that my external monitors do not wake from sleep when paired to my MacBook Pro using Lenovo's USB-C docking station.
![DisplayLink DisplayLink](https://res.cloudinary.com/kokholm/image/upload/w_720,ar_4.7461,f_auto,q_auto/thko/dl-horizontal-color.png)
DisplayLink
Often my monitors would never get a signal to wake after sleep-mode unless I first disconnect and reconnect the USB-C cable to my MacBook.
After some digging around, I found that it had nothing to do with my monitors, nor the Lenovo USB-C dock, but the DisplayLink Manager software. Once my MacBook wakes from sleep mode, the DisplayLink UserAgent simply fails to reconfigure the screens. However, if I restart the DisplayLink Manager software it fixes the problem.
My quick fix
Growing tired of reconnecting the USB-C cable I wrote a small script that restarts DisplayLink Manager, which runs when my MacBook Pro wakes up from sleep.
Here is the Apple Script to do it:
tell application "DisplayLink Manager"
quit
end tell
delay 2 -- Wait for DisplayLink Manager to close
tell application "DisplayLink Manager" to activate
Export as an App
![Export from Apple Instruction Tool Export from Apple Instruction Tool](https://res.cloudinary.com/kokholm/image/upload/w_720,ar_1.2261,f_auto,q_auto/thko/skaermbillede-2022-08-05-kl-13-22-20.png)
Export from Apple Instruction Tool
![Save as App format Save as App format](https://res.cloudinary.com/kokholm/image/upload/w_720,ar_1.1592,f_auto,q_auto/thko/skaermbillede-2022-08-05-kl-13-23-40.png)
Save as App format
Using Apple's Instruction tool, you can even paste the above script and export it as an executable app using "Export" -> "Format App" and then copy the generated app to your Applications folder. This way you can also manually run it by simply running this app from a single click.