Skip to content

Instantly share code, notes, and snippets.

@ilkka
Created February 27, 2017 12:07
Show Gist options
  • Save ilkka/dbcc5d72bd6c128e066d577f5bef61c8 to your computer and use it in GitHub Desktop.
Save ilkka/dbcc5d72bd6c128e066d577f5bef61c8 to your computer and use it in GitHub Desktop.
Get the resolutions of all connected mac OS displays
# Prerequisites: brew install xmlstarlet
system_profiler -xml SPDisplaysDataType \
| xmlstarlet sel -t -v "//array/dict/key[. = '_spdisplays_pixels']/following-sibling::string[1]" 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment