diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2393441..7af451d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -4,22 +4,33 @@ on: [push] jobs: - bootstrap_test: - name: Bootstrap --test - runs-on: macos + bootstrap_all_dry_run: + name: Bootstrap --all --dry-run + runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v2.0.0 - name: Test script run: | - make test + make test_dry_run bootstrap_all_verbose: - name: Bootstrap --all -v - runs-on: macos + name: Bootstrap --ci quick + runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v2.0.0 - name: Test script run: | - make test_all + make test_quick + + + bootstrap_test: + name: Bootstrap --ci + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v2.0.0 + - name: Test script + run: | + make test diff --git a/.gitignore b/.gitignore index c0ee892..ff4dd5f 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,21 @@ Temporary Items .zcompcache .zhistory .zsh_history + +### Preferences + +# Sublime Text 3 +Package Control.cache/ +Package Control.merged-ca-bundle +Package Control.system-ca-bundle +Package Control.user-ca-bundle +Package Control.last-run +__pycache__ +*.sublime-workspace +.SublimeREPLHistory +Projects/ +*.sublime-license +oscrypto-ca-bundle.crt + +# Rsync backup directory +_backup diff --git a/Library/Application Support/Sublime Text 3/Packages/User/Package Control.sublime-settings b/Library/Application Support/Sublime Text 3/Packages/User/Package Control.sublime-settings new file mode 100644 index 0000000..17b7bc6 --- /dev/null +++ b/Library/Application Support/Sublime Text 3/Packages/User/Package Control.sublime-settings @@ -0,0 +1,12 @@ +{ + "bootstrapped": true, + "in_process_packages": + [ + ], + "installed_packages": + [ + "EditorConfig", + "Nord", + "Package Control" + ] +} diff --git a/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings b/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings new file mode 100644 index 0000000..9ed2a14 --- /dev/null +++ b/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings @@ -0,0 +1,34 @@ +{ + "color_scheme": "Packages/Nord/Nord.sublime-color-scheme", + "file_exclude_patterns": + [ + "*.pyc", + "*.pyo", + "*.exe", + "*.dll", + "*.obj", + "*.o", + "*.a", + "*.so", + "*.dylib", + "*.ncb", + "*.sdf", + "*.suo", + "*.pdb", + "*.idb", + ".DS_Store", + "*.class", + "*.psd", + "*.db", + "*.sublime-workspace" + ], + "font_size": 11, + "ignored_packages": + [ + "Vintage" + ], + "theme": "Adaptive.sublime-theme", + "trim_trailing_white_space_on_save": true, + // Fold buttons are the triangles shown in the gutter to fold regions of text + "fold_buttons": false, +} diff --git a/Library/Colors/leka-logo.clr b/Library/Colors/leka-logo.clr new file mode 100644 index 0000000..c5e99be Binary files /dev/null and b/Library/Colors/leka-logo.clr differ diff --git a/Library/Colors/typo-gradients.clr b/Library/Colors/typo-gradients.clr new file mode 100644 index 0000000..b447034 Binary files /dev/null and b/Library/Colors/typo-gradients.clr differ diff --git a/Library/Colors/typo-soft.clr b/Library/Colors/typo-soft.clr new file mode 100644 index 0000000..a609617 Binary files /dev/null and b/Library/Colors/typo-soft.clr differ diff --git a/Library/Colors/typo-solid.clr b/Library/Colors/typo-solid.clr new file mode 100644 index 0000000..3e70430 Binary files /dev/null and b/Library/Colors/typo-solid.clr differ diff --git a/Library/Developer/Xcode/UserData/FontAndColorThemes/Customized Dusk.xccolortheme b/Library/Developer/Xcode/UserData/FontAndColorThemes/Customized Dusk.xccolortheme new file mode 100644 index 0000000..bcc2369 --- /dev/null +++ b/Library/Developer/Xcode/UserData/FontAndColorThemes/Customized Dusk.xccolortheme @@ -0,0 +1,198 @@ + + + + + DVTConsoleDebuggerInputTextColor + 1 1 1 1 + DVTConsoleDebuggerInputTextFont + SFMono-Bold - 11.0 + DVTConsoleDebuggerOutputTextColor + 1 1 1 1 + DVTConsoleDebuggerOutputTextFont + SFMono-Regular - 11.0 + DVTConsoleDebuggerPromptTextColor + 0.255 0.714 0.27 1 + DVTConsoleDebuggerPromptTextFont + SFMono-Bold - 11.0 + DVTConsoleExectuableInputTextColor + 1 1 1 1 + DVTConsoleExectuableInputTextFont + SFMono-Regular - 11.0 + DVTConsoleExectuableOutputTextColor + 1 1 1 1 + DVTConsoleExectuableOutputTextFont + SFMono-Bold - 11.0 + DVTConsoleTextBackgroundColor + 0.118 0.125 0.157 1 + DVTConsoleTextInsertionPointColor + 1 1 1 1 + DVTConsoleTextSelectionColor + 0.397 0.397 0.302 1 + DVTDebuggerInstructionPointerColor + 0.12 0.31 0.34 1 + DVTFontSizeModifier + -1 + DVTLineSpacing + 1.1000000238418579 + DVTMarkupTextBackgroundColor + 0.18856 0.195 0.22444 1 + DVTMarkupTextBorderColor + 0.253475 0.2594 0.286485 1 + DVTMarkupTextCodeFont + SFMono-Regular - 10.0 + DVTMarkupTextEmphasisColor + 1 1 1 1 + DVTMarkupTextEmphasisFont + .AppleSystemUIFontItalic - 10.0 + DVTMarkupTextInlineCodeColor + 1 1 1 0.7 + DVTMarkupTextLinkColor + 0.33 0.247124 0.894195 1 + DVTMarkupTextLinkFont + .AppleSystemUIFont - 10.0 + DVTMarkupTextNormalColor + 1 1 1 1 + DVTMarkupTextNormalFont + .AppleSystemUIFont - 10.0 + DVTMarkupTextOtherHeadingColor + 1 1 1 0.5 + DVTMarkupTextOtherHeadingFont + .AppleSystemUIFont - 14.0 + DVTMarkupTextPrimaryHeadingColor + 1 1 1 1 + DVTMarkupTextPrimaryHeadingFont + .AppleSystemUIFont - 24.0 + DVTMarkupTextSecondaryHeadingColor + 1 1 1 1 + DVTMarkupTextSecondaryHeadingFont + .AppleSystemUIFont - 18.0 + DVTMarkupTextStrongColor + 1 1 1 1 + DVTMarkupTextStrongFont + .AppleSystemUIFontBold - 10.0 + DVTScrollbarMarkerAnalyzerColor + 0.403922 0.372549 1 1 + DVTScrollbarMarkerBreakpointColor + 0.290196 0.290196 0.968627 1 + DVTScrollbarMarkerDiffColor + 0.556863 0.556863 0.556863 1 + DVTScrollbarMarkerDiffConflictColor + 0.968627 0.290196 0.290196 1 + DVTScrollbarMarkerErrorColor + 0.968627 0.290196 0.290196 1 + DVTScrollbarMarkerRuntimeIssueColor + 0.643137 0.509804 1 1 + DVTScrollbarMarkerWarningColor + 0.937255 0.717647 0.34902 1 + DVTSourceTextBackground + 0.118 0.125 0.157 1 + DVTSourceTextBlockDimBackgroundColor + 0.5 0.5 0.5 1 + DVTSourceTextCurrentLineHighlightColor + 0.175116 0.175595 0.178208 1 + DVTSourceTextInsertionPointColor + 0.999999 0.999974 0.999991 1 + DVTSourceTextInvisiblesColor + 0.3 0.3 0.3 1 + DVTSourceTextSelectionColor + 0.329921 0.33234 0.289423 1 + DVTSourceTextSyntaxColors + + xcode.syntax.attribute + 0.335 0.456 0.488 1 + xcode.syntax.character + 0.469 0.426 0.77 1 + xcode.syntax.comment + 0.105032 0.451698 0.159253 1 + xcode.syntax.comment.doc + 0.105032 0.451698 0.159253 1 + xcode.syntax.comment.doc.keyword + 0.105032 0.451698 0.159253 1 + xcode.syntax.identifier.class + 0.512 0.754 0.343 1 + xcode.syntax.identifier.class.system + 0 0.626 0.746 1 + xcode.syntax.identifier.constant + 0.512 0.754 0.343 1 + xcode.syntax.identifier.constant.system + 0 0.626 0.746 1 + xcode.syntax.identifier.function + 0.512 0.754 0.343 1 + xcode.syntax.identifier.function.system + 0 0.626 0.746 1 + xcode.syntax.identifier.macro + 0.778 0.488 0.284 1 + xcode.syntax.identifier.macro.system + 0.778 0.488 0.284 1 + xcode.syntax.identifier.type + 0.512 0.754 0.343 1 + xcode.syntax.identifier.type.system + 0 0.626 0.746 1 + xcode.syntax.identifier.variable + 0.512 0.754 0.343 1 + xcode.syntax.identifier.variable.system + 0 0.626 0.746 1 + xcode.syntax.keyword + 0.698 0.095 0.536 1 + xcode.syntax.number + 0.469 0.426 0.77 1 + xcode.syntax.plain + 1 1 1 1 + xcode.syntax.preprocessor + 0.778 0.488 0.284 1 + xcode.syntax.string + 0.859 0.171 0.219 1 + xcode.syntax.url + 0.255 0.333 0.819 1 + + DVTSourceTextSyntaxFonts + + xcode.syntax.attribute + SFMono-Regular - 11.0 + xcode.syntax.character + SFMono-Regular - 11.0 + xcode.syntax.comment + SFMono-Regular - 11.0 + xcode.syntax.comment.doc + SFMono-Regular - 11.0 + xcode.syntax.comment.doc.keyword + SFMono-Bold - 11.0 + xcode.syntax.identifier.class + SFMono-Regular - 11.0 + xcode.syntax.identifier.class.system + SFMono-Regular - 11.0 + xcode.syntax.identifier.constant + SFMono-Regular - 11.0 + xcode.syntax.identifier.constant.system + SFMono-Regular - 11.0 + xcode.syntax.identifier.function + SFMono-Regular - 11.0 + xcode.syntax.identifier.function.system + SFMono-Regular - 11.0 + xcode.syntax.identifier.macro + SFMono-Regular - 11.0 + xcode.syntax.identifier.macro.system + SFMono-Regular - 11.0 + xcode.syntax.identifier.type + SFMono-Regular - 11.0 + xcode.syntax.identifier.type.system + SFMono-Regular - 11.0 + xcode.syntax.identifier.variable + SFMono-Regular - 11.0 + xcode.syntax.identifier.variable.system + SFMono-Regular - 11.0 + xcode.syntax.keyword + SFMono-Regular - 11.0 + xcode.syntax.number + SFMono-Regular - 11.0 + xcode.syntax.plain + SFMono-Regular - 11.0 + xcode.syntax.preprocessor + SFMono-Regular - 11.0 + xcode.syntax.string + SFMono-Regular - 11.0 + xcode.syntax.url + SFMono-Regular - 11.0 + + + diff --git a/Library/Developer/Xcode/UserData/FontAndColorThemes/Dusk.xccolortheme b/Library/Developer/Xcode/UserData/FontAndColorThemes/Dusk.xccolortheme new file mode 100644 index 0000000..7d91282 --- /dev/null +++ b/Library/Developer/Xcode/UserData/FontAndColorThemes/Dusk.xccolortheme @@ -0,0 +1,198 @@ + + + + + DVTConsoleDebuggerInputTextColor + 1 1 1 1 + DVTConsoleDebuggerInputTextFont + SFMono-Bold - 11.0 + DVTConsoleDebuggerOutputTextColor + 1 1 1 1 + DVTConsoleDebuggerOutputTextFont + SFMono-Regular - 11.0 + DVTConsoleDebuggerPromptTextColor + 0.255 0.714 0.27 1 + DVTConsoleDebuggerPromptTextFont + SFMono-Bold - 11.0 + DVTConsoleExectuableInputTextColor + 1 1 1 1 + DVTConsoleExectuableInputTextFont + SFMono-Regular - 11.0 + DVTConsoleExectuableOutputTextColor + 1 1 1 1 + DVTConsoleExectuableOutputTextFont + SFMono-Bold - 11.0 + DVTConsoleTextBackgroundColor + 0.118 0.125 0.157 1 + DVTConsoleTextInsertionPointColor + 1 1 1 1 + DVTConsoleTextSelectionColor + 0.397 0.397 0.302 1 + DVTDebuggerInstructionPointerColor + 0.12 0.31 0.34 1 + DVTFontSizeModifier + -1 + DVTLineSpacing + 1.1000000238418579 + DVTMarkupTextBackgroundColor + 0.18856 0.195 0.22444 1 + DVTMarkupTextBorderColor + 0.253475 0.2594 0.286485 1 + DVTMarkupTextCodeFont + SFMono-Regular - 10.0 + DVTMarkupTextEmphasisColor + 1 1 1 1 + DVTMarkupTextEmphasisFont + .AppleSystemUIFontItalic - 10.0 + DVTMarkupTextInlineCodeColor + 1 1 1 0.7 + DVTMarkupTextLinkColor + 0.33 0.247124 0.894195 1 + DVTMarkupTextLinkFont + .AppleSystemUIFont - 10.0 + DVTMarkupTextNormalColor + 1 1 1 1 + DVTMarkupTextNormalFont + .AppleSystemUIFont - 10.0 + DVTMarkupTextOtherHeadingColor + 1 1 1 0.5 + DVTMarkupTextOtherHeadingFont + .AppleSystemUIFont - 14.0 + DVTMarkupTextPrimaryHeadingColor + 1 1 1 1 + DVTMarkupTextPrimaryHeadingFont + .AppleSystemUIFont - 24.0 + DVTMarkupTextSecondaryHeadingColor + 1 1 1 1 + DVTMarkupTextSecondaryHeadingFont + .AppleSystemUIFont - 18.0 + DVTMarkupTextStrongColor + 1 1 1 1 + DVTMarkupTextStrongFont + .AppleSystemUIFontBold - 10.0 + DVTScrollbarMarkerAnalyzerColor + 0.403922 0.372549 1 1 + DVTScrollbarMarkerBreakpointColor + 0.290196 0.290196 0.968627 1 + DVTScrollbarMarkerDiffColor + 0.556863 0.556863 0.556863 1 + DVTScrollbarMarkerDiffConflictColor + 0.968627 0.290196 0.290196 1 + DVTScrollbarMarkerErrorColor + 0.968627 0.290196 0.290196 1 + DVTScrollbarMarkerRuntimeIssueColor + 0.643137 0.509804 1 1 + DVTScrollbarMarkerWarningColor + 0.937255 0.717647 0.34902 1 + DVTSourceTextBackground + 0.118 0.125 0.157 1 + DVTSourceTextBlockDimBackgroundColor + 0.5 0.5 0.5 1 + DVTSourceTextCurrentLineHighlightColor + 0.175116 0.175595 0.178208 1 + DVTSourceTextInsertionPointColor + 1 1 1 1 + DVTSourceTextInvisiblesColor + 0.3 0.3 0.3 1 + DVTSourceTextSelectionColor + 0.329921 0.33234 0.289423 1 + DVTSourceTextSyntaxColors + + xcode.syntax.attribute + 0.335 0.456 0.488 1 + xcode.syntax.character + 0.469 0.426 0.77 1 + xcode.syntax.comment + 0.255 0.714 0.27 1 + xcode.syntax.comment.doc + 0.255 0.714 0.27 1 + xcode.syntax.comment.doc.keyword + 0.255 0.714 0.27 1 + xcode.syntax.identifier.class + 0.512 0.754 0.343 1 + xcode.syntax.identifier.class.system + 0 0.626 0.746 1 + xcode.syntax.identifier.constant + 0.512 0.754 0.343 1 + xcode.syntax.identifier.constant.system + 0 0.626 0.746 1 + xcode.syntax.identifier.function + 0.512 0.754 0.343 1 + xcode.syntax.identifier.function.system + 0 0.626 0.746 1 + xcode.syntax.identifier.macro + 0.778 0.488 0.284 1 + xcode.syntax.identifier.macro.system + 0.778 0.488 0.284 1 + xcode.syntax.identifier.type + 0.512 0.754 0.343 1 + xcode.syntax.identifier.type.system + 0 0.626 0.746 1 + xcode.syntax.identifier.variable + 0.512 0.754 0.343 1 + xcode.syntax.identifier.variable.system + 0 0.626 0.746 1 + xcode.syntax.keyword + 0.698 0.095 0.536 1 + xcode.syntax.number + 0.469 0.426 0.77 1 + xcode.syntax.plain + 1 1 1 1 + xcode.syntax.preprocessor + 0.778 0.488 0.284 1 + xcode.syntax.string + 0.859 0.171 0.219 1 + xcode.syntax.url + 0.255 0.333 0.819 1 + + DVTSourceTextSyntaxFonts + + xcode.syntax.attribute + SFMono-Regular - 11.0 + xcode.syntax.character + SFMono-Regular - 11.0 + xcode.syntax.comment + SFMono-Regular - 11.0 + xcode.syntax.comment.doc + SFMono-Regular - 11.0 + xcode.syntax.comment.doc.keyword + SFMono-Bold - 11.0 + xcode.syntax.identifier.class + SFMono-Regular - 11.0 + xcode.syntax.identifier.class.system + SFMono-Regular - 11.0 + xcode.syntax.identifier.constant + SFMono-Regular - 11.0 + xcode.syntax.identifier.constant.system + SFMono-Regular - 11.0 + xcode.syntax.identifier.function + SFMono-Regular - 11.0 + xcode.syntax.identifier.function.system + SFMono-Regular - 11.0 + xcode.syntax.identifier.macro + SFMono-Regular - 11.0 + xcode.syntax.identifier.macro.system + SFMono-Regular - 11.0 + xcode.syntax.identifier.type + SFMono-Regular - 11.0 + xcode.syntax.identifier.type.system + SFMono-Regular - 11.0 + xcode.syntax.identifier.variable + SFMono-Regular - 11.0 + xcode.syntax.identifier.variable.system + SFMono-Regular - 11.0 + xcode.syntax.keyword + SFMono-Regular - 11.0 + xcode.syntax.number + SFMono-Regular - 11.0 + xcode.syntax.plain + SFMono-Regular - 11.0 + xcode.syntax.preprocessor + SFMono-Regular - 11.0 + xcode.syntax.string + SFMono-Regular - 11.0 + xcode.syntax.url + SFMono-Regular - 11.0 + + + diff --git a/Library/Developer/Xcode/UserData/KeyBindings/Default.idekeybindings b/Library/Developer/Xcode/UserData/KeyBindings/Default.idekeybindings new file mode 100644 index 0000000..0c67376 --- /dev/null +++ b/Library/Developer/Xcode/UserData/KeyBindings/Default.idekeybindings @@ -0,0 +1,5 @@ + + + + + diff --git a/Library/Preferences/CoolTerm_Prefs.plist b/Library/Preferences/CoolTerm_Prefs.plist new file mode 100644 index 0000000..7f0ea49 --- /dev/null +++ b/Library/Preferences/CoolTerm_Prefs.plist @@ -0,0 +1,122 @@ + + + + + ExecutableFile + + /Applications/CoolTerm.app/Contents/MacOS/CoolTerm + + Pref_Version + + 1.6.0.3.1.708 + + Pref_WinHelp_Left + + -1 + + Pref_WinHelp_Top + + -1 + + Pref_WinHelp_Width + + -1 + + Pref_WinHelp_Heigth + + -1 + + Font + + Monaco + + FontSize + + 13 + + InputFontSize + + 13 + + CondenseLines + + False + + TextColor + + &h00000000 + + BackgroundColor + + &h00FFFFFF + + HexFont + + Monaco + + HexFontSize + + 13 + + Pref_DateTimeFormat + + 0 + + DisableShortCuts + + False + + ShowToolbar + + True + + Pref_AutoRefreshSerialPorts + + False + + Pref_RestoreLastSession + + False + + Pref_UpdateCheck + + True + + Pref_UpdateCheckBeta + + True + + Pref_UseProxy + + False + + Pref_ProxyIP + + + + Pref_ProxyPort + + 8080 + + Pref_UseProxyAuthentication + + False + + Pref_ProxyUsername + + + + Pref_ProxyPassword + + + + UserEmail + + + + SkipPortEnumeration + + False + + + diff --git a/Library/Preferences/com.apple.dt.Xcode.plist b/Library/Preferences/com.apple.dt.Xcode.plist new file mode 100644 index 0000000..875604b Binary files /dev/null and b/Library/Preferences/com.apple.dt.Xcode.plist differ diff --git a/Library/Preferences/com.apple.symbolichotkeys.plist b/Library/Preferences/com.apple.symbolichotkeys.plist new file mode 100644 index 0000000..bccd854 Binary files /dev/null and b/Library/Preferences/com.apple.symbolichotkeys.plist differ diff --git a/Library/Preferences/com.googlecode.iterm2.plist b/Library/Preferences/com.googlecode.iterm2.plist new file mode 100644 index 0000000..510e4f8 Binary files /dev/null and b/Library/Preferences/com.googlecode.iterm2.plist differ diff --git a/Library/Preferences/com.knollsoft.Rectangle.plist b/Library/Preferences/com.knollsoft.Rectangle.plist new file mode 100644 index 0000000..4c9f0d8 Binary files /dev/null and b/Library/Preferences/com.knollsoft.Rectangle.plist differ diff --git a/Library/Preferences/com.uranusjr.macdown.plist b/Library/Preferences/com.uranusjr.macdown.plist new file mode 100644 index 0000000..05577d4 Binary files /dev/null and b/Library/Preferences/com.uranusjr.macdown.plist differ diff --git a/Library/Preferences/net.freemacsoft.AppCleaner-SmartDelete.plist b/Library/Preferences/net.freemacsoft.AppCleaner-SmartDelete.plist new file mode 100644 index 0000000..edb0ba3 Binary files /dev/null and b/Library/Preferences/net.freemacsoft.AppCleaner-SmartDelete.plist differ diff --git a/Library/Preferences/net.freemacsoft.AppCleaner.plist b/Library/Preferences/net.freemacsoft.AppCleaner.plist new file mode 100644 index 0000000..0f3c7f4 Binary files /dev/null and b/Library/Preferences/net.freemacsoft.AppCleaner.plist differ diff --git a/Library/Preferences/org.m0k.transmission.plist b/Library/Preferences/org.m0k.transmission.plist new file mode 100644 index 0000000..c951018 Binary files /dev/null and b/Library/Preferences/org.m0k.transmission.plist differ diff --git a/Library/Services/Convert to JPEG.workflow/Contents/Info.plist b/Library/Services/Convert to JPEG.workflow/Contents/Info.plist new file mode 100644 index 0000000..729d408 --- /dev/null +++ b/Library/Services/Convert to JPEG.workflow/Contents/Info.plist @@ -0,0 +1,26 @@ + + + + + NSServices + + + NSBackgroundColorName + background + NSIconName + NSTouchBarDocuments + NSMenuItem + + default + Convert to JPEG + + NSMessage + runWorkflowAsService + NSSendFileTypes + + public.item + + + + + diff --git a/Library/Services/Convert to JPEG.workflow/Contents/QuickLook/Thumbnail.png b/Library/Services/Convert to JPEG.workflow/Contents/QuickLook/Thumbnail.png new file mode 100644 index 0000000..21a754a Binary files /dev/null and b/Library/Services/Convert to JPEG.workflow/Contents/QuickLook/Thumbnail.png differ diff --git a/Library/Services/Convert to JPEG.workflow/Contents/document.wflow b/Library/Services/Convert to JPEG.workflow/Contents/document.wflow new file mode 100644 index 0000000..11ce140 --- /dev/null +++ b/Library/Services/Convert to JPEG.workflow/Contents/document.wflow @@ -0,0 +1,273 @@ + + + + + AMApplicationBuild + 492 + AMApplicationVersion + 2.10 + AMDocumentVersion + 2 + actions + + + action + + AMAccepts + + Container + List + Optional + + Types + + com.apple.cocoa.path + + + AMActionVersion + 2.0.1 + AMApplication + + Finder + + AMParameterProperties + + replaceExisting + + toDirectory + + isPathPopUp + + variableUUIDsInMenu + + + + AMProvides + + Container + List + Types + + com.apple.cocoa.path + + + ActionBundlePath + /System/Library/Automator/Copy Finder Items.action + ActionName + Copy Finder Items + ActionParameters + + replaceExisting + + toDirectory + ~/Desktop/_2_jpg + + BundleIdentifier + com.apple.Automator.CopyFiles + CFBundleVersion + 2.0.1 + CanShowSelectedItemsWhenRun + + CanShowWhenRun + + Category + + AMCategoryFilesAndFolders + + Class Name + AMCopyFilesAction + InputUUID + 8EC1CEE6-5CCF-43D3-AE1E-BF5FB395ABAB + Keywords + + File + Copy + + OutputUUID + 3C5349D2-4B07-44A0-9795-1F0DCCF3CF8D + UUID + AC6BC769-F818-4515-8ED8-DF7E5B66918C + UnlocalizedApplications + + Finder + + arguments + + 0 + + default value + ~/Desktop + name + toDirectory + required + 0 + type + 0 + uuid + 0 + + 1 + + default value + + name + replaceExisting + required + 0 + type + 0 + uuid + 1 + + + isViewVisible + + location + 705.000000:225.000000 + nibPath + /System/Library/Automator/Copy Finder Items.action/Contents/Resources/Base.lproj/main.nib + + isViewVisible + + + + action + + AMAccepts + + Container + List + Optional + + Types + + public.image + + + AMActionVersion + 1.1.1 + AMApplication + + Preview + + AMParameterProperties + + imageType + + + AMProvides + + Container + List + Types + + public.image + + + ActionBundlePath + /System/Library/Automator/Change Type of Images.action + ActionName + Change Type of Images + ActionParameters + + imageType + JPEG + + BundleIdentifier + com.apple.Automator.ChangeImageType + CFBundleVersion + 1.1.1 + CanShowSelectedItemsWhenRun + + CanShowWhenRun + + Category + + AMCategoryPhotos + + Class Name + AMChangeImageTypeAction + InputUUID + F5832FA8-8A17-4190-B8F6-024B4D766A41 + Keywords + + Image + Photo + Change + Convert + Set + + OutputUUID + E2C47407-FA1D-43EE-B2A9-F5BECCDEFDA8 + UUID + BB871510-F3F7-42DD-A5A1-8D057CC1FFDE + UnlocalizedApplications + + Preview + + arguments + + 0 + + default value + TIFF + name + imageType + required + 0 + type + 0 + uuid + 0 + + + isViewVisible + + location + 705.000000:328.000000 + nibPath + /System/Library/Automator/Change Type of Images.action/Contents/Resources/Base.lproj/main.nib + + isViewVisible + + + + connectors + + 2B8AA826-9DA7-4FCD-BAE3-B542BFBA7ECC + + from + AC6BC769-F818-4515-8ED8-DF7E5B66918C - AC6BC769-F818-4515-8ED8-DF7E5B66918C + to + BB871510-F3F7-42DD-A5A1-8D057CC1FFDE - BB871510-F3F7-42DD-A5A1-8D057CC1FFDE + + + workflowMetaData + + applicationBundleIDsByPath + + applicationPaths + + inputTypeIdentifier + com.apple.Automator.fileSystemObject + outputTypeIdentifier + com.apple.Automator.nothing + presentationMode + 15 + processesInput + 0 + serviceInputTypeIdentifier + com.apple.Automator.fileSystemObject + serviceOutputTypeIdentifier + com.apple.Automator.nothing + serviceProcessesInput + 0 + systemImageName + NSTouchBarDocuments + useAutomaticInputType + 1 + workflowTypeIdentifier + com.apple.Automator.servicesMenu + + + diff --git a/Library/Spelling/LocalDictionary b/Library/Spelling/LocalDictionary new file mode 100644 index 0000000..9d02d49 --- /dev/null +++ b/Library/Spelling/LocalDictionary @@ -0,0 +1,5 @@ +bootloader +Connectique +haptique +LekaOS +microcontrôleur diff --git a/Makefile b/Makefile index 5d671bd..f98110c 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,11 @@ all: zsh ./bootstrap.sh --all test: - zsh ./bootstrap.sh --test + zsh ./bootstrap.sh -v --ci -test_all: - zsh ./bootstrap.sh -v --all --force \ No newline at end of file +test_quick: + zsh ./bootstrap.sh -v --hello --zsh --git --symlink --nvim --data --macos + + +test_dry_run: + zsh ./bootstrap.sh -v --dry-run --all --force --ci diff --git a/README.md b/README.md index 10cbe44..9fd49a9 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ I try to keep `$HOME` as clean as possible by using [XDG Base Directory Specific ## Install & Use +Make sure you have Xcode installed first. + Clone the repo where you want, I usually do the following: ```console @@ -19,6 +21,12 @@ $ git clone https://github.com/ladislas/dotfiles $ cd dotfiles ``` +or run the following: + +```console +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ladislas/dotfiles/master/install.sh)" +``` + Then run the bootstrap process: ```console @@ -29,12 +37,28 @@ Available arguments are: - `--all` - run all scripts - `--force` - used with `--all` skip the "Are you sure you want to continue" question -- `--test` - for CI +- `--ci` - for CI - `--verbose` or `-v` - print `stderr` message of failed commands - `-vv` - print `stdout` & `stderr` messages The rest is detailed here: -`--macos` `--brew` `--zsh` `--git` `--symlink` `--nvim` `--dev` `--data` `--gem-pip` +`--hello` `--brew` `--apps-install` `--apps-config` `--zsh` `--git` `--symlink` `--nvim` `--dev` `--data` `--macos` + +> https://github.com/ladislas/dotfiles/blob/master/bootstrap.sh + +## Brew cask + +I've removed some of the heavy casks from the script as they were taking way too much time... + +To instatll them, run the following: + +```bash +brew cask install mactex-no-gui +``` + +## Apps Settings + +Apps must be launched first before syncronizing the settings. The script takes care of that but sometimes it might take a little longer or you might need to accept a dialog box. -> https://github.com/ladislas/dotfiles/blob/master/bootstrap.sh#L123 +For VSCode, use [Settings Sync](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync). diff --git a/bootstrap.sh b/bootstrap.sh index 118cf41..6b654f2 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -4,68 +4,93 @@ # Source helper functions # -source ./scripts/helpers.sh +trap "exit 1" INT + +typeset -x DOTFILES_DIR=$(pwd) +typeset -Ux FAILED_COMMANDS=() +typeset -x ARG_ARRAY=() + +# create tmp file & schedule delete if error +typeset -x TEMP_FILE=$(mktemp) +trap "rm -f $TEMP_FILE" 0 2 3 15 + +source $DOTFILES_DIR/scripts/helpers/include.sh + +function try { + . $DOTFILES_DIR'/scripts/helpers/try.sh' $@ +} # -# Set output level (verbose / super_verbose) +# Set output level (verbose / super verbose) # -if [[ "$1" =~ "-vv" ]]; then - alias try='try -vv' - shift -elif [[ "$1" =~ "-v" || "$1" =~ "--verbose" ]]; then - alias try='try -v' - shift +if [[ "$@" =~ "-vv" ]]; then + alias try="try -vv" +elif [[ "$@" =~ "-v" || "$@" =~ "--verbose" ]]; then + alias try="try -v" fi # # Set arguments # -arg_array=($@) -main_commands=("--all" "--force" "--test") -script_commands=("--hello" "--macos" "--brew" "--zsh" "--git" "--symlink" "--nvim" "--dev" "--data" "--gem-pip") + main_commands=( "-v" "-vv" "--verbose" "--all" "--force" "--ci" "--dry-run") + ci_commands=( "--hello" "--zsh" "--git" "--symlink" "--nvim" "--data" "--macos" "--brew" "--apps-install" "--apps-config" ) +script_commands=( "--hello" "--zsh" "--git" "--symlink" "--nvim" "--data" "--macos" "--brew" "--apps-install" "--apps-config" "--dev") + + +ARG_ARRAY=($@) available_args=( ${main_commands[*]} ${script_commands[*]} ) -test_commands=("--macos" "--zsh" "--git" "--symlink" "--nvim" "--dev" "--data") # # Check that arguments have been passed, if not exit # -if [ ${#arg_array[@]} -eq 0 ]; then - echo "⚠️ No arguments have been passed." +if [ ${#ARG_ARRAY[@]} -eq 0 ]; then + echo "💥 No arguments have been passed." echo "Please try again with one of those: $available_args" - return 1 + exit 1 fi # # Check that passed arguments are available, if not exit # -for arg in $arg_array; do +for arg in $ARG_ARRAY; do if [[ ! " ${available_args[@]} " =~ " ${arg} " ]]; then echo "💥 Unrecognized argument: $arg" echo "Please try again with one of those: $available_args" - return 1 + exit 1 fi done # -# Check for brew & coreutils, if not install +# Arg: --dry-run # -if [[ $(command -v brew) == "" ]]; then - echo "👷 Installing brew & coreutils 🚧" - try /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - try brew install coreutils -elif [[ $(command -v gls) == "" ]]; then - echo "👷 Installing coreutils 🚧" - try brew install coreutils +if is_dry_run ; then + echo "" + echo "🏃 Running bootstrap as dry run. Nothing will be installed or modified... 🛡️" + typeset -x DRY_RUN=1 fi -if [ ! $? -eq 0 ]; then - echo "💥 Could not install brew & coreutils, exiting with status code $?" - exit 1 +# +# Check for brew & coreutils, if not install +# + +if ! is_dry_run ; then + if [[ $(command -v brew) == "" ]]; then + print_section "Installing brew & coreutils" + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + brew install coreutils + elif [[ $(command -v gls) == "" ]]; then + print_section "Installing coreutils" + brew install coreutils + fi + if [ ! $? -eq 0 ]; then + echo "💥 Could not install brew & coreutils, exiting with status code $?" + exit 1 + fi fi export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" @@ -74,39 +99,61 @@ export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" # Arg: --all # -if [[ $arg_array =~ "--all" ]]; then - if [[ ! $arg_array =~ "--force" ]]; then - echo "⚠️ You are about to run all the scripts. Please confirm that you have read\nthe source files and are okay with that. Unexepected behaviors can occur!" - read "?Are you sure you want to continue? " - if [[ ! $REPLY =~ ^[Yy]$ ]] - then - [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 +if args_contain "--all" ; then + if ! args_contain "--force" ; then + echo "" + echo "🔥 🔥 🔥" + echo "You are about to run all the scripts. This it NOT recommended" + echo "unless you know what you are doing! Unexepected behaviors can occur!" + echo "🔥 🔥 🔥" + echo "" + echo "Please confirm that you have read the source files and are okay with that." + printf "👀 Are you sure you want to continue? (y/n) " + read + if [[ ! $REPLY =~ ^[Yy]$ ]] ; then + echo "" + echo "Goodbye, come again!..." + exit 0 fi fi - echo "\n⚠️ Running bootstrap with all args!" - arg_array=($script_commands) + if args_contain "--ci" ; then + typeset -x CI_TEST=1 + fi + + echo "" + echo "⚠️ Running bootstrap with all args! ⚠️" + echo "\t$script_commands" + ARG_ARRAY=($script_commands) fi # -# Arg: --test +# Arg: --ci # -if [[ $arg_array =~ "--test" ]]; then - echo "\n⚠️ Running bootstrap with all args except for testing!" - arg_array=($test_commands) - typeset -Ux CI_TEST=1 +if args_contain "--ci" ; then + echo "" + echo "🔬 Running bootstrap for testing with the following args: 🧪" + echo "\t$ci_commands" + ARG_ARRAY=($ci_commands) + typeset -x CI_TEST=1 fi # # Sudo power # -if [[ $arg_array =~ "--macos" || $arg_array =~ "--brew" ]]; then +if args_contain "--macos" || args_contain "--brew" ; then if ! sudo -n true 2>/dev/null; then - echo "⚠️ Args --macos & --brew require sudo to run." + echo "" + echo "🔐 Args --macos & --brew require sudo to run. 🔐" echo "Please enter your password." sudo -v + if [ ! $? -eq 0 ]; then + echo "" + echo "Goodbye, come again!..." + exit 0 + fi fi fi @@ -114,78 +161,96 @@ fi # Arg: --hello # -if [[ $arg_array =~ "--hello" ]]; then - echo "Hello, World!" +if args_contain "--hello" ; then + print_section "Starting Hello, World! script" + echo "" + echo "› Make sure we're good to go" + try echo "Hello, World!" + try sleep 3 + try echo "Let's get moving!" fi # # Arg: --brew # -if [[ $arg_array =~ "--brew" ]]; then - echo "\n👷 Running brew configuration script 🚧\n" - source ./scripts/brew.sh +if args_contain "--brew" ; then + print_section "Starting brew configuration script" + source $DOTFILES_DIR/scripts/brew.sh fi # -# Arg: --macos +# Arg: --apps-install # -if [[ $arg_array =~ "--macos" ]]; then - echo "\n👷 Running macOS configuration script 🚧\n" - - echo "Opening apps before configuring" - for app in "Visual Studio Code" "Sublime Text" "iTerm" \ - "Transmission" "Fantastical 2" "Rectangle" ; do - try open -a "$app" - done +if args_contain "--apps-install" ; then + print_section "Starting applications installation script" + source $DOTFILES_DIR/scripts/apps.sh +fi - echo "" +# +# Arg: --apps-config +# - source ./scripts/macos.sh +if args_contain "--apps-config" ; then + print_section "Starting applications configuration script" + source $DOTFILES_DIR/scripts/apps_config.sh fi # # Arg: --zsh # -if [[ $arg_array =~ "--zsh" ]]; then - echo "\n👷 Running zsh configuration script 🚧\n" +if args_contain "--zsh" ; then + print_section "Starting zsh configuration script" # Switch to using brew-installed zsh as default shell - if ! fgrep -q "${BREW_PREFIX}/bin/zsh" /etc/shells; then + if ! fgrep -q "${BREW_PREFIX}/bin/zsh" /etc/shells ; then echo "" - echo "Setting brew zsh as default shell" + echo "› Setting brew zsh as default shell" try echo "${BREW_PREFIX}/bin/zsh" | sudo tee -a /etc/shells; try chsh -s "${BREW_PREFIX}/bin/zsh"; fi; + echo "" + echo "› Clean up zcompdump" try rm -f ~/.zcompdump - try rm -f ./zsh/.zcompdump - try rm -f ./zsh/.zcompdump.zwc + try rm -f $DOTFILES_DIR/zsh/.zcompdump + try rm -f $DOTFILES_DIR/zsh/.zcompdump.zwc - try chmod go-w '/usr/local/share' + echo "" + echo "› chmod /usr/local/share for completion" + try chmod go-w "/usr/local/share" - try ln -sr ./symlink/.zshenv $HOME/.zshenv + echo "" + echo "› Symlink config files" try mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config} - try ln -sr ./zsh ${XDG_CONFIG_HOME:-$HOME/.config}/ + try ln -sr $DOTFILES_DIR/symlink/.zshenv $HOME/.zshenv + try ln -sr $DOTFILES_DIR/zsh ${XDG_CONFIG_HOME:-$HOME/.config}/ fi # # Arg: --git # -if [[ $arg_array =~ "--git" ]]; then - echo "\n👷 Running git configuration script 🚧\n" - try ln -sr ./git ${XDG_CONFIG_HOME:-$HOME/.config}/ +if args_contain "--git" ; then + print_section "Starting git configuration script" + + echo "" + echo "› Symlink config files" + try mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config} + try ln -sr $DOTFILES_DIR/git ${XDG_CONFIG_HOME:-$HOME/.config}/ fi # # Arg: --neovim # -if [[ $arg_array =~ "--nvim" ]]; then - echo "\n👷 Running neovim configuration script 🚧\n" +if args_contain "--nvim" ; then + print_section "Starting neovim configuration script" + + echo "" + echo "› Git clone neovim config" try git clone --recursive https://github.com/ladislas/nvim ~/.config/nvim fi @@ -193,34 +258,36 @@ fi # Arg: --data # -if [[ $arg_array =~ "--data" ]]; then - echo "\n👷 Running XGD Data configuration script 🚧\n" +if args_contain "--data" ; then + print_section "Starting XDG Data configuration script" + + echo "" + echo "› Symlink config files" try mkdir -p ${XDG_DATA_HOME:-$HOME/.local/share} - try ln -sr ./data/* ${XDG_DATA_HOME:-$HOME/.local/share} + try ln -sr $DOTFILES_DIR/data/* ${XDG_DATA_HOME:-$HOME/.local/share} fi # # Arg: --dev # -if [[ $arg_array =~ "--dev" ]]; then - echo "\n👷 Running dev directory structure configuration script 🚧\n" - try mkdir -p $HOME/dev/{ladislas,leka,osx-cross,tmp} +if args_contain "--dev" ; then + print_section "Starting personnal dev configuration script" + source $DOTFILES_DIR/scripts/dev.sh fi # -# Arg: --gem-pip +# Arg: --macos # -if [[ $arg_array =~ "--gem-pip" ]]; then - echo "\n👷 Installing useful gems, pip & node packages 🚧\n" - try gem install --no-document cocoapods fastlane neovim - try pip install -U --user mbed-cli pyserial neovim - try npm install -g neovim +if args_contain "--macos" ; then + print_section "Starting macOS configuration script" + source $DOTFILES_DIR/scripts/macos.sh fi # -# List failed commands +# List failed commands & delete TEMP_FILE # list_failed_commands +rm -rf $TEMP_FILE diff --git a/git/config b/git/config index 7efbe2a..70865c6 100644 --- a/git/config +++ b/git/config @@ -205,3 +205,8 @@ [diff-so-fancy] stripLeadingSymbols = false +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..939bd3f --- /dev/null +++ b/install.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env zsh + +mkdir -p $HOME/dev/ladislas +cd $HOME/dev/ladislas +git clone https://github.com/ladislas/dotfiles +cd $HOME/dev/ladislas diff --git a/scripts/apps.sh b/scripts/apps.sh new file mode 100644 index 0000000..a4f7772 --- /dev/null +++ b/scripts/apps.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env zsh + +# Continue on error +set +e +if [[ ! -n $CI_TEST ]]; then + echo "" + echo "› Update brew" + try brew update + try brew upgrade +fi + + +# List already available casks +available_casks=$(brew cask list) + +typeset -U casks +casks=( + 1password + adoptopenjdk + aerial + alfred + appcleaner + arduino + brave-browser + coolterm + dropbox + fantastical + glance + google-chrome + gpg-suite-no-mail + iterm2 + macdown + rectangle + slack + spotify + sublime-text + transmission + visual-studio-code + vlc + whatsapp +) + +echo "" +echo "› Install casks" +for cask in $casks; do + if [[ ! $available_casks =~ $cask ]]; then + try brew cask install $cask + fi +done + +if [[ ! -n $CI_TEST ]]; then + echo "" + echo "› Cleanup brew & remove cache" + try brew cleanup -s + try rm -rf "$(brew --cache)" +fi diff --git a/scripts/apps_config.sh b/scripts/apps_config.sh new file mode 100644 index 0000000..984ed52 --- /dev/null +++ b/scripts/apps_config.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env zsh + +# Continue on error +set +e + +typeset -U user_apps + +user_apps=( + "AppCleaner" + "CoolTerm" + "Fantastical" + "iTerm" + "MacDown" + "Rectangle" + "Sublime Text" + "Transmission" + "Visual Studio Code" + "Xcode" +) + +echo "" +echo "› Open applications before configuration" +for app in $user_apps; do + if ls /Applications | grep "$app" &> /dev/null ; then + try open -a "$app" + fi +done + +echo "" +echo "› Wait for apps to launch" +try sleep 3 + +echo "" +echo "› Kill applications before copying preferences" +for app in $user_apps; do + if ls /Applications | grep "$app" &> /dev/null ; then + if [[ $app =~ "iTerm" ]] ; then + try killall iTerm2 + elif [[ $app =~ "Visual Studio Code" ]] ; then + try osascript -e 'quit app "Visual Studio Code"' + else + try killall "${app}" + fi + fi +done + +# Set path variables for all the preferences/settings +user_library_path="$HOME/Library" +dotf_library_path="$DOTFILES_DIR/Library" +rsync_backup_path="$DOTFILES_DIR/Library/_backup" + +user_preferences_path="$user_library_path/Preferences" +dotf_preferences_path="$dotf_library_path/Preferences" + +user_colors_path="$user_library_path/Colors" +dotf_colors_path="$dotf_library_path/Colors" + +user_services_path="$user_library_path/Services" +dotf_services_path="$dotf_library_path/Services" + +user_spelling_path="$user_library_path/Spelling" +dotf_spelling_path="$dotf_library_path/Spelling" + +user_xcode_userdata_path="$user_library_path/Developer/Xcode/UserData" +dotf_xcode_userdata_path="$dotf_library_path/Developer/Xcode/UserData" + +user_sublimetext_settings_path="$user_library_path/Application Support/Sublime Text 3" +dotf_sublimetext_settings_path="$dotf_library_path/Application Support/Sublime Text 3" + +echo "" +echo "› Rsync .plist to $user_preferences_path" +try mkdir -p $user_preferences_path +try rsync -av --backup --backup-dir="$rsync_backup_path/Preferences" $dotf_preferences_path/ $user_preferences_path + +echo "" +echo "› Rsync Colors to $user_colors_path" +try mkdir -p $user_colors_path +try rsync -av --backup --backup-dir="$rsync_backup_path/Colors" $dotf_colors_path/ $user_colors_path + +echo "" +echo "› Rsync Services to $user_colors_path" +try mkdir -p $user_services_path +try rsync -av --backup --backup-dir="$rsync_backup_path/Services" $dotf_services_path/ $user_services_path + +echo "" +echo "› Rsync dictionary to $user_spelling_path" +try mkdir -p $user_spelling_path +try rsync -av --backup --backup-dir="$rsync_backup_path/Spelling" $dotf_spelling_path/ $user_spelling_path + +echo "" +echo "› Rsync Xcode settings to $user_xcode_userdata_path" +try mkdir -p $user_xcode_userdata_path +try rsync -av --backup --backup-dir="$rsync_backup_path/Xcode" $dotf_xcode_userdata_path/ $user_xcode_userdata_path + +echo "" +echo "› Rsync Sublime Text settings to $user_sublimetext_settings_path" +try mkdir -p $user_sublimetext_settings_path +try rsync -av --backup --backup-dir="$rsync_backup_path/ST3" $dotf_sublimetext_settings_path/ $user_sublimetext_settings_path diff --git a/scripts/brew.sh b/scripts/brew.sh index 7f429ee..7d01e02 100644 --- a/scripts/brew.sh +++ b/scripts/brew.sh @@ -3,34 +3,32 @@ # Continue on error set +e -# Install command-line tools using Homebrew. - -# Make sure we’re using the latest Homebrew. -try brew update - -# Upgrade any already-installed formulae. -try brew upgrade - -# List already available formulae & casks +if [[ ! -n $CI_TEST ]]; then + echo "" + echo "› Update brew" + try brew update + try brew upgrade +fi + +# List already available formulae available_formulae=$(brew list) -available_casks=$(brew cask list) typeset -U formulae formulae=( - # Install GNU core utilities (those that come with macOS are outdated). - # Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`. + # Install GNU core utilities (those that come with macOS are outdated) + # Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH` coreutils - # Install some other useful utilities like `sponge`. - moreutils - # Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed. + # Install some other useful utilities like `sponge` + # moreutils + # Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed findutils # Install macOS utils osxutils - # Install a modern version of Bash. + # Install a modern version of Bash bash - # Install a modern version of Zsh. + # Install a modern version of Zsh zsh zsh-completion zsh-autosuggestions @@ -40,28 +38,25 @@ formulae=( # Brew brew-cask-completion - # Install git & co. - git + # Install git & co hub + git git-lfs - mercurial + github/gh/gh git-flow-avh diff-so-fancy + mercurial # Install wget & curl wget curl - # Install GnuPG to enable PGP-signing commits. - # gnupg - # pinentry - # Install scripting languagues node ruby python - # Install more recent versions of some macOS tools. + # Install more recent versions of some macOS tools vim grep make @@ -69,76 +64,37 @@ formulae=( screen openssh - # Install other useful binaries. + # Install useful tools ack mint tree - # mackup neovim pandoc rename - stlink - swiftlint imagemagick youtube-dl the_silver_searcher + + # Install dev tools + avrdude + stlink + open-ocd + swiftlint + clang-format + cppcheck ) -# Install formulae +echo "" +echo "› Install formulae" for formula in $formulae ; do if [[ ! $available_formulae =~ $formula ]]; then try brew install $formula fi done -typeset -U casks -casks=( - 1password - alfred - appcleaner - arduino - brave-browser - coolterm - dropbox - fantastical - # font-source-code-pro - google-chrome - gpg-suite-no-mail - iterm2 - macdown - # mactex-no-gui - qlcolorcode - qlimagesize - qlmarkdown - qlprettypatch - qlstephen - quicklook-csv - quicklook-json - rectangle - slack - spotify - sublime-text - transmission - # the-unarchiver - visual-studio-code - vlc - whatsapp -) - -# Install casks -for cask in $casks; do - if [[ ! $available_casks =~ $cask ]]; then - try brew cask install $cask - fi -done - -# Install useful taps -# try brew tap osx-cross/arm -# try brew install arm-gcc-bin -# try brew tap osx-cross/avr -# try brew install avr-gcc -# try brew install avrdude - -# Remove outdated versions from the cellar. -try brew cleanup -s -try rm -rf "$(brew --cache)" +if [[ ! -n $CI_TEST ]]; then + echo "" + echo "› Cleanup brew & remove cache" + try brew cleanup -s + try rm -rf "$(brew --cache)" +fi diff --git a/scripts/dev.sh b/scripts/dev.sh new file mode 100644 index 0000000..1501d14 --- /dev/null +++ b/scripts/dev.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env zsh + +echo "" +echo "› Symlink to $HOME" +symlink=".editorconfig" +try ln -sr ./symlink/$symlink $HOME/$symlink + + +echo "" +echo "› Create dev directory tree" +try mkdir -p $HOME/dev/{ladislas,leka,osx-cross,tmp} + + +echo "" +echo "› Clone personal repositories" +cd $HOME/dev/ladislas +try git clone --recursive https://github.com/ladislas/Bare-Arduino-Project +try git clone --recursive https://github.com/ladislas/Bare-mbed-Project +try git clone https://github.com/ladislas/explorations + + +echo "" +echo "› Clone Leka repositories" +cd $HOME/dev/leka +try git clone --recursive https://github.com/leka/Arduino-Makefile +try git clone --recursive https://github.com/leka/leka-app +try git clone --recursive https://github.com/leka/LKAlphaOS +try git clone --recursive https://github.com/leka/LekaOS + +try git clone https://github.com/leka/LekaOS.wiki.git +try git clone https://github.com/leka/LekaOS_Explorations +try git clone https://github.com/leka/styleguides + + +echo "" +echo "› Clone osx-cross repositories" +cd $HOME/dev/osx-cross +try git clone https://github.com/osx-cross/homebrew-avr +try git clone https://github.com/osx-cross/homebrew-arm +try git clone https://github.com/osx-cross/homebrew-stm32 + + +echo "" +echo "› Symlink osx-cross formulae & casks" +clone_path="$HOME/dev/osx-cross" +tap_path="/usr/local/Homebrew/Library/Taps/osx-cross" + +try mkdir -p /usr/local/Homebrew/Library/Taps/osx-cross +try ln -sfn $clone_path/homebrew-stm32 $tap_path/homebrew-stm32 +try ln -sfn $clone_path/homebrew-avr $tap_path/homebrew-avr +try ln -sfn $clone_path/homebrew-arm $tap_path/homebrew-arm + + +echo "" +echo "› Install osx-cross formulae & casks" +try brew install avr-gcc +try brew install arm-gcc-bin +try brew cask install stm32cubemx + + +echo "" +echo "› Install useful gems, pip & node packages" +try gem install --no-document cocoapods fastlane neovim +try pip3 install -U --user mbed-cli pyserial neovim pyocd +try npm install -g neovim mbed-vscode-generator diff --git a/scripts/helpers.sh b/scripts/helpers.sh deleted file mode 100644 index 2b63a56..0000000 --- a/scripts/helpers.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env zsh - -# -# Helpers -# - -typeset -Ux failed_commands=() - -function try { - - if [[ -n $CI ]]; then - if [[ "$@" =~ "sudo -v" ]]; then - return 0 - fi - fi - - verbose=false - super_verbose=false - - # create tmp file & schedule delete if error - tmp_file=$(mktemp) - trap "rm -f $temp_file" 0 2 3 15 - - # set output level - if [[ $1 =~ "-v" || $1 =~ "--verbose" ]]; then - verbose=true - if [[ $1 =~ "-vv" ]]; then - verbose=true - super_verbose=true - fi - shift - fi - - start=$(date +%s.%N) - - # execute command - echo -ne "Running $@ ... " - script -q $tmp_file $@ > /dev/null 2>&1 - cmd_result=$? - - end=$(date +%s.%N) - - # calculate duration - runtime=$(echo -ne $(printf %.2f $(echo "$end-$start" | bc -l))) - - # output result - if [ $cmd_result -eq 0 ]; then - echo "✅ ($runtime)" - if [[ $super_verbose == true ]]; then - cat $tmp_file - fi - else - echo "❌ ($runtime)" - failed_commands+=$@ - if [[ $verbose == true ]]; then - cat $tmp_file - fi - fi - - rm -rf $tmp_file - -} - -function list_failed_commands { - echo "" - if [ ${#failed_commands[@]} -eq 0 ]; then - echo "🎉 The bootstrap process completed successfully! 💪" - else - echo "⚠️ The following commands have failed:" - for cmd in $failed_commands; do - echo "\t- $cmd" - done - fi -} \ No newline at end of file diff --git a/scripts/helpers/include.sh b/scripts/helpers/include.sh new file mode 100644 index 0000000..f3d286b --- /dev/null +++ b/scripts/helpers/include.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env zsh + +# +# Helpers +# + +function list_failed_commands { + ret=0 + echo "" + if [ ${#FAILED_COMMANDS[@]} -eq 0 ]; then + echo "🎉 The bootstrap process completed successfully! 💪" + else + echo "💥 The following commands have failed: 💥" + for cmd in $FAILED_COMMANDS; do + echo "\t- $cmd" + done + exit 1 + fi + + echo "" + echo "💡 Note that some of these changes require a logout/restart 💻 to take effect 🚀" + + exit $ret +} + +function print_section { + echo "\n" + echo "👷 $@ 🚧" +} + +function is_dry_run { + if [[ $ARG_ARRAY =~ "--dry-run" ]]; then + return 0 + else + return 1 + fi +} + +function args_contain { + if [[ $ARG_ARRAY =~ $@ ]]; then + return 0 + else + return 1 + fi +} diff --git a/scripts/helpers/try.sh b/scripts/helpers/try.sh new file mode 100755 index 0000000..26758d8 --- /dev/null +++ b/scripts/helpers/try.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env zsh + +if [[ -n $CI_TEST ]]; then + if [[ "$@" =~ "sudo -v" ]]; then + return 0 + fi +fi + +verbose=false +super_verbose=false + +# set output level +if [[ $1 =~ "-v" || $1 =~ "--verbose" ]]; then + verbose=true + if [[ $1 =~ "-vv" ]]; then + verbose=true + super_verbose=true + fi + shift +fi + +start=$(date +%s.%N) + +# execute command +echo -ne "Running $@ ... " + +cmd_result=0 + +if [[ ! -n $DRY_RUN ]]; then + if [[ $1 =~ "sudo" ]]; then + shift + sudo script -q $TEMP_FILE $@ > /dev/null 2>&1 + else + script -q $TEMP_FILE $@ > /dev/null 2>&1 + fi + cmd_result=$? +fi + +end=$(date +%s.%N) + +# calculate duration +runtime="$(printf %.2f $(echo "$end-$start" | bc -l))" + +# output result +if [ $cmd_result -eq 0 ]; then + echo "✅ ($runtime)" + if [[ $super_verbose == true ]]; then + cat $TEMP_FILE + fi +else + echo "❌ ($runtime)" + FAILED_COMMANDS+=$@ + if [[ $verbose == true ]]; then + cat $TEMP_FILE + fi +fi diff --git a/scripts/macos.sh b/scripts/macos.sh index 8df217a..1ac4212 100644 --- a/scripts/macos.sh +++ b/scripts/macos.sh @@ -2,31 +2,66 @@ # Close any open System Preferences panes, to prevent them from overriding # settings we’re about to change +echo "" +echo "› Quit System Preferences" try osascript -e 'tell application "System Preferences" to quit' # Ask for the administrator password upfront # sudo -v -# Keep-alive: update existing `sudo` time stamp until `.macos` has finished +# Keep-alive: update existing `sudo` time stamp until `macos.sh` has finished while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & +############################################################################### +# Open affected applications +############################################################################### + +echo "" +echo "›››" +echo "››› Open affected applications" +echo "›››" + +typeset -U macos_apps + +macos_apps=( + "Activity Monitor" + "App Store" + "Calendar" + "Contacts" + "Dock" + "Finder" + "Mail" + "Messages" + "Photos" + "Safari" + "SystemUIServer" + "Terminal" +) + +echo "" +for app in $macos_apps ; do + try open -a "${app}" +done + ############################################################################### # General UI/UX ############################################################################### echo "" -echo "›› General UI/UX" +echo "›››" +echo "››› General UI/UX" +echo "›››" DATE=$(date +"%Y%m%d") COMPUTER_NAME="LadBookPro$DATE" echo "" echo "› Set computer name to $COMPUTER_NAME" -sudo scutil --set ComputerName "$COMPUTER_NAME" -sudo scutil --set HostName "$COMPUTER_NAME" -sudo scutil --set LocalHostName "$COMPUTER_NAME" -sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$COMPUTER_NAME" +try sudo scutil --set ComputerName "$COMPUTER_NAME" +try sudo scutil --set HostName "$COMPUTER_NAME" +try sudo scutil --set LocalHostName "$COMPUTER_NAME" +try sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$COMPUTER_NAME" echo "" echo "› Always show scrollbars" @@ -39,9 +74,9 @@ try defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true try defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true try defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true -echo "" -echo "› Disable the over-the-top focus ring animation" -try defaults write NSGlobalDomain NSUseAnimatedFocusRing -bool false +# echo "" +# echo "› Disable the over-the-top focus ring animation" +# try defaults write NSGlobalDomain NSUseAnimatedFocusRing -bool false echo "" echo "› Save to disk (not to iCloud) by default" @@ -57,7 +92,7 @@ try defaults write com.apple.helpviewer DevMode -bool true echo "" echo "› Reveal IP address, hostname, OS version, etc. when clicking the clock" # in the login window -sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName +try sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName echo "" echo "› Disable automatic capitalization" @@ -81,39 +116,41 @@ try defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool fals ############################################################################### echo "" -echo "›› General Power and Performance modifications" +echo "›››" +echo "››› General Power and Performance modifications" +echo "›››" echo "" echo "› Disable Resume system-wide" try defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false echo "" -echo "› Disable automatic termination of inactive apps"echo " ›" +echo "› Disable automatic termination of inactive apps" try defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true echo "" echo "› Disable the sudden motion sensor?" -sudo pmset -a sms 0 +try sudo pmset -a sms 0 -echo "" -echo "› Speed up wake from sleep to 24 hours from an hour" -sudo pmset -a standbydelay 86400 +# echo "" +# echo "› Speed up wake from sleep to 24 hours from an hour" +# try sudo pmset -a standbydelay 86400 echo "" echo "› Sleep the display after 15 minutes" -sudo pmset -a displaysleep 15 +try sudo pmset -a displaysleep 15 echo "" echo "› Disable machine sleep while charging" -sudo pmset -c sleep 0 +try sudo pmset -c sleep 0 echo "" echo "› Set machine sleep to 5 minutes on battery" -sudo pmset -b sleep 5 +try sudo pmset -b sleep 5 echo "" echo "› Enable lid wakeup" -sudo pmset -a lidwake 1 +try sudo pmset -a lidwake 1 ############################################################################### @@ -121,7 +158,9 @@ sudo pmset -a lidwake 1 ############################################################################### echo "" -echo "›› Trackpad, mouse, keyboard, Bluetooth accessories, and input" +echo "›››" +echo "››› Trackpad, mouse, keyboard, Bluetooth accessories, and input" +echo "›››" echo "" echo "› Increase sound quality for Bluetooth headphones/headsets" @@ -153,7 +192,9 @@ try defaults write com.apple.BezelServices kDimTime -int 300 ############################################################################### echo "" -echo "›› Screen" +echo "›››" +echo "››› Screen" +echo "›››" echo "" echo "› Require password immediately after sleep or screen saver begins" @@ -170,7 +211,7 @@ try defaults write NSGlobalDomain AppleFontSmoothing -int 1 echo "" echo "› Enable HiDPI display modes (requires restart)" -sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true +try sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true ############################################################################### @@ -178,7 +219,9 @@ sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutio ############################################################################### echo "" -echo "›› Finder" +echo "›››" +echo "››› Finder" +echo "›››" echo "" echo "› Disable window animations and Get Info animations" @@ -223,11 +266,11 @@ echo "" echo "› Remove the spring loading delay for directories" try defaults write NSGlobalDomain com.apple.springing.delay -float 0 -echo "Allowing text selection in Quick Look/Preview in Finder by default" -try defaults write com.apple.finder QLEnableTextSelection -bool true +# echo "Allowing text selection in Quick Look/Preview in Finder by default" +# try defaults write com.apple.finder QLEnableTextSelection -bool true echo "" -echo "› Use colimn view in all Finder windows by default" +echo "› Use column view in all Finder windows by default" try defaults write com.apple.finder FXPreferredViewStyle Clmv echo "" @@ -255,9 +298,9 @@ try /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arran echo "" echo "› Increase grid spacing for icons on the desktop and in other icon views" -try /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist -try /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist -try /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist +try /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 80" ~/Library/Preferences/com.apple.finder.plist +try /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 80" ~/Library/Preferences/com.apple.finder.plist +try /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 80" ~/Library/Preferences/com.apple.finder.plist echo "" echo "› Show the ~/Library folder" @@ -265,7 +308,7 @@ try chflags nohidden ~/Library echo "" echo "› Show the /Volumes folder" -sudo chflags nohidden /Volumes +try sudo chflags nohidden /Volumes ############################################################################### @@ -273,7 +316,9 @@ sudo chflags nohidden /Volumes ############################################################################### echo "" -echo "›› Dock, Dashboard & Mission Control" +echo "›››" +echo "››› Dock, Dashboard & Mission Control" +echo "›››" echo "" echo "› Wipe all (default) app icons from the Dock" # This is only really useful when setting up a new Mac @@ -303,9 +348,9 @@ echo "" echo "› Show indicator lights for open applications in the Dock" try defaults write com.apple.dock show-process-indicators -bool true -echo "" -echo "› Minimize windows into their application’s icon" -try defaults write com.apple.dock minimize-to-application -bool true +# echo "" +# echo "› Minimize windows into their application’s icon" +# try defaults write com.apple.dock minimize-to-application -bool true echo "" echo "› Remove the auto-hiding Dock delay" @@ -331,7 +376,9 @@ try defaults write com.apple.dock mru-spaces -bool false ############################################################################### echo "" -echo "›› Hot corners" +echo "›››" +echo "››› Hot corners" +echo "›››" echo "" echo "› Top left screen corner → Mission Control" @@ -359,7 +406,9 @@ try defaults write com.apple.dock wvous-br-modifier -int 0 ############################################################################### echo "" -echo "›› Terminal" +echo "›››" +echo "››› Terminal" +echo "›››" echo "" echo "› Enable UTF-8 ONLY in Terminal.app and setting the Pro theme by default" @@ -381,69 +430,23 @@ try defaults write com.apple.Terminal ShowLineMarks -int 0 ############################################################################### echo "" -echo "›› Messages" +echo "›››" +echo "››› Messages" +echo "›››" echo "" echo "› Disable smart quotes in Messages.app" try defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false -############################################################################### -# Transmission.app -############################################################################### - -echo "" -echo "›› Transmission.app" - -try mkdir -p ~/Torrentz/Incomplete - -echo "" -echo "› Setting up an incomplete downloads folder in Downloads" -try defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true -try defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Torrentz/Incomplete" - -echo "" -echo "› Setting auto-add folder to be Downloads" -try defaults write org.m0k.transmission AutoImportDirectory -string "${HOME}/Torrentz" - -echo "" -echo "› Don't prompt for confirmation before downloading" -try defaults write org.m0k.transmission DownloadAsk -bool false - -echo "" -echo "› Trash original torrent files after adding them" -try defaults write org.m0k.transmission DeleteOriginalTorrent -bool true - -echo "" -echo "› Hiding the donate message" -try defaults write org.m0k.transmission WarningDonate -bool false - -echo "" -echo "› Hiding the legal disclaimer" -try defaults write org.m0k.transmission WarningLegal -bool false - -echo "" -echo "› Auto-resizing the window to fit transfers" -try defaults write org.m0k.transmission AutoSize -bool true - -echo "" -echo "› Auto updating to betas" -try defaults write org.m0k.transmission AutoUpdateBeta -bool true - -echo "" -echo "› Setting up the best block list" -try defaults write org.m0k.transmission EncryptionRequire -bool true -try defaults write org.m0k.transmission BlocklistAutoUpdate -bool true -try defaults write org.m0k.transmission BlocklistNew -bool true -try defaults write org.m0k.transmission BlocklistURL -string "http://john.bitsurge.net/public/biglist.p2p.gz" - - ############################################################################### # Activity Monitor ############################################################################### echo "" -echo "›› Activity Monitor" +echo "›››" +echo "››› Activity Monitor" +echo "›››" echo "" echo "› Show the main window when launching Activity Monitor" @@ -464,7 +467,9 @@ try defaults write com.apple.ActivityMonitor SortDirection -int 0 ############################################################################### echo "" -echo "›› TextEdit & Disk Utility" +echo "›››" +echo "››› TextEdit & Disk Utility" +echo "›››" echo "" echo "› Use plain text mode for new TextEdit documents" @@ -486,7 +491,9 @@ try defaults write com.apple.DiskUtility advanced-image-options -bool true ############################################################################### echo "" -echo "›› Mac App Store" +echo "›››" +echo "››› Mac App Store" +echo "›››" echo "" echo "› Enable the automatic update check" @@ -518,7 +525,9 @@ try defaults write com.apple.commerce AutoUpdateRestartRequired -bool true ############################################################################### echo "" -echo "›› Photos" +echo "›››" +echo "››› Photos" +echo "›››" echo "" echo "› Prevent Photos from opening automatically when devices are plugged in" @@ -529,25 +538,13 @@ try defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true # Kill affected applications ############################################################################### -echo "☠️ Kill related apps" - -for app in "Activity Monitor" \ - "Address Book" \ - "Calendar" \ - "Contacts" \ - "cfprefsd" \ - "Dock" \ - "Finder" \ - "Mail" \ - "Messages" \ - "Safari" \ - "SystemUIServer" \ - "Terminal" \ - "Transmission" \ - "Photos" \ - "App Store" \ - "Rectangle" ; do - try killall "${app}" &> /dev/null -done +echo "" +echo "›››" +echo "››› Kill affected applications" +echo "›››" -echo "🎉 Done! ✅ Note that some of these changes require a logout/restart to take effect" +echo "" +for app in $macos_apps ; do + try killall "${app}" +done +try killall "cfprefsd" diff --git a/symlink/.mackup.cfg b/symlink/.mackup.cfg deleted file mode 100644 index 87bbd29..0000000 --- a/symlink/.mackup.cfg +++ /dev/null @@ -1,17 +0,0 @@ -[storage] - -engine = file_system -path = Dropbox (Personal)/dev/data -directory = mackup - -[applications_to_sync] - -appcleaner -colorsync -fantastical -macdown -macosx -terminal -transmission -xcode - diff --git a/zsh/.zshrc b/zsh/.zshrc index 4c4bee6..58f1a22 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -38,8 +38,7 @@ if [[ "$OSTYPE" == darwin* ]]; then # Python # lpath+="/usr/local/opt/python/libexec/bin" - # - # lpath+="/Users/ladislas/Library/Python/3.7/bin/" + lpath+="/Users/ladislas/Library/Python/3.7/bin/" # Export $PATH path=($lpath $path)