Skip to content

Commit

Permalink
Merge branch 'feature/ghi-#1-initial-implementation' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
arcticicestudio committed Apr 23, 2017
2 parents 4e363c6 + adc4620 commit 8a9a2ac
Show file tree
Hide file tree
Showing 2 changed files with 303 additions and 0 deletions.
123 changes: 123 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#!/usr/bin/env bash
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# title Install Script +
# project nord-xcode +
# repository https://github.com/arcticicestudio/nord-xcode +
# author Arctic Ice Studio +
# email [email protected] +
# copyright Copyright (C) 2017 +
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
set -e

NORD_XCODE_SCRIPT_OPTS=`getopt -o vghc: --long verbose,help,colortheme: -n 'install.sh' -- "$@"`
COLOR_THEME_FILE=src/Nord.xccolortheme
VERBOSE=false
LOCAL_INSTALL_DIR=~/Library/Developer/Xcode/UserData/FontAndColorThemes

_ct_error="\e[0;31m"
_ct_success="\e[0;32m"
_ct_warning="\e[0;33m"
_ct_highlight="\e[0;34m"
_ct_primary="\e[0;36m"
_ct="\e[0;37m"
_ctb_subtle="\e[1;30m"
_ctb_error="\e[1;31m"
_ctb_success="\e[1;32m"
_ctb_warning="\e[1;33m"
_ctb_highlight="\e[1;34m"
_ctb_primary="\e[1;36m"
_ctb="\e[1;37m"
_c_reset="\e[0m"

trap "printf '${_ctb_error}User aborted.${_ctb_reset}\n' && exit 1" SIGINT SIGTERM

__help() {
printf "${_ctb}Usage: ${_ct_primary}install.sh ${_ctb_subtle}[OPTIONS]\n"
printf " ${_ctb_highlight}-h${_ct},${_ctb_highlight} --help ${_ct}Help\n"
printf " ${_ctb_highlight}-v${_ct},${_ctb_highlight} --verbose ${_ct}Verbose output\n${_ctb_reset}"
printf " ${_ctb_highlight}-c${_ct},${_ctb_highlight} --colortheme <COLOR_THEME_FILE> \
${_ct}Use the specified theme file\n${_ctb_reset}"
}

__cleanup() {
trap '' SIGINT SIGTERM
unset -v _ct_error _ct_success _ct_warning _ct_highlight _ct_primary _ct
unset -v _ctb_error _ctb_success _ctb_warning _ctb_highlight _ctb_primary _ctb _c_reset
unset -v NORD_XCODE_SCRIPT_OPTS COLOR_THEME_FILE VERBOSE LOCAL_INSTALL
unset -f __help __cleanup __log_error __log_success __log_warning __log_info
unset -f __validate_file __local_install
}

__log_error() {
printf "${_ctb_error}[ERROR] ${_ct}$1${_c_reset}\n"
}

__log_success() {
printf "${_ctb_success}[OK] ${_ct}$1${_c_reset}\n"
}

__log_warning() {
printf "${_ctb_warning}[WARN] ${_ct}$1${_c_reset}\n"
}

__log_info() {
printf "${_ctb}[INFO] ${_ct}$1${_c_reset}\n"
}

__summary_success() {
__log_success "Local installation completed"
__cleanup
exit 0
}

__summary_error() {
__log_error "An error occurred during the installation!"
__log_error "Exit code: $1"
__cleanup
exit 1
}

__local_install() {
__validate_file
if [ ! -d $LOCAL_INSTALL_DIR ]; then
mkdir -p $LOCAL_INSTALL_DIR
if [ $? -eq 0 ]; then
if [ $VERBOSE = true ]; then __log_info "Created local directory $LOCAL_INSTALL_DIR"; fi
else
__log_error "Could not create local directory $LOCAL_INSTALL_DIR"
__summary_error 1
fi
fi
cp -f $COLOR_THEME_FILE $LOCAL_INSTALL_DIR
if [ $? -eq 0 ]; then
if [ $VERBOSE = true ]; then __log_success "Copied color theme file to $LOCAL_INSTALL_DIR"; fi
__summary_success
else
__log_error "Could not copy color theme file to $LOCAL_INSTALL_DIR"
__summary_error 1
fi
}

__validate_file() {
if [ ! -f $COLOR_THEME_FILE ]; then
__log_error "Color theme file not found: $COLOR_THEME_FILE"
__summary_error 1
fi
}

eval set -- "$NORD_XCODE_SCRIPT_OPTS"
while true; do
case "$1" in
-v | --verbose ) VERBOSE=true; shift ;;
-h | --help ) __help; exit 0; break ;;
-c | --colortheme )
COLOR_THEME_FILE="$2"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done

__local_install

__cleanup
exit 0
180 changes: 180 additions & 0 deletions src/Nord.xccolortheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.816187 0.837374 0.894673 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>SFMono-Bold - 12.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0.816187 0.837374 0.894673 1</string>
<key>DVTConsoleDebuggerOutputTextFont</key>
<string>SFMono-Regular - 12.0</string>
<key>DVTConsoleDebuggerPromptTextColor</key>
<string>0.450991 0.556703 0.711154 1</string>
<key>DVTConsoleDebuggerPromptTextFont</key>
<string>SFMono-Regular - 12.0</string>
<key>DVTConsoleExectuableInputTextColor</key>
<string>0.816187 0.837374 0.894673 1</string>
<key>DVTConsoleExectuableInputTextFont</key>
<string>SFMono-RegularItalic - 12.0</string>
<key>DVTConsoleExectuableOutputTextColor</key>
<string>0.48763 0.698625 0.777955 1</string>
<key>DVTConsoleExectuableOutputTextFont</key>
<string>SFMono-Bold - 12.0</string>
<key>DVTConsoleTextBackgroundColor</key>
<string>0.138852 0.15161 0.193536 1</string>
<key>DVTConsoleTextInsertionPointColor</key>
<string>0.816187 0.837374 0.894673 1</string>
<key>DVTConsoleTextSelectionColor</key>
<string>0.207823 0.228868 0.298817 0.796387</string>
<key>DVTDebuggerInstructionPointerColor</key>
<string>0.506519 0.684472 0.678581 1</string>
<key>DVTMarkupTextBackgroundColor</key>
<string>0.96 0.96 0.96 1</string>
<key>DVTMarkupTextBorderColor</key>
<string>0.8832 0.8832 0.8832 1</string>
<key>DVTMarkupTextCodeFont</key>
<string>SFMono-Regular - 10.0</string>
<key>DVTMarkupTextEmphasisColor</key>
<string>0 0 0 1</string>
<key>DVTMarkupTextEmphasisFont</key>
<string>.AppleSystemUIFontItalic - 10.0</string>
<key>DVTMarkupTextInlineCodeColor</key>
<string>0 0 0 0.7</string>
<key>DVTMarkupTextLinkColor</key>
<string>0.055 0.055 1 1</string>
<key>DVTMarkupTextLinkFont</key>
<string>.AppleSystemUIFont - 10.0</string>
<key>DVTMarkupTextNormalColor</key>
<string>0 0 0 1</string>
<key>DVTMarkupTextNormalFont</key>
<string>.AppleSystemUIFont - 10.0</string>
<key>DVTMarkupTextOtherHeadingColor</key>
<string>0 0 0 0.5</string>
<key>DVTMarkupTextOtherHeadingFont</key>
<string>.AppleSystemUIFont - 14.0</string>
<key>DVTMarkupTextPrimaryHeadingColor</key>
<string>0 0 0 1</string>
<key>DVTMarkupTextPrimaryHeadingFont</key>
<string>.AppleSystemUIFont - 24.0</string>
<key>DVTMarkupTextSecondaryHeadingColor</key>
<string>0 0 0 1</string>
<key>DVTMarkupTextSecondaryHeadingFont</key>
<string>.AppleSystemUIFont - 18.0</string>
<key>DVTMarkupTextStrongColor</key>
<string>0 0 0 1</string>
<key>DVTMarkupTextStrongFont</key>
<string>.AppleSystemUIFontEmphasized - 10.0</string>
<key>DVTSourceTextBackground</key>
<string>0.138852 0.15161 0.193536 1</string>
<key>DVTSourceTextBlockDimBackgroundColor</key>
<string>0.5 0.5 0.5 1</string>
<key>DVTSourceTextCurrentLineHighlightColor</key>
<string>0.207823 0.228868 0.298817 0.317965</string>
<key>DVTSourceTextInsertionPointColor</key>
<string>0.816187 0.837374 0.894673 1</string>
<key>DVTSourceTextInvisiblesColor</key>
<string>0.239159 0.263378 0.343876 1</string>
<key>DVTSourceTextSelectionColor</key>
<string>0.207823 0.228868 0.298817 0.800631</string>
<key>DVTSourceTextSyntaxColors</key>
<dict>
<key>xcode.syntax.attribute</key>
<string>0.748739 0.455574 0.357075 1</string>
<key>xcode.syntax.character</key>
<string>0.574309 0.70253 0.464919 1</string>
<key>xcode.syntax.comment</key>
<string>0.239159 0.263378 0.343876 1</string>
<key>xcode.syntax.comment.doc</key>
<string>0.239159 0.263378 0.343876 1</string>
<key>xcode.syntax.comment.doc.keyword</key>
<string>0.506519 0.684472 0.678581 1</string>
<key>xcode.syntax.identifier.class</key>
<string>0.506519 0.684472 0.678581 1</string>
<key>xcode.syntax.identifier.class.system</key>
<string>0.506519 0.684472 0.678581 1</string>
<key>xcode.syntax.identifier.constant</key>
<string>0.816187 0.837374 0.894673 1</string>
<key>xcode.syntax.identifier.constant.system</key>
<string>0.816187 0.837374 0.894673 1</string>
<key>xcode.syntax.identifier.function</key>
<string>0.48763 0.698625 0.777955 1</string>
<key>xcode.syntax.identifier.function.system</key>
<string>0.48763 0.698625 0.777955 1</string>
<key>xcode.syntax.identifier.macro</key>
<string>0.320664 0.420666 0.61863 1</string>
<key>xcode.syntax.identifier.macro.system</key>
<string>0.320664 0.420666 0.61863 1</string>
<key>xcode.syntax.identifier.type</key>
<string>0.506519 0.684472 0.678581 1</string>
<key>xcode.syntax.identifier.type.system</key>
<string>0.487604 0.68705 0.679528 1</string>
<key>xcode.syntax.identifier.variable</key>
<string>0.816187 0.837374 0.894673 1</string>
<key>xcode.syntax.identifier.variable.system</key>
<string>0.816187 0.837374 0.894673 1</string>
<key>xcode.syntax.keyword</key>
<string>0.450991 0.556703 0.711154 1</string>
<key>xcode.syntax.number</key>
<string>0.638894 0.47419 0.620239 1</string>
<key>xcode.syntax.plain</key>
<string>0.816187 0.837374 0.894673 1</string>
<key>xcode.syntax.preprocessor</key>
<string>0.320664 0.420666 0.61863 1</string>
<key>xcode.syntax.string</key>
<string>0.574309 0.70253 0.464919 1</string>
<key>xcode.syntax.url</key>
<string>0.239159 0.263378 0.343876 1</string>
</dict>
<key>DVTSourceTextSyntaxFonts</key>
<dict>
<key>xcode.syntax.attribute</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.character</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.comment</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.comment.doc</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.comment.doc.keyword</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.identifier.class</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.identifier.class.system</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.identifier.constant</key>
<string>SFMono-Bold - 12.0</string>
<key>xcode.syntax.identifier.constant.system</key>
<string>SFMono-Bold - 12.0</string>
<key>xcode.syntax.identifier.function</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.identifier.function.system</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.identifier.macro</key>
<string>SFMono-RegularItalic - 12.0</string>
<key>xcode.syntax.identifier.macro.system</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.identifier.type</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.identifier.type.system</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.identifier.variable</key>
<string>SFMono-RegularItalic - 12.0</string>
<key>xcode.syntax.identifier.variable.system</key>
<string>SFMono-RegularItalic - 12.0</string>
<key>xcode.syntax.keyword</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.number</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.plain</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.preprocessor</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.string</key>
<string>SFMono-Regular - 12.0</string>
<key>xcode.syntax.url</key>
<string>SFMono-RegularItalic - 12.0</string>
</dict>
</dict>
</plist>

0 comments on commit 8a9a2ac

Please sign in to comment.