Skip to content

Instantly share code, notes, and snippets.

@mmazzarolo
Created December 18, 2018 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmazzarolo/1da05ffde856b703fbed5c9b246a25d9 to your computer and use it in GitHub Desktop.
Save mmazzarolo/1da05ffde856b703fbed5c9b246a25d9 to your computer and use it in GitHub Desktop.
Run scrcpy
if pgrep scrcpy; then
osascript -e 'tell application "System Events" to tell process "scrcpy"' \
-e 'set frontmost to true' \
-e 'if windows is not {} then perform action "AXRaise" of item 1 of windows' \
-e 'end tell'
else
/usr/local/bin/scrcpy
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment