Created
January 28, 2026 08:54
-
-
Save MarvinJWendt/9817c3d9a6920fa8b753dc1df923b606 to your computer and use it in GitHub Desktop.
Raycast script restart `DisplayLink Manager`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/osascript | |
| # Required parameters: | |
| # @raycast.schemaVersion 1 | |
| # @raycast.title Restart DisplayLink Manager | |
| # @raycast.mode compact | |
| # Optional parameters: | |
| # @raycast.icon 💻 | |
| # @raycast.packageName Restart DisplayLink Manager | |
| # Documentation: | |
| # @raycast.author marvinjwendt | |
| # @raycast.authorURL https://raycast.com/marvinjwendt | |
| on run | |
| set appName to "DisplayLink Manager" | |
| -- Try graceful quit first | |
| try | |
| tell application appName to quit | |
| end try | |
| -- Hard-stop the app and any helper/subprocesses, then relaunch. | |
| -- Use full bundle path so we can restart even if "activate" fails. | |
| set appPath to "/Applications/DisplayLink Manager.app" | |
| -- Kill by bundle id (most reliable for GUI app) | |
| try | |
| do shell script "killall 'DisplayLink Manager' >/dev/null 2>&1 || true" | |
| end try | |
| -- Kill common DisplayLink helper processes (adjust if needed) | |
| try | |
| do shell script "pkill -f -TERM 'DisplayLink' >/dev/null 2>&1 || true" | |
| delay 1 | |
| do shell script "pkill -f -KILL 'DisplayLink' >/dev/null 2>&1 || true" | |
| end try | |
| -- Wait until nothing DisplayLink-related is running anymore | |
| try | |
| do shell script "while pgrep -f 'DisplayLink' >/dev/null 2>&1; do sleep 0.2; done" | |
| end try | |
| -- Relaunch | |
| try | |
| do shell script "open -a " & quoted form of appPath | |
| on error | |
| -- Fallback if the app isn't in /Applications | |
| do shell script "open -a " & quoted form of appName | |
| end try | |
| end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment