Skip to content

Commit 403f8e1

Browse files
committed
Add Xcode theme + install script
0 parents  commit 403f8e1

File tree

3 files changed

+243
-0
lines changed

3 files changed

+243
-0
lines changed

Install.swift

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import Foundation
2+
import Files // marathon:https://github.com/JohnSundell/Files.git
3+
import ShellOut // marathon:https://github.com/JohnSundell/ShellOut.git
4+
5+
let fontsFolder = try Folder.home.subfolder(atPath: "Library/Fonts")
6+
7+
if !fontsFolder.containsFile(named: "SourceCodePro-Regular.ttf") {
8+
print("🅰️ Downloading Source Code Pro font...")
9+
10+
let fontZipURL = URL(string: "https://github.com/adobe-fonts/source-code-pro/archive/2.030R-ro/1.050R-it.zip")!
11+
let fontZipData = try Data(contentsOf: fontZipURL)
12+
13+
print("🅰️ Installing Source Code Pro font...")
14+
15+
let fontZipFile = try fontsFolder.createFile(named: "SourceCodePro.zip", contents: fontZipData)
16+
try shellOut(to: "unzip \(fontZipFile.name) -d SourceCodePro", at: fontsFolder.path)
17+
18+
let sourceCodeProFolder = try fontsFolder.subfolder(named: "SourceCodePro")
19+
let ttfFolder = try sourceCodeProFolder.subfolders.first!.subfolder(named: "TTF")
20+
try ttfFolder.files.move(to: fontsFolder)
21+
22+
try sourceCodeProFolder.delete()
23+
try fontZipFile.delete()
24+
}
25+
26+
print("🎨 Downloading Xcode theme...")
27+
28+
let themeURL = URL(string: "https://raw.githubusercontent.com/JohnSundell/XcodeTheme/master/SundellsColors.xccolortheme")!
29+
let themeData = try Data(contentsOf: themeURL)
30+
31+
print("🎨 Installing Xcode theme...")
32+
33+
let xcodeFolder = try Folder.home.subfolder(atPath: "Library/Developer/Xcode")
34+
let userDataFolder = try xcodeFolder.createSubfolderIfNeeded(withName: "UserData")
35+
let themeFolder = try userDataFolder.createSubfolderIfNeeded(withName: "FontAndColorThemes")
36+
37+
let themeFile = try themeFolder.createFile(named: "SundellsColors.xccolortheme")
38+
try themeFile.write(data: themeData)
39+
40+
print("")
41+
print("🎉 Sundell's Colors successfully installed")
42+
print("👍 Select it in Xcode's preferences to start using it (you may have to restart Xcode first)")

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 John Sundell
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

SundellsColors.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.437649 0.509511 0.517715 1</string>
7+
<key>DVTConsoleDebuggerInputTextFont</key>
8+
<string>SFMono-Regular - 11.0</string>
9+
<key>DVTConsoleDebuggerOutputTextColor</key>
10+
<string>0.437649 0.509511 0.517715 1</string>
11+
<key>DVTConsoleDebuggerOutputTextFont</key>
12+
<string>SFMono-Regular - 11.0</string>
13+
<key>DVTConsoleDebuggerPromptTextColor</key>
14+
<string>0.317071 0.437736 1 1</string>
15+
<key>DVTConsoleDebuggerPromptTextFont</key>
16+
<string>SFMono-Bold - 11.0</string>
17+
<key>DVTConsoleExectuableInputTextColor</key>
18+
<string>0.437649 0.509511 0.517715 1</string>
19+
<key>DVTConsoleExectuableInputTextFont</key>
20+
<string>SFMono-Regular - 11.0</string>
21+
<key>DVTConsoleExectuableOutputTextColor</key>
22+
<string>0.437649 0.509511 0.517715 1</string>
23+
<key>DVTConsoleExectuableOutputTextFont</key>
24+
<string>SFMono-Regular - 11.0</string>
25+
<key>DVTConsoleTextBackgroundColor</key>
26+
<string>0.0980392 0.0980392 0.0980392 1</string>
27+
<key>DVTConsoleTextInsertionPointColor</key>
28+
<string>0.905714 0.905714 0.905714 1</string>
29+
<key>DVTConsoleTextSelectionColor</key>
30+
<string>0.32076 0.406575 0.440224 0.45</string>
31+
<key>DVTDebuggerInstructionPointerColor</key>
32+
<string>0.653506 0.472476 0 1</string>
33+
<key>DVTMarkupTextBackgroundColor</key>
34+
<string>0.170196 0.170196 0.170196 1</string>
35+
<key>DVTMarkupTextBorderColor</key>
36+
<string>0.23658 0.23658 0.23658 1</string>
37+
<key>DVTMarkupTextCodeFont</key>
38+
<string>SFMono-Regular - 12.0</string>
39+
<key>DVTMarkupTextEmphasisColor</key>
40+
<string>0.580743 0.672002 0.672002 1</string>
41+
<key>DVTMarkupTextEmphasisFont</key>
42+
<string>.AppleSystemUIFontItalic - 12.0</string>
43+
<key>DVTMarkupTextInlineCodeColor</key>
44+
<string>0.580743 0.672002 0.672002 0.7</string>
45+
<key>DVTMarkupTextLinkColor</key>
46+
<string>0.32076 0.406575 0.440224 1</string>
47+
<key>DVTMarkupTextLinkFont</key>
48+
<string>.AppleSystemUIFont - 12.0</string>
49+
<key>DVTMarkupTextNormalColor</key>
50+
<string>0.580743 0.672002 0.672002 1</string>
51+
<key>DVTMarkupTextNormalFont</key>
52+
<string>.AppleSystemUIFont - 12.0</string>
53+
<key>DVTMarkupTextOtherHeadingColor</key>
54+
<string>0.580743 0.672002 0.672002 0.5</string>
55+
<key>DVTMarkupTextOtherHeadingFont</key>
56+
<string>.AppleSystemUIFont - 16.8</string>
57+
<key>DVTMarkupTextPrimaryHeadingColor</key>
58+
<string>0.580743 0.672002 0.672002 1</string>
59+
<key>DVTMarkupTextPrimaryHeadingFont</key>
60+
<string>.AppleSystemUIFont - 28.8</string>
61+
<key>DVTMarkupTextSecondaryHeadingColor</key>
62+
<string>0.580743 0.672002 0.672002 1</string>
63+
<key>DVTMarkupTextSecondaryHeadingFont</key>
64+
<string>.AppleSystemUIFont - 21.6</string>
65+
<key>DVTMarkupTextStrongColor</key>
66+
<string>0.580743 0.672002 0.672002 1</string>
67+
<key>DVTMarkupTextStrongFont</key>
68+
<string>.AppleSystemUIFontBold - 12.0</string>
69+
<key>DVTSourceTextBackground</key>
70+
<string>0.0980392 0.0980392 0.0980392 1</string>
71+
<key>DVTSourceTextBlockDimBackgroundColor</key>
72+
<string>0.5 0.5 0.5 1</string>
73+
<key>DVTSourceTextCurrentLineHighlightColor</key>
74+
<string>0.153719 0.175173 0.183585 0.8625</string>
75+
<key>DVTSourceTextInsertionPointColor</key>
76+
<string>0.905714 0.905714 0.905714 1</string>
77+
<key>DVTSourceTextInvisiblesColor</key>
78+
<string>0.653506 0.472476 0 1</string>
79+
<key>DVTSourceTextSelectionColor</key>
80+
<string>0.32076 0.406575 0.440224 0.45</string>
81+
<key>DVTSourceTextSyntaxColors</key>
82+
<dict>
83+
<key>xcode.syntax.attribute</key>
84+
<string>0.653506 0.472476 0 1</string>
85+
<key>xcode.syntax.character</key>
86+
<string>0.845024 0.363792 0.257662 1</string>
87+
<key>xcode.syntax.comment</key>
88+
<string>0.273199 0.356152 0.384519 1</string>
89+
<key>xcode.syntax.comment.doc</key>
90+
<string>0.273199 0.356152 0.384519 1</string>
91+
<key>xcode.syntax.comment.doc.keyword</key>
92+
<string>0.437649 0.509511 0.517715 1</string>
93+
<key>xcode.syntax.identifier.class</key>
94+
<string>0.34798 0.341704 0.727421 1</string>
95+
<key>xcode.syntax.identifier.class.system</key>
96+
<string>0.34798 0.341704 0.727421 1</string>
97+
<key>xcode.syntax.identifier.constant</key>
98+
<string>0.445678 0.546771 0 1</string>
99+
<key>xcode.syntax.identifier.constant.system</key>
100+
<string>0.445678 0.546771 0 1</string>
101+
<key>xcode.syntax.identifier.function</key>
102+
<string>0.100271 0.454959 0.792659 1</string>
103+
<key>xcode.syntax.identifier.function.system</key>
104+
<string>0.100271 0.454959 0.792659 1</string>
105+
<key>xcode.syntax.identifier.macro</key>
106+
<string>0.653506 0.472476 0 1</string>
107+
<key>xcode.syntax.identifier.macro.system</key>
108+
<string>0.653506 0.472476 0 1</string>
109+
<key>xcode.syntax.identifier.type</key>
110+
<string>0.34798 0.341704 0.727421 1</string>
111+
<key>xcode.syntax.identifier.type.system</key>
112+
<string>0.34798 0.341704 0.727421 1</string>
113+
<key>xcode.syntax.identifier.variable</key>
114+
<string>0.109221 0.571582 0.526692 1</string>
115+
<key>xcode.syntax.identifier.variable.system</key>
116+
<string>0.109221 0.571582 0.526692 1</string>
117+
<key>xcode.syntax.keyword</key>
118+
<string>0.793626 0.0956333 0.435336 1</string>
119+
<key>xcode.syntax.number</key>
120+
<string>0.845024 0.363792 0.257662 1</string>
121+
<key>xcode.syntax.plain</key>
122+
<string>0.580743 0.672002 0.672002 1</string>
123+
<key>xcode.syntax.preprocessor</key>
124+
<string>0.653506 0.472476 0 1</string>
125+
<key>xcode.syntax.string</key>
126+
<string>0.75595 0.215588 0.0291611 1</string>
127+
<key>xcode.syntax.url</key>
128+
<string>0.32076 0.406575 0.440224 1</string>
129+
</dict>
130+
<key>DVTSourceTextSyntaxFonts</key>
131+
<dict>
132+
<key>xcode.syntax.attribute</key>
133+
<string>SourceCodePro-Regular - 20.0</string>
134+
<key>xcode.syntax.character</key>
135+
<string>SourceCodePro-Regular - 20.0</string>
136+
<key>xcode.syntax.comment</key>
137+
<string>SourceCodePro-Regular - 20.0</string>
138+
<key>xcode.syntax.comment.doc</key>
139+
<string>SourceCodePro-Regular - 20.0</string>
140+
<key>xcode.syntax.comment.doc.keyword</key>
141+
<string>SourceCodePro-Regular - 20.0</string>
142+
<key>xcode.syntax.identifier.class</key>
143+
<string>SourceCodePro-Regular - 20.0</string>
144+
<key>xcode.syntax.identifier.class.system</key>
145+
<string>SourceCodePro-Regular - 20.0</string>
146+
<key>xcode.syntax.identifier.constant</key>
147+
<string>SourceCodePro-Regular - 20.0</string>
148+
<key>xcode.syntax.identifier.constant.system</key>
149+
<string>SourceCodePro-Regular - 20.0</string>
150+
<key>xcode.syntax.identifier.function</key>
151+
<string>SourceCodePro-Regular - 20.0</string>
152+
<key>xcode.syntax.identifier.function.system</key>
153+
<string>SourceCodePro-Regular - 20.0</string>
154+
<key>xcode.syntax.identifier.macro</key>
155+
<string>SourceCodePro-Regular - 20.0</string>
156+
<key>xcode.syntax.identifier.macro.system</key>
157+
<string>SourceCodePro-Regular - 20.0</string>
158+
<key>xcode.syntax.identifier.type</key>
159+
<string>SourceCodePro-Regular - 20.0</string>
160+
<key>xcode.syntax.identifier.type.system</key>
161+
<string>SourceCodePro-Regular - 20.0</string>
162+
<key>xcode.syntax.identifier.variable</key>
163+
<string>SourceCodePro-Regular - 20.0</string>
164+
<key>xcode.syntax.identifier.variable.system</key>
165+
<string>SourceCodePro-Regular - 20.0</string>
166+
<key>xcode.syntax.keyword</key>
167+
<string>SourceCodePro-Regular - 20.0</string>
168+
<key>xcode.syntax.number</key>
169+
<string>SourceCodePro-Regular - 20.0</string>
170+
<key>xcode.syntax.plain</key>
171+
<string>SourceCodePro-Regular - 20.0</string>
172+
<key>xcode.syntax.preprocessor</key>
173+
<string>SourceCodePro-Regular - 20.0</string>
174+
<key>xcode.syntax.string</key>
175+
<string>SourceCodePro-Regular - 20.0</string>
176+
<key>xcode.syntax.url</key>
177+
<string>SourceCodePro-Regular - 20.0</string>
178+
</dict>
179+
</dict>
180+
</plist>

0 commit comments

Comments
 (0)