Skip to content

Instantly share code, notes, and snippets.

@altercation
Last active May 18, 2022 17:06
Show Gist options
  • Save altercation/b8240e3562c7f5da2ed4315b63204d12 to your computer and use it in GitHub Desktop.
Save altercation/b8240e3562c7f5da2ed4315b63204d12 to your computer and use it in GitHub Desktop.
Applescript to call dispreset when connected to multiple displays
# I use EventScripts to call this on screen unlock
# https://www.mousedown.net/software/EventScripts.html
tell application "Image Events"
launch
set countDisplays to count displays
if countDisplays > 1 then
do shell script "/usr/bin/curl \"http://192.168.0.99:3091/button-mbp-docked-unlock-trigger?event=click\""
do shell script "/Users/es/bin/dispreset"
end if
quit
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment