Created
February 4, 2014 18:37
-
-
Save henryroe/8809614 to your computer and use it in GitHub Desktop.
List all display sizes and origins in /Library/Preferences/com.apple.windowserver.plist
This file contains 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
#!/bin/bash | |
output="" | |
numDisplaySets=`/usr/libexec/PlistBuddy -c "Print DisplaySets" /Library/Preferences/com.apple.windowserver.plist | grep -E '^ Array' | wc -l` | |
for (( curDisplaySetNum=0; curDisplaySetNum<$numDisplaySets; curDisplaySetNum++ )) | |
do | |
echo "DisplaySet "$curDisplaySetNum | |
curDisplayNum=0 | |
notdone=1 | |
while [[ "$notdone" -ne 0 ]] | |
do | |
cur=`echo -e "Print DisplaySets:"$curDisplaySetNum":"$curDisplayNum":Width\nPrint DisplaySets:"$curDisplaySetNum":"$curDisplayNum":Height\nPrint DisplaySets:"$curDisplaySetNum":"$curDisplayNum":OriginX\nPrint DisplaySets:"$curDisplaySetNum":"$curDisplayNum":OriginY" | /usr/libexec/PlistBuddy ~/Library/Preferences/ByHost/com.apple.windowserver.*.plist 2>&1 | sed -e 's/Command: //g'` | |
if [[ $cur == *"Does Not Exist"* ]] | |
then | |
notdone=0 | |
else | |
echo " "$cur | |
fi | |
#echo $cur | |
curDisplayNum=`echo $curDisplayNum+1 | bc` | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment