Skip to content

Instantly share code, notes, and snippets.

@smj10j
Created February 21, 2016 04:15
Show Gist options
  • Save smj10j/bc906b72c10882d01f0f to your computer and use it in GitHub Desktop.
Save smj10j/bc906b72c10882d01f0f to your computer and use it in GitHub Desktop.
Outputs hex-encoded RGB values for the colors inside an OSX Terminal profile
/usr/libexec/PlistBuddy -x -c 'Print "Window Settings":"hullabaloo"' ~/Library/Preferences/com.apple.Terminal.plist\
|tr -d '\n\t'|grep -o '[^>]*</key><data>[^<]*'\
|while read l;do \
echo ${l%%<*} $(base64 -d<<<${l##*>}|plutil -convert xml1 - -o -\
|awk '/<data>/{getline;print}'|tr -d '\t'|base64 -d\
|xargs -d ' ' -n 1 echo | xargs -I VAL echo "obase=16; (255*VAL)/1" | bc)\
; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment