Skip to content

Commit 8a9a2ac

Browse files
Merge branch 'feature/ghi-#1-initial-implementation' into develop
2 parents 4e363c6 + adc4620 commit 8a9a2ac

File tree

2 files changed

+303
-0
lines changed

2 files changed

+303
-0
lines changed

install.sh

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#!/usr/bin/env bash
2+
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3+
# title Install Script +
4+
# project nord-xcode +
5+
# repository https://github.com/arcticicestudio/nord-xcode +
6+
# author Arctic Ice Studio +
7+
8+
# copyright Copyright (C) 2017 +
9+
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10+
set -e
11+
12+
NORD_XCODE_SCRIPT_OPTS=`getopt -o vghc: --long verbose,help,colortheme: -n 'install.sh' -- "$@"`
13+
COLOR_THEME_FILE=src/Nord.xccolortheme
14+
VERBOSE=false
15+
LOCAL_INSTALL_DIR=~/Library/Developer/Xcode/UserData/FontAndColorThemes
16+
17+
_ct_error="\e[0;31m"
18+
_ct_success="\e[0;32m"
19+
_ct_warning="\e[0;33m"
20+
_ct_highlight="\e[0;34m"
21+
_ct_primary="\e[0;36m"
22+
_ct="\e[0;37m"
23+
_ctb_subtle="\e[1;30m"
24+
_ctb_error="\e[1;31m"
25+
_ctb_success="\e[1;32m"
26+
_ctb_warning="\e[1;33m"
27+
_ctb_highlight="\e[1;34m"
28+
_ctb_primary="\e[1;36m"
29+
_ctb="\e[1;37m"
30+
_c_reset="\e[0m"
31+
32+
trap "printf '${_ctb_error}User aborted.${_ctb_reset}\n' && exit 1" SIGINT SIGTERM
33+
34+
__help() {
35+
printf "${_ctb}Usage: ${_ct_primary}install.sh ${_ctb_subtle}[OPTIONS]\n"
36+
printf " ${_ctb_highlight}-h${_ct},${_ctb_highlight} --help ${_ct}Help\n"
37+
printf " ${_ctb_highlight}-v${_ct},${_ctb_highlight} --verbose ${_ct}Verbose output\n${_ctb_reset}"
38+
printf " ${_ctb_highlight}-c${_ct},${_ctb_highlight} --colortheme <COLOR_THEME_FILE> \
39+
${_ct}Use the specified theme file\n${_ctb_reset}"
40+
}
41+
42+
__cleanup() {
43+
trap '' SIGINT SIGTERM
44+
unset -v _ct_error _ct_success _ct_warning _ct_highlight _ct_primary _ct
45+
unset -v _ctb_error _ctb_success _ctb_warning _ctb_highlight _ctb_primary _ctb _c_reset
46+
unset -v NORD_XCODE_SCRIPT_OPTS COLOR_THEME_FILE VERBOSE LOCAL_INSTALL
47+
unset -f __help __cleanup __log_error __log_success __log_warning __log_info
48+
unset -f __validate_file __local_install
49+
}
50+
51+
__log_error() {
52+
printf "${_ctb_error}[ERROR] ${_ct}$1${_c_reset}\n"
53+
}
54+
55+
__log_success() {
56+
printf "${_ctb_success}[OK] ${_ct}$1${_c_reset}\n"
57+
}
58+
59+
__log_warning() {
60+
printf "${_ctb_warning}[WARN] ${_ct}$1${_c_reset}\n"
61+
}
62+
63+
__log_info() {
64+
printf "${_ctb}[INFO] ${_ct}$1${_c_reset}\n"
65+
}
66+
67+
__summary_success() {
68+
__log_success "Local installation completed"
69+
__cleanup
70+
exit 0
71+
}
72+
73+
__summary_error() {
74+
__log_error "An error occurred during the installation!"
75+
__log_error "Exit code: $1"
76+
__cleanup
77+
exit 1
78+
}
79+
80+
__local_install() {
81+
__validate_file
82+
if [ ! -d $LOCAL_INSTALL_DIR ]; then
83+
mkdir -p $LOCAL_INSTALL_DIR
84+
if [ $? -eq 0 ]; then
85+
if [ $VERBOSE = true ]; then __log_info "Created local directory $LOCAL_INSTALL_DIR"; fi
86+
else
87+
__log_error "Could not create local directory $LOCAL_INSTALL_DIR"
88+
__summary_error 1
89+
fi
90+
fi
91+
cp -f $COLOR_THEME_FILE $LOCAL_INSTALL_DIR
92+
if [ $? -eq 0 ]; then
93+
if [ $VERBOSE = true ]; then __log_success "Copied color theme file to $LOCAL_INSTALL_DIR"; fi
94+
__summary_success
95+
else
96+
__log_error "Could not copy color theme file to $LOCAL_INSTALL_DIR"
97+
__summary_error 1
98+
fi
99+
}
100+
101+
__validate_file() {
102+
if [ ! -f $COLOR_THEME_FILE ]; then
103+
__log_error "Color theme file not found: $COLOR_THEME_FILE"
104+
__summary_error 1
105+
fi
106+
}
107+
108+
eval set -- "$NORD_XCODE_SCRIPT_OPTS"
109+
while true; do
110+
case "$1" in
111+
-v | --verbose ) VERBOSE=true; shift ;;
112+
-h | --help ) __help; exit 0; break ;;
113+
-c | --colortheme )
114+
COLOR_THEME_FILE="$2"; shift 2 ;;
115+
-- ) shift; break ;;
116+
* ) break ;;
117+
esac
118+
done
119+
120+
__local_install
121+
122+
__cleanup
123+
exit 0

src/Nord.xccolortheme

+180
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>DVTConsoleDebuggerInputTextColor</key>
6+
<string>0.816187 0.837374 0.894673 1</string>
7+
<key>DVTConsoleDebuggerInputTextFont</key>
8+
<string>SFMono-Bold - 12.0</string>
9+
<key>DVTConsoleDebuggerOutputTextColor</key>
10+
<string>0.816187 0.837374 0.894673 1</string>
11+
<key>DVTConsoleDebuggerOutputTextFont</key>
12+
<string>SFMono-Regular - 12.0</string>
13+
<key>DVTConsoleDebuggerPromptTextColor</key>
14+
<string>0.450991 0.556703 0.711154 1</string>
15+
<key>DVTConsoleDebuggerPromptTextFont</key>
16+
<string>SFMono-Regular - 12.0</string>
17+
<key>DVTConsoleExectuableInputTextColor</key>
18+
<string>0.816187 0.837374 0.894673 1</string>
19+
<key>DVTConsoleExectuableInputTextFont</key>
20+
<string>SFMono-RegularItalic - 12.0</string>
21+
<key>DVTConsoleExectuableOutputTextColor</key>
22+
<string>0.48763 0.698625 0.777955 1</string>
23+
<key>DVTConsoleExectuableOutputTextFont</key>
24+
<string>SFMono-Bold - 12.0</string>
25+
<key>DVTConsoleTextBackgroundColor</key>
26+
<string>0.138852 0.15161 0.193536 1</string>
27+
<key>DVTConsoleTextInsertionPointColor</key>
28+
<string>0.816187 0.837374 0.894673 1</string>
29+
<key>DVTConsoleTextSelectionColor</key>
30+
<string>0.207823 0.228868 0.298817 0.796387</string>
31+
<key>DVTDebuggerInstructionPointerColor</key>
32+
<string>0.506519 0.684472 0.678581 1</string>
33+
<key>DVTMarkupTextBackgroundColor</key>
34+
<string>0.96 0.96 0.96 1</string>
35+
<key>DVTMarkupTextBorderColor</key>
36+
<string>0.8832 0.8832 0.8832 1</string>
37+
<key>DVTMarkupTextCodeFont</key>
38+
<string>SFMono-Regular - 10.0</string>
39+
<key>DVTMarkupTextEmphasisColor</key>
40+
<string>0 0 0 1</string>
41+
<key>DVTMarkupTextEmphasisFont</key>
42+
<string>.AppleSystemUIFontItalic - 10.0</string>
43+
<key>DVTMarkupTextInlineCodeColor</key>
44+
<string>0 0 0 0.7</string>
45+
<key>DVTMarkupTextLinkColor</key>
46+
<string>0.055 0.055 1 1</string>
47+
<key>DVTMarkupTextLinkFont</key>
48+
<string>.AppleSystemUIFont - 10.0</string>
49+
<key>DVTMarkupTextNormalColor</key>
50+
<string>0 0 0 1</string>
51+
<key>DVTMarkupTextNormalFont</key>
52+
<string>.AppleSystemUIFont - 10.0</string>
53+
<key>DVTMarkupTextOtherHeadingColor</key>
54+
<string>0 0 0 0.5</string>
55+
<key>DVTMarkupTextOtherHeadingFont</key>
56+
<string>.AppleSystemUIFont - 14.0</string>
57+
<key>DVTMarkupTextPrimaryHeadingColor</key>
58+
<string>0 0 0 1</string>
59+
<key>DVTMarkupTextPrimaryHeadingFont</key>
60+
<string>.AppleSystemUIFont - 24.0</string>
61+
<key>DVTMarkupTextSecondaryHeadingColor</key>
62+
<string>0 0 0 1</string>
63+
<key>DVTMarkupTextSecondaryHeadingFont</key>
64+
<string>.AppleSystemUIFont - 18.0</string>
65+
<key>DVTMarkupTextStrongColor</key>
66+
<string>0 0 0 1</string>
67+
<key>DVTMarkupTextStrongFont</key>
68+
<string>.AppleSystemUIFontEmphasized - 10.0</string>
69+
<key>DVTSourceTextBackground</key>
70+
<string>0.138852 0.15161 0.193536 1</string>
71+
<key>DVTSourceTextBlockDimBackgroundColor</key>
72+
<string>0.5 0.5 0.5 1</string>
73+
<key>DVTSourceTextCurrentLineHighlightColor</key>
74+
<string>0.207823 0.228868 0.298817 0.317965</string>
75+
<key>DVTSourceTextInsertionPointColor</key>
76+
<string>0.816187 0.837374 0.894673 1</string>
77+
<key>DVTSourceTextInvisiblesColor</key>
78+
<string>0.239159 0.263378 0.343876 1</string>
79+
<key>DVTSourceTextSelectionColor</key>
80+
<string>0.207823 0.228868 0.298817 0.800631</string>
81+
<key>DVTSourceTextSyntaxColors</key>
82+
<dict>
83+
<key>xcode.syntax.attribute</key>
84+
<string>0.748739 0.455574 0.357075 1</string>
85+
<key>xcode.syntax.character</key>
86+
<string>0.574309 0.70253 0.464919 1</string>
87+
<key>xcode.syntax.comment</key>
88+
<string>0.239159 0.263378 0.343876 1</string>
89+
<key>xcode.syntax.comment.doc</key>
90+
<string>0.239159 0.263378 0.343876 1</string>
91+
<key>xcode.syntax.comment.doc.keyword</key>
92+
<string>0.506519 0.684472 0.678581 1</string>
93+
<key>xcode.syntax.identifier.class</key>
94+
<string>0.506519 0.684472 0.678581 1</string>
95+
<key>xcode.syntax.identifier.class.system</key>
96+
<string>0.506519 0.684472 0.678581 1</string>
97+
<key>xcode.syntax.identifier.constant</key>
98+
<string>0.816187 0.837374 0.894673 1</string>
99+
<key>xcode.syntax.identifier.constant.system</key>
100+
<string>0.816187 0.837374 0.894673 1</string>
101+
<key>xcode.syntax.identifier.function</key>
102+
<string>0.48763 0.698625 0.777955 1</string>
103+
<key>xcode.syntax.identifier.function.system</key>
104+
<string>0.48763 0.698625 0.777955 1</string>
105+
<key>xcode.syntax.identifier.macro</key>
106+
<string>0.320664 0.420666 0.61863 1</string>
107+
<key>xcode.syntax.identifier.macro.system</key>
108+
<string>0.320664 0.420666 0.61863 1</string>
109+
<key>xcode.syntax.identifier.type</key>
110+
<string>0.506519 0.684472 0.678581 1</string>
111+
<key>xcode.syntax.identifier.type.system</key>
112+
<string>0.487604 0.68705 0.679528 1</string>
113+
<key>xcode.syntax.identifier.variable</key>
114+
<string>0.816187 0.837374 0.894673 1</string>
115+
<key>xcode.syntax.identifier.variable.system</key>
116+
<string>0.816187 0.837374 0.894673 1</string>
117+
<key>xcode.syntax.keyword</key>
118+
<string>0.450991 0.556703 0.711154 1</string>
119+
<key>xcode.syntax.number</key>
120+
<string>0.638894 0.47419 0.620239 1</string>
121+
<key>xcode.syntax.plain</key>
122+
<string>0.816187 0.837374 0.894673 1</string>
123+
<key>xcode.syntax.preprocessor</key>
124+
<string>0.320664 0.420666 0.61863 1</string>
125+
<key>xcode.syntax.string</key>
126+
<string>0.574309 0.70253 0.464919 1</string>
127+
<key>xcode.syntax.url</key>
128+
<string>0.239159 0.263378 0.343876 1</string>
129+
</dict>
130+
<key>DVTSourceTextSyntaxFonts</key>
131+
<dict>
132+
<key>xcode.syntax.attribute</key>
133+
<string>SFMono-Regular - 12.0</string>
134+
<key>xcode.syntax.character</key>
135+
<string>SFMono-Regular - 12.0</string>
136+
<key>xcode.syntax.comment</key>
137+
<string>SFMono-Regular - 12.0</string>
138+
<key>xcode.syntax.comment.doc</key>
139+
<string>SFMono-Regular - 12.0</string>
140+
<key>xcode.syntax.comment.doc.keyword</key>
141+
<string>SFMono-Regular - 12.0</string>
142+
<key>xcode.syntax.identifier.class</key>
143+
<string>SFMono-Regular - 12.0</string>
144+
<key>xcode.syntax.identifier.class.system</key>
145+
<string>SFMono-Regular - 12.0</string>
146+
<key>xcode.syntax.identifier.constant</key>
147+
<string>SFMono-Bold - 12.0</string>
148+
<key>xcode.syntax.identifier.constant.system</key>
149+
<string>SFMono-Bold - 12.0</string>
150+
<key>xcode.syntax.identifier.function</key>
151+
<string>SFMono-Regular - 12.0</string>
152+
<key>xcode.syntax.identifier.function.system</key>
153+
<string>SFMono-Regular - 12.0</string>
154+
<key>xcode.syntax.identifier.macro</key>
155+
<string>SFMono-RegularItalic - 12.0</string>
156+
<key>xcode.syntax.identifier.macro.system</key>
157+
<string>SFMono-Regular - 12.0</string>
158+
<key>xcode.syntax.identifier.type</key>
159+
<string>SFMono-Regular - 12.0</string>
160+
<key>xcode.syntax.identifier.type.system</key>
161+
<string>SFMono-Regular - 12.0</string>
162+
<key>xcode.syntax.identifier.variable</key>
163+
<string>SFMono-RegularItalic - 12.0</string>
164+
<key>xcode.syntax.identifier.variable.system</key>
165+
<string>SFMono-RegularItalic - 12.0</string>
166+
<key>xcode.syntax.keyword</key>
167+
<string>SFMono-Regular - 12.0</string>
168+
<key>xcode.syntax.number</key>
169+
<string>SFMono-Regular - 12.0</string>
170+
<key>xcode.syntax.plain</key>
171+
<string>SFMono-Regular - 12.0</string>
172+
<key>xcode.syntax.preprocessor</key>
173+
<string>SFMono-Regular - 12.0</string>
174+
<key>xcode.syntax.string</key>
175+
<string>SFMono-Regular - 12.0</string>
176+
<key>xcode.syntax.url</key>
177+
<string>SFMono-RegularItalic - 12.0</string>
178+
</dict>
179+
</dict>
180+
</plist>

0 commit comments

Comments
 (0)