From ede74ccfdecea7cd21192bb43ab575035a0f0279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pa=C5=82aszy=C5=84ski?= <35331661+appalaszynski@users.noreply.github.com> Date: Mon, 12 Mar 2018 14:07:12 +0100 Subject: [PATCH 01/61] Add $ to shell commands --- README.md | 69 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 9cd45e7..123c8ad 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ This document describes how I set up front end web development environment on my MacBook Air with macOS High Sierra 10.13.3. +### Table of Contents + - [System Preferences](#system-preferences) - [Terminal](#terminal) - [Bash](#bash) @@ -29,13 +31,13 @@ After clean install of operating system, there are a couple tweaks I like to mak ### Set Dock size ```shell -defaults write com.apple.dock tilesize -int 35; killall Dock +$ defaults write com.apple.dock tilesize -int 35; killall Dock ``` ### Disable "Press and hold" ```shell -defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false +$ defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false ``` ### Reset icons in Launchpad @@ -43,7 +45,7 @@ defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false I usually use this command after installing every application that I need - it keeps Apple applications on the first page and moves the rest to the next pages. ```shell -defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock +$ defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock ``` ### Show hidden files @@ -51,19 +53,19 @@ defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock This can also be done by pressing `Command ⌘` + `Shift ⇧` + `.`. ```shell -defaults write com.apple.finder AppleShowAllFiles YES +$ defaults write com.apple.finder AppleShowAllFiles YES ``` ### Show path bar in Finder ```shell -defaults write com.apple.finder ShowPathbar -bool true +$ defaults write com.apple.finder ShowPathbar -bool true ``` ### Show status bar in Finder ```shell -defaults write com.apple.finder ShowStatusBar -bool true +$ defaults write com.apple.finder ShowStatusBar -bool true ``` ## Terminal @@ -71,7 +73,7 @@ defaults write com.apple.finder ShowStatusBar -bool true I use my custom Terminal profile called **Flat**. You can download it by typing: ```shell -curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/Flat.terminal +$ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/Flat.terminal ``` To use it as default profile open downloaded `Flat.terminal` file and click **Shell** > **Use settings as default** option. @@ -104,9 +106,9 @@ In my `.bash_profile` file I create a `brewup` alias to keep Homebrew (which we To download `.bash_profile` and execute its content, use: ```shell -cd ~ -curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/.bash_profile -source ~/.bash_profile +$ cd ~ +$ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/.bash_profile +$ source ~/.bash_profile ``` ## Homebrew @@ -116,7 +118,15 @@ source ~/.bash_profile ### Installation ```shell -/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +``` + +### Usage + +To install specific package use ```brew install ``` e.g. + +```shell +$ brew install git ``` ### Brewfile @@ -179,19 +189,19 @@ mas "Pages", id: 409201541 To check App Store application's IDs use: ```shell -mas search +$ mas search ``` To download my `Brewfile` file type: ```shell -curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/Brewfile +$ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/Brewfile ``` To install listed applications use: ```shell -brew bundle +$ brew bundle ``` in directory that contains `Brewfile` file. @@ -201,16 +211,16 @@ in directory that contains `Brewfile` file. You can set Git global configuration two ways. The first is to run bunch of commands which will update the Git configuration file, e.g. ```shell -git config --global user.name "First Last" -git config --global user.email "email@email.com" +$ git config --global user.name "First Last" +$ git config --global user.email "email@email.com" ``` The other and faster way is creating the Git configuration file and input it all ourselves. ```shell -cd ~ -curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/.gitconfig -open .gitconfig +$ cd ~ +$ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/.gitconfig +$ open .gitconfig ``` ```properties @@ -232,19 +242,19 @@ Here I set my name, email, GitHub username, core editor and connect Git to the m For installation of Node.js I like to use [Node Version Manager](https://github.com/creationix/nvm) (nvm). To download it type: ```shell -curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash +$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash ``` You can check all available Node.js versions by: ```shell -nvm list-remote +$ nvm list-remote ``` To install specific version type: ```shell -nvm install +$ nvm install ``` ## Node Package Manager @@ -256,7 +266,7 @@ The only thing I use globally at the moment is [Gulp](https://gulpjs.com). To install Gulp globally use: ```shell -npm install --global gulp-cli +$ npm install --global gulp-cli ``` ## Web Browsers @@ -279,7 +289,8 @@ For main development I use Google Chrome. ## Visual Studio Code -All settings changes in Visual Studio Code are stored in `settings.json` file. +All default settings changes are stored in `settings.json` file. You can open it by pressing `Command ⌘` + `,`. +Here are my `settings.json` contents: ```json { @@ -325,17 +336,17 @@ All settings changes in Visual Studio Code are stored in `settings.json` file. You can copy and paste them or just download whole file by: ```shell -cd /Users/Your Username/Library/Application Support/Code/User -curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/settings.json +$ cd /Users/Your Username/Library/Application Support/Code/User +$ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/settings.json ``` ### Extensions - [Auto Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) - automatically rename paired HTML tag -- [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) - debug JavaScript code in the Google Chrome browser +- [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) - debug JavaScript code running in Google Chrome from VS Code - [Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) - icons based on Material Design - [open in browser](https://marketplace.visualstudio.com/items?itemName=techer.open-in-browser) - open any file in specific browser right from VS Code explorer - [Path Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense) - autocomplete filenames -- [Project Manager](https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager) - manage projects right inside Visual Studio Code -- [SCSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-scss) - autocomplete variables, mixins, functions and many other +- [Project Manager](https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager) - manage projects right inside VS Code +- [SCSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-scss) - autocomplete variables, mixins, functions etc. - [TODO Highlight](https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight) - highlight and list TODO, FIXME or any annotations within code From 7c5196c4d6c2d5cb9c5efb68dadd29c5ff33f5fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pa=C5=82aszy=C5=84ski?= <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 14 Mar 2018 08:24:42 +0100 Subject: [PATCH 02/61] Add badges --- README.md | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 123c8ad..15d9795 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,18 @@ -

- -# Front End Web Development Setup for macOS +
+ + + +
+
+

Front End Web Development Setup for macOS

+

+ + + +

+
+
+
This document describes how I set up front end web development environment on my MacBook Air with macOS High Sierra 10.13.3. @@ -81,12 +93,15 @@ To use it as default profile open downloaded `Flat.terminal` file and click **Sh ## Bash ```shell +# Aliases alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' alias rmhis='rm .bash_history; history -c; logout' +# Colors for `ls` command output export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced +# Colors used in prompt RED='\[\033[1;31m\]' GREEN='\[\033[1;32m\]' YELLOW='\[\033[1;33m\]' @@ -94,11 +109,13 @@ PURPLE='\[\033[1;35m\]' GRAY='\[\033[1;30m\]' DEFAULT='\[\033[0m\]' +# Function used in prompt, which displays current Git branch parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } -export PS1="${RED}\u ${GRAY}• ${GREEN}\h ${GRAY}• ${YELLOW}\w${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on\")${PURPLE}\$(parse_git_branch)\n${GRAY}\$ ${DEFAULT}" +# Prompt +export PS1="${RED}\u ${GRAY}• ${GREEN}\h ${GRAY}• ${YELLOW}\w${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" •\")${PURPLE}\$(parse_git_branch)\n${GRAY}\$ ${DEFAULT}" ``` In my `.bash_profile` file I create a `brewup` alias to keep Homebrew (which we are going to install in a second) up to date and `rmhis` to remove bash history. I also set color scheme for `ls` command output and for custom prompt which contains username, computer name, working directory and current Git branch. @@ -259,14 +276,15 @@ $ nvm install ## Node Package Manager -The only thing I use globally at the moment is [Gulp](https://gulpjs.com). - -### Gulp +Packages which I use globally at the moment are: +* [Gulp](https://gulpjs.com) +* [Webpack](https://webpack.js.org) +* [npm-upgrade](https://www.npmjs.com/package/npm-upgrade) -To install Gulp globally use: +To install them use: ```shell -$ npm install --global gulp-cli +$ npm install -g gulp-cli webpack npm-upgrade ``` ## Web Browsers @@ -284,12 +302,12 @@ For main development I use Google Chrome. - [uBlock Origin](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm) - block ads - [JSONView](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc) - validate and view JSON documents -- [React developer tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) - inspect component hierarchies and states +- [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) - inspect component hierarchies and states - [Redux DevTools](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) - debug state changes ## Visual Studio Code -All default settings changes are stored in `settings.json` file. You can open it by pressing `Command ⌘` + `,`. +All default settings changes are stored in `settings.json` file. You can open it by pressing `Command ⌘` + `,` going to Code > Preferences > Settings. Here are my `settings.json` contents: ```json @@ -304,6 +322,7 @@ Here are my `settings.json` contents: "editor.minimap.enabled": false, "editor.hideCursorInOverviewRuler": true, "editor.formatOnPaste": true, + "problems.decorations.enabled": false, "explorer.openEditors.visible": 0, "files.insertFinalNewline": true, "html.autoClosingTags": false, From d4878b412b2c911de592f7150404cb69087816ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pa=C5=82aszy=C5=84ski?= <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 14 Mar 2018 08:25:04 +0100 Subject: [PATCH 03/61] Disable problems decorations --- settings.json | 1 + 1 file changed, 1 insertion(+) diff --git a/settings.json b/settings.json index 2602fd7..d319aa2 100644 --- a/settings.json +++ b/settings.json @@ -9,6 +9,7 @@ "editor.minimap.enabled": false, "editor.hideCursorInOverviewRuler": true, "editor.formatOnPaste": true, + "problems.decorations.enabled": false, "explorer.openEditors.visible": 0, "files.insertFinalNewline": true, "html.autoClosingTags": false, From 4217d36cffe5dd0658d99377db6a1718d1def921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pa=C5=82aszy=C5=84ski?= <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 14 Mar 2018 13:54:26 +0100 Subject: [PATCH 04/61] Update apperance --- README.md | 47 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 15d9795..51d448e 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,25 @@
- - + +
-
-

Front End Web Development Setup for macOS

+

Mac Setup

+

+ Front End Web Development Setup for macOS +

- - - + + + + + + + + + + + +



@@ -16,7 +27,9 @@ This document describes how I set up front end web development environment on my MacBook Air with macOS High Sierra 10.13.3. -### Table of Contents +--- + +## Table of Contents - [System Preferences](#system-preferences) - [Terminal](#terminal) @@ -28,6 +41,8 @@ This document describes how I set up front end web development environment on my - [Web Browsers](#web-browsers) - [Visual Studio Code](#visual-studio-code) +--- + ## System Preferences After clean install of operating system, there are a couple tweaks I like to make to the System Preferences. Some of them are not strictly related to web development enviroment - I use them because of my personal habits. @@ -80,6 +95,8 @@ $ defaults write com.apple.finder ShowPathbar -bool true $ defaults write com.apple.finder ShowStatusBar -bool true ``` +--- + ## Terminal I use my custom Terminal profile called **Flat**. You can download it by typing: @@ -90,6 +107,8 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/Flat. To use it as default profile open downloaded `Flat.terminal` file and click **Shell** > **Use settings as default** option. +--- + ## Bash ```shell @@ -128,6 +147,8 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/.bash $ source ~/.bash_profile ``` +--- + ## Homebrew [Homebrew](http://brew.sh/) package manager allows to install almost any app right from the command line. @@ -223,6 +244,8 @@ $ brew bundle in directory that contains `Brewfile` file. +--- + ## Git You can set Git global configuration two ways. The first is to run bunch of commands which will update the Git configuration file, e.g. @@ -254,6 +277,8 @@ $ open .gitconfig Here I set my name, email, GitHub username, core editor and connect Git to the macOS Keychain so I don’t have to type my username and password every time I want to push to GitHub. +--- + ## Node.js For installation of Node.js I like to use [Node Version Manager](https://github.com/creationix/nvm) (nvm). To download it type: @@ -274,6 +299,8 @@ To install specific version type: $ nvm install ``` +--- + ## Node Package Manager Packages which I use globally at the moment are: @@ -287,6 +314,8 @@ To install them use: $ npm install -g gulp-cli webpack npm-upgrade ``` +--- + ## Web Browsers Currently I have installed all major web browsers: @@ -305,6 +334,8 @@ For main development I use Google Chrome. - [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) - inspect component hierarchies and states - [Redux DevTools](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) - debug state changes +--- + ## Visual Studio Code All default settings changes are stored in `settings.json` file. You can open it by pressing `Command ⌘` + `,` going to Code > Preferences > Settings. From 9255680e74b2f619fc316a83b6d062950ab5fcb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pa=C5=82aszyn=CC=81ski?= <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 25 Mar 2018 22:26:40 +0200 Subject: [PATCH 05/61] Update programs list and VS Code settings --- Brewfile | 3 +++ README.md | 36 +++++++++++++++++++++++++----------- settings.json | 9 +++++++-- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/Brewfile b/Brewfile index 0e2f615..c466eb1 100755 --- a/Brewfile +++ b/Brewfile @@ -7,13 +7,16 @@ cask 'appcleaner' cask 'filezilla' cask 'firefox' cask 'flux' +cask 'fork' cask 'google-chrome' cask 'keepingyouawake' cask 'keka' cask 'mamp' cask 'opera' +cask 'postman' cask 'sequel-pro' cask 'skype' +cask 'slack' cask 'spectacle' cask 'transmission' cask 'visual-studio-code' diff --git a/README.md b/README.md index 51d448e..7daf20e 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ PURPLE='\[\033[1;35m\]' GRAY='\[\033[1;30m\]' DEFAULT='\[\033[0m\]' -# Function used in prompt, which displays current Git branch +# Function used in prompt, displaying current Git branch parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } @@ -174,26 +174,29 @@ Installing each package separately may take some time. That's why I use [Homebre Here are all the programs I install with a brief description. - [Cask](https://caskroom.github.io) - an extension to Homebrew which allows to install almost any program that exists for a Mac -- [Git](https://git-scm.com) - for version control +- [Git](https://git-scm.com) - version control system - [mas-cli](https://github.com/mas-cli/mas) - Mac App Store command line interface -- [AppCleaner](https://freemacsoft.net/appcleaner/) - uninstall apps +- [AppCleaner](https://freemacsoft.net/appcleaner/) - apps uninstaller - [Filezilla](https://filezilla-project.org) - FTP client - [Firefox](https://www.mozilla.org/firefox/new/) - web browser -- [Flux](https://justgetflux.com) - better Night Shift +- [Flux](https://justgetflux.com) - screen color temperature adjusting app +- [Fork](https://git-fork.com) - Git GUI client - [Google Chrome](https://www.google.pl/chrome/browser/desktop/index.html) - web browser -- [KeepingYouAwake](https://github.com/newmarcel/KeepingYouAwake) - prevent Mac from entering sleep mode +- [KeepingYouAwake](https://github.com/newmarcel/KeepingYouAwake) - app which prevents Mac from entering sleep mode - [Keka](http://www.kekaosx.com) - file archiver - [MAMP](https://www.mamp.info/en/) - Apache, MySQL and PHP package - [Opera](http://www.opera.com) - web browser -- [Sequel Pro](http://www.sequelpro.com) - GUI for MySQL databases +- [Postman](https://www.getpostman.com) - API testing tool +- [Sequel Pro](http://www.sequelpro.com) - MySQL GUI tool - [Skype](https://www.skype.com) - voice and video chat -- [Spectacle](https://www.spectacleapp.com) - easily move and resize windows +- [Slack](https://slack.com) - team collaboration tools +- [Spectacle](https://www.spectacleapp.com) - window manager - [Transmission](https://transmissionbt.com) - BitTorrent client - [Visual Studio Code](https://code.visualstudio.com) - code editor - [VLC](https://www.videolan.org/vlc/) - media player - [iMovie](https://www.apple.com/imovie/) - video editor - [Pages](https://www.apple.com/pages/) - text editor -- [Numbers](https://www.apple.com/numbers/) - spreadsheet +- [Numbers](https://www.apple.com/numbers/) - spreadsheet editor Below are the entire contents of my `Brewfile`, which will install all the above programs with a single command. @@ -207,13 +210,16 @@ cask 'appcleaner' cask 'filezilla' cask 'firefox' cask 'flux' +cask 'fork' cask 'google-chrome' cask 'keepingyouawake' cask 'keka' cask 'mamp' cask 'opera' +cask 'postman' cask 'sequel-pro' cask 'skype' +cask 'slack' cask 'spectacle' cask 'transmission' cask 'visual-studio-code' @@ -347,14 +353,16 @@ Here are my `settings.json` contents: "workbench.colorTheme": "Monokai", "workbench.activityBar.visible": false, "workbench.iconTheme": "material-icon-theme", + "workbench.statusBar.feedback.visible": false, "editor.fontSize": 12, "editor.tabSize": 2, "editor.multiCursorModifier": "ctrlCmd", "editor.minimap.enabled": false, - "editor.hideCursorInOverviewRuler": true, "editor.formatOnPaste": true, + "editor.detectIndentation": false, "problems.decorations.enabled": false, "explorer.openEditors.visible": 0, + "explorer.decorations.colors": false, "files.insertFinalNewline": true, "html.autoClosingTags": false, "files.exclude": { @@ -362,6 +370,9 @@ Here are my `settings.json` contents: "**/.vscode/": true, }, "material-icon-theme.folders.theme": "none", + "material-icon-theme.hidesExplorerArrows": true, + "html-css-class-completion.enableEmmetSupport": true, + "eslint.autoFixOnSave": true, "todohighlight.isEnable": true, "todohighlight.keywords": [ { @@ -379,7 +390,7 @@ Here are my `settings.json` contents: ], "todohighlight.exclude": [ "**/public/" - ] + ], } ``` @@ -394,9 +405,12 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti - [Auto Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) - automatically rename paired HTML tag - [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) - debug JavaScript code running in Google Chrome from VS Code +- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - integrate ESLint into VS Code +- [IntelliSense for CSS class names in HTML](https://marketplace.visualstudio.com/items?itemName=Zignd.html-css-class-completion) - autocomplete HTML class attributes - [Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) - icons based on Material Design -- [open in browser](https://marketplace.visualstudio.com/items?itemName=techer.open-in-browser) - open any file in specific browser right from VS Code explorer +- [open in browser](https://marketplace.visualstudio.com/items?itemName=techer.open-in-browser) - open any file in browser right from VS Code explorer - [Path Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense) - autocomplete filenames - [Project Manager](https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager) - manage projects right inside VS Code +- [Reactjs code snippets](https://marketplace.visualstudio.com/items?itemName=xabikos.ReactSnippets) - code snippets for React development - [SCSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-scss) - autocomplete variables, mixins, functions etc. - [TODO Highlight](https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight) - highlight and list TODO, FIXME or any annotations within code diff --git a/settings.json b/settings.json index d319aa2..3e9ccd7 100644 --- a/settings.json +++ b/settings.json @@ -3,14 +3,16 @@ "workbench.colorTheme": "Monokai", "workbench.activityBar.visible": false, "workbench.iconTheme": "material-icon-theme", + "workbench.statusBar.feedback.visible": false, "editor.fontSize": 12, "editor.tabSize": 2, "editor.multiCursorModifier": "ctrlCmd", "editor.minimap.enabled": false, - "editor.hideCursorInOverviewRuler": true, "editor.formatOnPaste": true, + "editor.detectIndentation": false, "problems.decorations.enabled": false, "explorer.openEditors.visible": 0, + "explorer.decorations.colors": false, "files.insertFinalNewline": true, "html.autoClosingTags": false, "files.exclude": { @@ -18,6 +20,9 @@ "**/.vscode/": true, }, "material-icon-theme.folders.theme": "none", + "material-icon-theme.hidesExplorerArrows": true, + "html-css-class-completion.enableEmmetSupport": true, + "eslint.autoFixOnSave": true, "todohighlight.isEnable": true, "todohighlight.keywords": [ { @@ -35,5 +40,5 @@ ], "todohighlight.exclude": [ "**/public/" - ] + ], } From 58a6a9cd541f8586f20bd65ae06d7d2918cd40ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pa=C5=82aszyn=CC=81ski?= <35331661+appalaszynski@users.noreply.github.com> Date: Tue, 10 Apr 2018 21:04:52 +0200 Subject: [PATCH 06/61] Update Create new bash aliases, remove "IntelliSense for CSS class names in HTML" VS Code extension, update VSCode settings - set up availability for "Auto Rename Tag" extension. --- .bash_profile | 3 +++ README.md | 19 ++++++++++++++----- settings.json | 7 ++++++- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.bash_profile b/.bash_profile index 428cd76..3e3b008 100755 --- a/.bash_profile +++ b/.bash_profile @@ -1,5 +1,8 @@ alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' alias rmhis='rm .bash_history; history -c; logout' +alias ..="cd .." +alias p="cd ~/Projects" +alias d="cd ~/Desktp" export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced diff --git a/README.md b/README.md index 7daf20e..f03e3cc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ - + @@ -25,7 +25,7 @@
-This document describes how I set up front end web development environment on my MacBook Air with macOS High Sierra 10.13.3. +This document describes how I set up front end web development environment on my MacBook Air with macOS High Sierra 10.13.4. --- @@ -115,6 +115,11 @@ To use it as default profile open downloaded `Flat.terminal` file and click **Sh # Aliases alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' alias rmhis='rm .bash_history; history -c; logout' +alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' +alias rmhis='rm .bash_history; history -c; logout' +alias ..="cd .." +alias p="cd ~/Projects" +alias d="cd ~/Desktp" # Colors for `ls` command output export CLICOLOR=1 @@ -137,7 +142,7 @@ parse_git_branch() { export PS1="${RED}\u ${GRAY}• ${GREEN}\h ${GRAY}• ${YELLOW}\w${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" •\")${PURPLE}\$(parse_git_branch)\n${GRAY}\$ ${DEFAULT}" ``` -In my `.bash_profile` file I create a `brewup` alias to keep Homebrew (which we are going to install in a second) up to date and `rmhis` to remove bash history. I also set color scheme for `ls` command output and for custom prompt which contains username, computer name, working directory and current Git branch. +In my `.bash_profile` file I create, among others, a `brewup` alias to keep Homebrew (which we are going to install in a second) up to date and `rmhis` to remove bash history. I also set color scheme for `ls` command output and for custom prompt which contains username, computer name, working directory and current Git branch. To download `.bash_profile` and execute its content, use: @@ -371,7 +376,6 @@ Here are my `settings.json` contents: }, "material-icon-theme.folders.theme": "none", "material-icon-theme.hidesExplorerArrows": true, - "html-css-class-completion.enableEmmetSupport": true, "eslint.autoFixOnSave": true, "todohighlight.isEnable": true, "todohighlight.keywords": [ @@ -391,6 +395,12 @@ Here are my `settings.json` contents: "todohighlight.exclude": [ "**/public/" ], + "auto-rename-tag.activationOnLanguage": [ + "html", + "xml", + "javascript", + "javascriptreact" + ] } ``` @@ -406,7 +416,6 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti - [Auto Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) - automatically rename paired HTML tag - [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) - debug JavaScript code running in Google Chrome from VS Code - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - integrate ESLint into VS Code -- [IntelliSense for CSS class names in HTML](https://marketplace.visualstudio.com/items?itemName=Zignd.html-css-class-completion) - autocomplete HTML class attributes - [Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) - icons based on Material Design - [open in browser](https://marketplace.visualstudio.com/items?itemName=techer.open-in-browser) - open any file in browser right from VS Code explorer - [Path Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense) - autocomplete filenames diff --git a/settings.json b/settings.json index 3e9ccd7..28b9559 100644 --- a/settings.json +++ b/settings.json @@ -21,7 +21,6 @@ }, "material-icon-theme.folders.theme": "none", "material-icon-theme.hidesExplorerArrows": true, - "html-css-class-completion.enableEmmetSupport": true, "eslint.autoFixOnSave": true, "todohighlight.isEnable": true, "todohighlight.keywords": [ @@ -41,4 +40,10 @@ "todohighlight.exclude": [ "**/public/" ], + "auto-rename-tag.activationOnLanguage": [ + "html", + "xml", + "javascript", + "javascriptreact" + ] } From 7236de741f77921d8a8b989139c1234ff2a68a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pa=C5=82aszyn=CC=81ski?= <35331661+appalaszynski@users.noreply.github.com> Date: Tue, 10 Apr 2018 21:09:50 +0200 Subject: [PATCH 07/61] Remove duplicate lines in ".bash_profile" contents --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index f03e3cc..7dbbf02 100644 --- a/README.md +++ b/README.md @@ -115,8 +115,6 @@ To use it as default profile open downloaded `Flat.terminal` file and click **Sh # Aliases alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' alias rmhis='rm .bash_history; history -c; logout' -alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' -alias rmhis='rm .bash_history; history -c; logout' alias ..="cd .." alias p="cd ~/Projects" alias d="cd ~/Desktp" From 31f2929ec76e59b35e817f46fc5d519e1efd1b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pa=C5=82aszyn=CC=81ski?= <35331661+appalaszynski@users.noreply.github.com> Date: Tue, 10 Apr 2018 22:45:27 +0200 Subject: [PATCH 08/61] Fix typo --- .bash_profile | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bash_profile b/.bash_profile index 3e3b008..6407823 100755 --- a/.bash_profile +++ b/.bash_profile @@ -2,7 +2,7 @@ alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; alias rmhis='rm .bash_history; history -c; logout' alias ..="cd .." alias p="cd ~/Projects" -alias d="cd ~/Desktp" +alias d="cd ~/Desktop" export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced diff --git a/README.md b/README.md index 7dbbf02..3198e0d 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; alias rmhis='rm .bash_history; history -c; logout' alias ..="cd .." alias p="cd ~/Projects" -alias d="cd ~/Desktp" +alias d="cd ~/Desktop" # Colors for `ls` command output export CLICOLOR=1 From 5df104d2c48ef3f02f624df87fa1bdf5957c5a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pa=C5=82aszyn=CC=81ski?= <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 15 Apr 2018 15:55:06 +0200 Subject: [PATCH 09/61] Add 'Bracket Pair Colorizer' VS Code extension --- README.md | 10 +++++++++- settings.json | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3198e0d..8ba6ef1 100644 --- a/README.md +++ b/README.md @@ -398,7 +398,14 @@ Here are my `settings.json` contents: "xml", "javascript", "javascriptreact" - ] + ], + "bracketPairColorizer.activeScopeCSS": [ + "borderStyle : solid", + "borderWidth : 1px", + "borderColor : {color}; opacity: 0.5", + "backgroundColor : {color}" + ], + "bracketPairColorizer.highlightActiveScope": true, } ``` @@ -412,6 +419,7 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti ### Extensions - [Auto Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) - automatically rename paired HTML tag +- [Bracket Pair Colorizer](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer) - match brackets to be identified with colours - [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) - debug JavaScript code running in Google Chrome from VS Code - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - integrate ESLint into VS Code - [Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) - icons based on Material Design diff --git a/settings.json b/settings.json index 28b9559..93dc811 100644 --- a/settings.json +++ b/settings.json @@ -45,5 +45,12 @@ "xml", "javascript", "javascriptreact" - ] + ], + "bracketPairColorizer.activeScopeCSS": [ + "borderStyle : solid", + "borderWidth : 1px", + "borderColor : {color}; opacity: 0.5", + "backgroundColor : {color}" + ], + "bracketPairColorizer.highlightActiveScope": true, } From 664d6f923e22b32cc6549bcf35d1216093869587 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Tue, 1 May 2018 19:26:01 +0200 Subject: [PATCH 10/61] Update README.md - Add new Chrome extensions: Privacy Badger and Nano Defender, - update nvm (0.33.11), - add command to install all VS Code extensions, - add section about setting up firmware password. --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ba6ef1..af89aa1 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,14 @@ $ defaults write com.apple.finder ShowPathbar -bool true $ defaults write com.apple.finder ShowStatusBar -bool true ``` +### Set firmware password + +Setting a firmware password prevents your Mac from starting up from any device other than your startup disk. It may also be set to be required on each boot. + +```shell +$ firmwarepasswd -setpasswd -setmode command +``` + --- ## Terminal @@ -293,7 +301,7 @@ Here I set my name, email, GitHub username, core editor and connect Git to the m For installation of Node.js I like to use [Node Version Manager](https://github.com/creationix/nvm) (nvm). To download it type: ```shell -$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash +$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash ``` You can check all available Node.js versions by: @@ -339,6 +347,8 @@ For main development I use Google Chrome. ### Chrome extensions - [uBlock Origin](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm) - block ads +- [Privacy Badger](https://chrome.google.com/webstore/detail/privacy-badger/pkehgijcmpdhfbdbbnkijodmdjhbjlgp) - block spying ads and invisible trackers +- [Nano Defender](https://chrome.google.com/webstore/detail/nano-defender/ggolfgbegefeeoocgjbmkembbncoadlb) - anti-adblock defuser - [JSONView](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc) - validate and view JSON documents - [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) - inspect component hierarchies and states - [Redux DevTools](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) - debug state changes @@ -429,3 +439,9 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti - [Reactjs code snippets](https://marketplace.visualstudio.com/items?itemName=xabikos.ReactSnippets) - code snippets for React development - [SCSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-scss) - autocomplete variables, mixins, functions etc. - [TODO Highlight](https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight) - highlight and list TODO, FIXME or any annotations within code + +To install all extensions by one command use: + +```shell +$ code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets +``` From ac4cd179b41fce25a3d85f96c5bf364a483e2665 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 2 May 2018 22:16:49 +0200 Subject: [PATCH 11/61] Create installation shell script --- api/defaults.sh | 222 ++++++++++++++++++++++++++++++++++++++++++++++++ api/install.sh | 164 +++++++++++++++++++++++++++++++++++ install.sh | 30 +++++++ spectacle.json | 74 ++++++++++++++++ 4 files changed, 490 insertions(+) create mode 100755 api/defaults.sh create mode 100644 api/install.sh create mode 100755 install.sh create mode 100644 spectacle.json diff --git a/api/defaults.sh b/api/defaults.sh new file mode 100755 index 0000000..7fea25a --- /dev/null +++ b/api/defaults.sh @@ -0,0 +1,222 @@ +################################# +#### FINDER +################################# + +# Show status bar +defaults write com.apple.finder ShowStatusBar -bool true + +# Show path bar +defaults write com.apple.finder ShowPathbar -bool true + +# When performing a search, search the current folder by default +defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" + +# Always open everything in Finder's columns view. +# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`, 'Nlsv' +defaults write com.apple.finder FXPreferredViewStyle -string "clmv" + +# Keep folders on top when sorting by name +defaults write com.apple.finder _FXSortFoldersFirst -bool true + +######################################## +#### DOCK, DASHBOARD, GESTURES +######################################## + +# Set Dock size +defaults write com.apple.dock tilesize -int 35; killall Dock + +# Reset icons order in Dashboard +defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock + +# Auto-hide Dock +defaults write "com.apple.dock" autohide -int 1 + +# Disable animations +defaults write "com.apple.dock" launchanim -int 0 + +# Enable Expose gesture (slide down with three fingers) +defaults write "com.apple.dock" showAppExposeGestureEnabled -int 1 + +# Disable minimizing windows into their application’s icon +defaults write "com.apple.dock" "minimize-to-application" -int 0 + +# Show indicator lights for open applications in the Dock +defaults write "com.apple.dock" "show-process-indicators" -int 1 + +# Enable the Launchpad gesture (pinch with thumb and three fingers) +defaults write "com.apple.dock" "showLaunchpadGestureEnabled" -int 1 + +# Change minimize/maximize window effect +defaults write com.apple.dock mineffect -string "scale" + +################################# +#### TRACKPAD +################################# + +# Enable tap to click for this user and for the login screen +defaults write "com.apple.AppleMultitouchTrackpad" Clicking -int 1 +defaults write "com.apple.driver.AppleBluetoothMultitouch.trackpad" Clicking -int 1 + +# Enable right click (tap with two fingers) +defaults write "com.apple.AppleMultitouchTrackpad" TrackpadRightClick -int 1 +defaults write "com.apple.driver.AppleBluetoothMultitouch.trackpad" TrackpadRightClick -int 1 + +# Enable application change (swipe horizontal witch three fingers) +defaults write "com.apple.AppleMultitouchTrackpad" TrackpadThreeFingerHorizSwipeGesture -int 2 +defaults write "com.apple.driver.AppleBluetoothMultitouch.trackpad" TrackpadThreeFingerHorizSwipeGesture -int 2 + +################################# +#### NSGlobalDomain +################################# + +# Disable press-and-hold for keys in favor of key repeat +defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false + +# Expand save panel by default +defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true +defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true + +# Save to disk (not to iCloud) by default +defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false + +# Disable automatic capitalization +defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false + +# Disable smart dashes +defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false + +# Disable automatic period substitution +defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false + +# Disable smart quotes +defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false + +# Disable auto-correct +defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false + +# Enable Dark Mode +defaults write NSGlobalDomain AppleInterfaceStyle Dark + +# Enable full keyboard access for all controls +# (e.g. enable Tab in modal dialogs) +defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 + +# Set keyboard repeat rate +defaults write NSGlobalDomain KeyRepeat -int 2 +defaults write NSGlobalDomain InitialKeyRepeat -int 15 + +# Enable tap to click for the login screeni +defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 + +defaults write NSGlobalDomain AppleActionOnDoubleClick None +defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -int 0 +defaults write NSGlobalDomain NSCloseAlwaysConfirmsChanges -int 1 +defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -int 0 +defaults write NSGlobalDomain com.apple.sound.beep.sound -string "/System/Library/Sounds/Funk.aiff" +defaults write NSGlobalDomain userMenuExtraStyle -int 2 + +################################# +#### Other +################################# + +# Show battery percentage in Menu Bar +defaults write com.apple.menuextra.battery -bool true + +# Use 'Flat' terminal profile +defaults write com.apple.Terminal "Default Window Settings" Flat +defaults write com.apple.Terminal "Startup Window Settings" Flat + +# Disable the sound effects on boot +sudo nvram SystemAudioVolume=" " + +# Configure Flux +defaults write org.herf.Flux location "52.223033,18.251073" +defaults write org.herf.Flux locationTextField "Konin" + +# Ddisable some Spotlight search results +defaults write com.apple.spotlight orderedItems -array \ + '{"enabled" = 1;"name" = "APPLICATIONS";}' \ + '{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}' \ + '{"enabled" = 0;"name" = "MENU_CONVERSION";}' \ + '{"enabled" = 0;"name" = "MENU_EXPRESSION";}' \ + '{"enabled" = 0;"name" = "MENU_DEFINITION";}' \ + '{"enabled" = 0;"name" = "SYSTEM_PREFS";}' \ + '{"enabled" = 0;"name" = "DOCUMENTS";}' \ + '{"enabled" = 0;"name" = "DIRECTORIES";}' \ + '{"enabled" = 0;"name" = "PRESENTATIONS";}' \ + '{"enabled" = 0;"name" = "SPREADSHEETS";}' \ + '{"enabled" = 0;"name" = "PDF";}' \ + '{"enabled" = 0;"name" = "MESSAGES";}' \ + '{"enabled" = 0;"name" = "CONTACT";}' \ + '{"enabled" = 0;"name" = "EVENT_TODO";}' \ + '{"enabled" = 0;"name" = "IMAGES";}' \ + '{"enabled" = 0;"name" = "BOOKMARKS";}' \ + '{"enabled" = 0;"name" = "MUSIC";}' \ + '{"enabled" = 0;"name" = "MOVIES";}' \ + '{"enabled" = 0;"name" = "FONTS";}' \ + '{"enabled" = 0;"name" = "MENU_OTHER";}' + + +# Enable snap-to-grid for icons on the desktop and in other icon views +/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist +/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist +/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist + +# Decrease grid spacing for icons on the desktop and in other icon views +/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 20" ~/Library/Preferences/com.apple.finder.plist +/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 20" ~/Library/Preferences/com.apple.finder.plist +/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 20" ~/Library/Preferences/com.apple.finder.plist + +# Decrease the size of icons on the desktop and in other icon views +/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist +/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist +/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist + +# Disable icons preview on the desktop and in other icon views +/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist +/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist +/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist + +# Disable transparency in the menu bar and elsewhere on Yosemite +defaults write com.apple.universalaccess reduceTransparency -bool true + +# Require password immediately after sleep or screen saver begins +defaults write com.apple.screensaver askForPassword -int 1 +defaults write com.apple.screensaver askForPasswordDelay -int 0 + +# Use plain text mode for new TextEdit documents +defaults write com.apple.TextEdit RichText -int 0 + +# Disable spelling check in TextEdit documents +defaults write com.apple.TextEdit CheckSpellingWhileTyping -int 0 + +# Set up date format in menubar +defaults write "com.apple.menuextra.clock" DateFormat -string "EEE d.MM HH:mm" +defaults write "com.apple.systemuiserver" DateFormat -string "EEE d.MM HH:mm" + +## Order of menu bar icons +defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.bluetooth" -int 489 +defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.airport" -int 435 +defaults write "org.herf.Flux" "NSStatusItem Preferred Position Item-0" -float 408.5 +defaults write "com.divisiblebyzero.Spectacle" "NSStatusItem Preferred Position Item-0" -int 383 +defaults write "info.marcel-dierkes.KeepingYouAwake" "NSStatusItem Preferred Position Item-0" -int 354 +defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.volume" -int 324 +defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.battery" -int 273 +defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.clock" -int 179 +defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.appleuser" -string "101.5" +defaults write "com.apple.systemuiserver" "NSStatusItem Visible Siri" -int 0 +defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.airport" -int 1 +defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.appleuser" -int 1 +defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.battery" -int 1 +defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.bluetooth" -int 1 +defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.clock" -int 1 +defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.volume" -int 1 +defaults write "com.apple.systemuiserver" menuExtras -array "/System/Library/CoreServices/Menu Extras/Clock.menu" "/System/Library/CoreServices/Menu Extras/AirPort.menu" "/System/Library/CoreServices/Menu Extras/User.menu" "/System/Library/CoreServices/Menu Extras/Battery.menu" "/System/Library/CoreServices/Menu Extras/Volume.menu" "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" + +applications_to_kill=( + "Activity Monitor" + "Dock" + "Finder" +) + +killall "${applications_to_kill[@]}" diff --git a/api/install.sh b/api/install.sh new file mode 100644 index 0000000..8086619 --- /dev/null +++ b/api/install.sh @@ -0,0 +1,164 @@ +clear #Clear terminal screen + +ARROW=$(tput setaf 6; echo -n '=>'; tput sgr0;) + +echo "Welcome to the installer!" +echo -e "First, introduce your password to execute all the commands as super user. \n" +echo -e "\033[0;31mNote:\033[0m You can be asked more times for password during the process. Also, during" +echo "instalation of some applications You may be required to log in to Mac App Store." +echo + +sudo -v +while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & + +install_homebrew() { + if hash brew 2>/dev/null; then + echo "Homebrew already installed!" + else + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + fi +} + +update_homebrew() { + brew update # Make sure we’re using the latest Homebrew. + brew upgrade +} + +install_git() { + brew install git +} + +install_bundle() { + brew tap caskroom/cask + + brew install mas + + applications_to_install=( + appcleaner + filezilla + firefox + flux + fork + google-chrome + keepingyouawake + keka + mamp + opera + postman + sequel-pro + skype + slack + spectacle + transmission + visual-studio-code + vlc + ) + + brew cask install "${applications_to_install[@]}" + + mas install 408981434 #iMovie + mas install 409203825 #Numbers + mas install 409201541 #Pages +} + +install_npm_packages() { + npm_packages=( + gulp-cli + webpack + npm-upgrade + ) + + npm install -g "${npm_packages[@]}" +} + +read -ep "${ARROW} Install Homebrew and update it? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Homebrew..." + install_homebrew + + echo "${ARROW} Updating Homebrew formulas..." + update_homebrew +fi + +read -p "${ARROW} Install latest Git version? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Git..." + install_git +fi + +read -p "${ARROW} Configure .bash_profile? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring .bash_profile..." + cp .bash_profile ~ +fi + +read -p "${ARROW} Install bundle of applications? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing applications..." + install_bundle +fi + +read -p "${ARROW} Install nvm (Node Version Manager)? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Node Version Manager..." + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash + source ~/.bash_profile +fi + +read -p "${ARROW} Install Node.js v9.10.0? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Node.js v9.10.0..." + nvm install 9.10.0 +fi + +read -p "${ARROW} Install bundle of npm packages? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing npm packages.." + install_npm_packages +fi + +read -p "${ARROW} Install bundle of Visual Studio Code extensions? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Visual Studio Code extensions..." + code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets +fi + +read -p "${ARROW} Configure Visual Studio Code settings? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring Visual Studio Code..." + cp settings.json /Users/${USER}/Library/Application\ Support/Code/User +fi + +read -p "${ARROW} Configure .gitconfig? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring .gitconfig..." + cp .gitconfig ~ +fi + +read -p "${ARROW} Configure Spectacle app? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring Spectacle..." + cp -r spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null +fi + +read -p "${ARROW} Configure macOS Defaults? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring macOS Defaults..." + . ./api/defaults.sh +fi + +echo -e "\033[0;32m\nCongratulations, installation complete!\033[0m" + +exit 1 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..779695d --- /dev/null +++ b/install.sh @@ -0,0 +1,30 @@ +clear #Clear terminal screen + +LOGO=" __ __ _____ _ +| \/ | / ____| | | +| \ / | __ _ ___ | (___ ___| |_ _ _ _ __ +| |\/| |/ _\` |/ __| \___ \ / _ \ __| | | | '_ \\ +| | | | (_| | (__ ____) | __/ |_| |_| | |_) | +|_| |_|\__,_|\___| |_____/ \___|\__|\__,_| .__/ + | | + |_|" + +echo "$LOGO" # Print logo +echo -e "\n Front end web development setup for macOS \n" # Print title + +PS3=' +Number to execute: ' + +options=("Install" "Quit") +select opt in "${options[@]}" +do + case $opt in + "Install") + . api/install.sh + ;; + "Quit") + break + ;; + *) echo Invalid option!;; + esac +done diff --git a/spectacle.json b/spectacle.json new file mode 100644 index 0000000..2effb7c --- /dev/null +++ b/spectacle.json @@ -0,0 +1,74 @@ +[ + { + "shortcut_key_binding": null, + "shortcut_name": "RedoLastMove" + }, + { + "shortcut_key_binding": null, + "shortcut_name": "MakeSmaller" + }, + { + "shortcut_key_binding": "ctrl+alt+k", + "shortcut_name": "MoveToLowerRight" + }, + { + "shortcut_key_binding": "ctrl+alt+i", + "shortcut_name": "MoveToUpperRight" + }, + { + "shortcut_key_binding": "ctrl+alt+down", + "shortcut_name": "MoveToBottomHalf" + }, + { + "shortcut_key_binding": null, + "shortcut_name": "MoveToNextDisplay" + }, + { + "shortcut_key_binding": "ctrl+alt+up", + "shortcut_name": "MoveToTopHalf" + }, + { + "shortcut_key_binding": "ctrl+alt+j", + "shortcut_name": "MoveToLowerLeft" + }, + { + "shortcut_key_binding": null, + "shortcut_name": "MakeLarger" + }, + { + "shortcut_key_binding": null, + "shortcut_name": "MoveToPreviousDisplay" + }, + { + "shortcut_key_binding": "alt+cmd+z", + "shortcut_name": "UndoLastMove" + }, + { + "shortcut_key_binding": "ctrl+alt+f", + "shortcut_name": "MoveToFullscreen" + }, + { + "shortcut_key_binding": null, + "shortcut_name": "MoveToNextThird" + }, + { + "shortcut_key_binding": "ctrl+alt+left", + "shortcut_name": "MoveToLeftHalf" + }, + { + "shortcut_key_binding": "ctrl+alt+c", + "shortcut_name": "MoveToCenter" + }, + { + "shortcut_key_binding": "ctrl+alt+right", + "shortcut_name": "MoveToRightHalf" + }, + { + "shortcut_key_binding": "ctrl+alt+u", + "shortcut_name": "MoveToUpperLeft" + }, + { + "shortcut_key_binding": null, + "shortcut_name": "MoveToPreviousThird" + } +] From 35a8fc0b3d789cebc9cf0c0f3734e940a4c7850a Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Thu, 3 May 2018 19:58:26 +0200 Subject: [PATCH 12/61] Update installation script --- api/defaults.sh | 221 ++++++++++++++++++++----------------- api/install.sh | 38 +++++-- install.sh => mac-setup.sh | 15 ++- 3 files changed, 159 insertions(+), 115 deletions(-) rename install.sh => mac-setup.sh (54%) diff --git a/api/defaults.sh b/api/defaults.sh index 7fea25a..2918ca4 100755 --- a/api/defaults.sh +++ b/api/defaults.sh @@ -18,70 +18,100 @@ defaults write com.apple.finder FXPreferredViewStyle -string "clmv" # Keep folders on top when sorting by name defaults write com.apple.finder _FXSortFoldersFirst -bool true +# Set 'home directory' as default, new window directory +defaults write com.apple.finder NewWindowTarget -string "PfHm" + +# Disable showing tags +defaults write com.apple.finder ShowRecentTags -int 0 + +################################# +#### SAFARI +################################# + +# Disable auto-fill +defaults write com.apple.Safari AutoFillCreditCardData -int 0 +defaults write com.apple.Safari AutoFillFromAddressBook -int 0 +defaults write com.apple.Safari AutoFillMiscellaneousForms -int 0 +defaults write com.apple.Safari AutoFillPasswords -int 0 + +# Prevent Safari from opening ‘safe’ files automatically after downloading +defaults write com.apple.Safari AutoOpenSafeDownloads -int 0 + +# Remove history after one day +defaults write com.apple.Safari HistoryAgeInDaysLimit -int 1 + +# Prevent Safari from loading "best match" site before opening it +defaults write com.apple.Safari PreloadTopHit -int 0 + +# Enable “Do Not Track” +defaults write com.apple.Safari SendDoNotTrackHTTPHeader -int 1 + +# Show the full URL in the address bar +defaults write com.apple.Safari ShowFullURLInSmartSearchField -int 1 + +# Don’t send search queries to Apple +defaults write com.apple.Safari SuppressSearchSuggestions -int 0 +defaults write com.apple.Safari UniversalSearchEnabled -int 0 +defaults write com.apple.Safari WebsiteSpecificSearchEnabled -int 0 + +# Enable the Develop menu and the Web Inspector in Safari +defaults write com.apple.Safari IncludeDevelopMenu -int 1 +defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -int 1 + ######################################## -#### DOCK, DASHBOARD, GESTURES +#### DOCK ######################################## # Set Dock size -defaults write com.apple.dock tilesize -int 35; killall Dock - -# Reset icons order in Dashboard -defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock +defaults write com.apple.dock tilesize -int 35 # Auto-hide Dock -defaults write "com.apple.dock" autohide -int 1 +defaults write com.apple.dock autohide -int 1 # Disable animations -defaults write "com.apple.dock" launchanim -int 0 - -# Enable Expose gesture (slide down with three fingers) -defaults write "com.apple.dock" showAppExposeGestureEnabled -int 1 +defaults write com.apple.dock launchanim -int 0 # Disable minimizing windows into their application’s icon -defaults write "com.apple.dock" "minimize-to-application" -int 0 +defaults write com.apple.dock minimize-to-application -int 0 # Show indicator lights for open applications in the Dock -defaults write "com.apple.dock" "show-process-indicators" -int 1 - -# Enable the Launchpad gesture (pinch with thumb and three fingers) -defaults write "com.apple.dock" "showLaunchpadGestureEnabled" -int 1 +defaults write com.apple.dock show-process-indicators -int 1 # Change minimize/maximize window effect defaults write com.apple.dock mineffect -string "scale" +# Disable double-click on window's title bar to minimize it +defaults write NSGlobalDomain AppleActionOnDoubleClick None + ################################# #### TRACKPAD ################################# -# Enable tap to click for this user and for the login screen -defaults write "com.apple.AppleMultitouchTrackpad" Clicking -int 1 -defaults write "com.apple.driver.AppleBluetoothMultitouch.trackpad" Clicking -int 1 +# Enable tap to click +defaults write com.apple.AppleMultitouchTrackpad Clicking -int 1 +defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -int 1 # Enable right click (tap with two fingers) -defaults write "com.apple.AppleMultitouchTrackpad" TrackpadRightClick -int 1 -defaults write "com.apple.driver.AppleBluetoothMultitouch.trackpad" TrackpadRightClick -int 1 +defaults write com.apple.AppleMultitouchTrackpad TrackpadRightClick -int 1 +defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -int 1 # Enable application change (swipe horizontal witch three fingers) -defaults write "com.apple.AppleMultitouchTrackpad" TrackpadThreeFingerHorizSwipeGesture -int 2 -defaults write "com.apple.driver.AppleBluetoothMultitouch.trackpad" TrackpadThreeFingerHorizSwipeGesture -int 2 +defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerHorizSwipeGesture -int 2 +defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerHorizSwipeGesture -int 2 + +# Enable the Launchpad gesture (pinch with thumb and three fingers) +defaults write com.apple.dock showLaunchpadGestureEnabled -int 1 + +# Enable Expose gesture (slide down with three fingers) +defaults write com.apple.dock showAppExposeGestureEnabled -int 1 ################################# -#### NSGlobalDomain +#### Keyboard ################################# # Disable press-and-hold for keys in favor of key repeat defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false -# Expand save panel by default -defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true -defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true - -# Save to disk (not to iCloud) by default -defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false - -# Disable automatic capitalization -defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false - # Disable smart dashes defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false @@ -94,107 +124,86 @@ defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false # Disable auto-correct defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false -# Enable Dark Mode -defaults write NSGlobalDomain AppleInterfaceStyle Dark - -# Enable full keyboard access for all controls -# (e.g. enable Tab in modal dialogs) -defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 +# Disable automatic capitalization +defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false # Set keyboard repeat rate defaults write NSGlobalDomain KeyRepeat -int 2 defaults write NSGlobalDomain InitialKeyRepeat -int 15 -# Enable tap to click for the login screeni -defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 - -defaults write NSGlobalDomain AppleActionOnDoubleClick None -defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -int 0 -defaults write NSGlobalDomain NSCloseAlwaysConfirmsChanges -int 1 -defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -int 0 -defaults write NSGlobalDomain com.apple.sound.beep.sound -string "/System/Library/Sounds/Funk.aiff" -defaults write NSGlobalDomain userMenuExtraStyle -int 2 +# Enable full keyboard access for all controls +# (e.g. enable Tab in modal dialogs) +defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 ################################# #### Other ################################# +# Disable transparency +defaults write com.apple.universalaccess reduceTransparency -bool true + +# Use plain text mode for new TextEdit documents +defaults write com.apple.TextEdit RichText -int 0 + +# Disable spelling check in TextEdit documents +defaults write com.apple.TextEdit CheckSpellingWhileTyping -int 0 + +# Expand save panel by default +defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true +defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true + +# Save to disk (not to iCloud) by default +defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false + +# Enable Dark Mode +defaults write NSGlobalDomain AppleInterfaceStyle Dark + +# Reset icons order in Dashboard +defaults write com.apple.dock ResetLaunchPad -bool true + # Show battery percentage in Menu Bar -defaults write com.apple.menuextra.battery -bool true +defaults write com.apple.menuextra.battery ShowPercent YES -# Use 'Flat' terminal profile -defaults write com.apple.Terminal "Default Window Settings" Flat -defaults write com.apple.Terminal "Startup Window Settings" Flat +# Close windows then quitting an app +defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -int 0 -# Disable the sound effects on boot -sudo nvram SystemAudioVolume=" " +# Ask to kepp change when closing documents +defaults write NSGlobalDomain NSCloseAlwaysConfirmsChanges -int 1 -# Configure Flux -defaults write org.herf.Flux location "52.223033,18.251073" -defaults write org.herf.Flux locationTextField "Konin" - -# Ddisable some Spotlight search results -defaults write com.apple.spotlight orderedItems -array \ - '{"enabled" = 1;"name" = "APPLICATIONS";}' \ - '{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}' \ - '{"enabled" = 0;"name" = "MENU_CONVERSION";}' \ - '{"enabled" = 0;"name" = "MENU_EXPRESSION";}' \ - '{"enabled" = 0;"name" = "MENU_DEFINITION";}' \ - '{"enabled" = 0;"name" = "SYSTEM_PREFS";}' \ - '{"enabled" = 0;"name" = "DOCUMENTS";}' \ - '{"enabled" = 0;"name" = "DIRECTORIES";}' \ - '{"enabled" = 0;"name" = "PRESENTATIONS";}' \ - '{"enabled" = 0;"name" = "SPREADSHEETS";}' \ - '{"enabled" = 0;"name" = "PDF";}' \ - '{"enabled" = 0;"name" = "MESSAGES";}' \ - '{"enabled" = 0;"name" = "CONTACT";}' \ - '{"enabled" = 0;"name" = "EVENT_TODO";}' \ - '{"enabled" = 0;"name" = "IMAGES";}' \ - '{"enabled" = 0;"name" = "BOOKMARKS";}' \ - '{"enabled" = 0;"name" = "MUSIC";}' \ - '{"enabled" = 0;"name" = "MOVIES";}' \ - '{"enabled" = 0;"name" = "FONTS";}' \ - '{"enabled" = 0;"name" = "MENU_OTHER";}' +# Set up alert sound +defaults write NSGlobalDomain com.apple.sound.beep.sound -string "/System/Library/Sounds/Funk.aiff" + +defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -int 0 +# Show fast user switching menu as: icon +# TODO: first enable switching user +defaults write NSGlobalDomain userMenuExtraStyle -int 2 + +# Set up date format in menubar +defaults write "com.apple.menuextra.clock" DateFormat -string "EEE d.MM HH:mm" +defaults write "com.apple.systemuiserver" DateFormat -string "EEE d.MM HH:mm" # Enable snap-to-grid for icons on the desktop and in other icon views /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist +# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist # Decrease grid spacing for icons on the desktop and in other icon views /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 20" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 20" ~/Library/Preferences/com.apple.finder.plist +# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 20" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 20" ~/Library/Preferences/com.apple.finder.plist # Decrease the size of icons on the desktop and in other icon views /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist +# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist # Disable icons preview on the desktop and in other icon views /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist +# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist -# Disable transparency in the menu bar and elsewhere on Yosemite -defaults write com.apple.universalaccess reduceTransparency -bool true - -# Require password immediately after sleep or screen saver begins -defaults write com.apple.screensaver askForPassword -int 1 -defaults write com.apple.screensaver askForPasswordDelay -int 0 - -# Use plain text mode for new TextEdit documents -defaults write com.apple.TextEdit RichText -int 0 - -# Disable spelling check in TextEdit documents -defaults write com.apple.TextEdit CheckSpellingWhileTyping -int 0 - -# Set up date format in menubar -defaults write "com.apple.menuextra.clock" DateFormat -string "EEE d.MM HH:mm" -defaults write "com.apple.systemuiserver" DateFormat -string "EEE d.MM HH:mm" - -## Order of menu bar icons +# Set order of menu bar icons defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.bluetooth" -int 489 defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.airport" -int 435 defaults write "org.herf.Flux" "NSStatusItem Preferred Position Item-0" -float 408.5 @@ -213,6 +222,14 @@ defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuex defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.volume" -int 1 defaults write "com.apple.systemuiserver" menuExtras -array "/System/Library/CoreServices/Menu Extras/Clock.menu" "/System/Library/CoreServices/Menu Extras/AirPort.menu" "/System/Library/CoreServices/Menu Extras/User.menu" "/System/Library/CoreServices/Menu Extras/Battery.menu" "/System/Library/CoreServices/Menu Extras/Volume.menu" "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" +# Disable the sound effects on boot +sudo nvram SystemAudioVolume=" " + +# Set computer name +sudo scutil --set ComputerName "mba" +sudo scutil --set HostName "mba" +sudo scutil --set LocalHostName "mba" + applications_to_kill=( "Activity Monitor" "Dock" diff --git a/api/install.sh b/api/install.sh index 8086619..172800a 100644 --- a/api/install.sh +++ b/api/install.sh @@ -1,11 +1,11 @@ -clear #Clear terminal screen +clear -ARROW=$(tput setaf 6; echo -n '=>'; tput sgr0;) +ARROW=$(tput bold)$(tput setaf 6; echo -n '==>'; tput sgr0;) echo "Welcome to the installer!" echo -e "First, introduce your password to execute all the commands as super user. \n" -echo -e "\033[0;31mNote:\033[0m You can be asked more times for password during the process. Also, during" -echo "instalation of some applications You may be required to log in to Mac App Store." +echo -e "\033[1;31mImportant:\033[0m You can be asked more times for password during the process." +echo "Also, make sure that You are logged in to the Mac App Store." echo sudo -v @@ -20,7 +20,7 @@ install_homebrew() { } update_homebrew() { - brew update # Make sure we’re using the latest Homebrew. + brew update brew upgrade } @@ -40,6 +40,7 @@ install_bundle() { flux fork google-chrome + kap keepingyouawake keka mamp @@ -50,6 +51,7 @@ install_bundle() { slack spectacle transmission + tunnelblick visual-studio-code vlc ) @@ -100,6 +102,16 @@ read -p "${ARROW} Install bundle of applications? [y/n]: " if [ "$REPLY" == "y" ]; then echo "${ARROW} Installing applications..." install_bundle + echo "${ARROW} Installing applications..." + open /Applications/Flux.app + open /Applications/Spectacle.app +fi + +read -p "${ARROW} Configure Terminal profile? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo -e "\033[1;33mNote:\033[0m New Terminal window opened. Click 'Shell' > 'Use settings as default' to use it as default profile." + open ./Flat.terminal fi read -p "${ARROW} Install nvm (Node Version Manager)? [y/n]: " @@ -145,13 +157,23 @@ if [ "$REPLY" == "y" ]; then cp .gitconfig ~ fi -read -p "${ARROW} Configure Spectacle app? [y/n]: " +read -p "${ARROW} Configure Spectacle shotrcuts? [y/n]: " if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring Spectacle..." + echo "${ARROW} Configuring Spectacle shotrcuts..." cp -r spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null fi +read -p "${ARROW} Set up firmware password? [y/n]: " + +if [ "$REPLY" == "y" ]; then + if [[ $(sudo firmwarepasswd -check) =~ "Password Enabled: Yes" ]]; then + echo "Firmware password is already set up!" + else + sudo firmwarepasswd -setpasswd -setmode command + fi +fi + read -p "${ARROW} Configure macOS Defaults? [y/n]: " if [ "$REPLY" == "y" ]; then @@ -159,6 +181,6 @@ if [ "$REPLY" == "y" ]; then . ./api/defaults.sh fi -echo -e "\033[0;32m\nCongratulations, installation complete!\033[0m" +echo -e "\033[1;33m\nNote:\033[0m Some changes may need system restart to be applied!\n\033[1;32m\nCongratulations, installation complete!\033[0m" exit 1 diff --git a/install.sh b/mac-setup.sh similarity index 54% rename from install.sh rename to mac-setup.sh index 779695d..080245e 100755 --- a/install.sh +++ b/mac-setup.sh @@ -1,16 +1,21 @@ -clear #Clear terminal screen +clear -LOGO=" __ __ _____ _ +LOGO="\033[1;36m __ __ _____ _ | \/ | / ____| | | | \ / | __ _ ___ | (___ ___| |_ _ _ _ __ | |\/| |/ _\` |/ __| \___ \ / _ \ __| | | | '_ \\ | | | | (_| | (__ ____) | __/ |_| |_| | |_) | |_| |_|\__,_|\___| |_____/ \___|\__|\__,_| .__/ | | - |_|" + |_|\033[0m" -echo "$LOGO" # Print logo -echo -e "\n Front end web development setup for macOS \n" # Print title +echo -e "$LOGO" + +echo -e "\033[1;36m\n Front end web development setup for macOS\n" +echo -e "------------------------------------------------\033[0m" +echo -e " " +echo -e " " +echo -e "\033[1;36m------------------------------------------------\033[0m\n" PS3=' Number to execute: ' From 1f262aa704c7aeb43783bf0a12754c8129a9bcf6 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Thu, 3 May 2018 21:16:12 +0200 Subject: [PATCH 13/61] Add 'Kap' and 'Tunnelblick' --- Brewfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Brewfile b/Brewfile index c466eb1..ba829b6 100755 --- a/Brewfile +++ b/Brewfile @@ -9,6 +9,7 @@ cask 'firefox' cask 'flux' cask 'fork' cask 'google-chrome' +cask 'kap' cask 'keepingyouawake' cask 'keka' cask 'mamp' @@ -19,6 +20,7 @@ cask 'skype' cask 'slack' cask 'spectacle' cask 'transmission' +cask 'tunnelblick' cask 'visual-studio-code' cask 'vlc' From e5a481daae486f5f68b4da936db35b386edd5c73 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Thu, 3 May 2018 21:16:37 +0200 Subject: [PATCH 14/61] Update README.md --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index af89aa1..e61994f 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ This document describes how I set up front end web development environment on my ## Table of Contents +- [Installation](#installation) - [System Preferences](#system-preferences) - [Terminal](#terminal) - [Bash](#bash) @@ -43,6 +44,24 @@ This document describes how I set up front end web development environment on my --- +## Installation + +You can follow the instructions below or use shell script to configure settings automatically. +How to automatically configure Mac? There are two options: + +- clone/download the repository into your computer and then execute ```mac-setup.sh``` script, +- one line installation - open your terminal and paste the following code: + +```shell +$ curl -L https://github.com/appalaszynski/mac-setup/archive/master.tar.gz | tar -xvz; cd mac-setup-master; chmod +x mac-setup.sh; ./mac-setup.sh +``` + +
+ +
+ +--- + ## System Preferences After clean install of operating system, there are a couple tweaks I like to make to the System Preferences. Some of them are not strictly related to web development enviroment - I use them because of my personal habits. @@ -103,6 +122,8 @@ Setting a firmware password prevents your Mac from starting up from any device o $ firmwarepasswd -setpasswd -setmode command ``` +You can find a lot more settings in [defaults.sh](https://github.com/appalaszynski/mac-setup/blob/master/api/defaults.sh). + --- ## Terminal @@ -193,6 +214,7 @@ Here are all the programs I install with a brief description. - [Flux](https://justgetflux.com) - screen color temperature adjusting app - [Fork](https://git-fork.com) - Git GUI client - [Google Chrome](https://www.google.pl/chrome/browser/desktop/index.html) - web browser +- [Kap](https://getkap.co/) - screen recorder - [KeepingYouAwake](https://github.com/newmarcel/KeepingYouAwake) - app which prevents Mac from entering sleep mode - [Keka](http://www.kekaosx.com) - file archiver - [MAMP](https://www.mamp.info/en/) - Apache, MySQL and PHP package @@ -203,6 +225,7 @@ Here are all the programs I install with a brief description. - [Slack](https://slack.com) - team collaboration tools - [Spectacle](https://www.spectacleapp.com) - window manager - [Transmission](https://transmissionbt.com) - BitTorrent client +- [Tunnelblick](https://tunnelblick.net/) - GUI for OpenVPN - [Visual Studio Code](https://code.visualstudio.com) - code editor - [VLC](https://www.videolan.org/vlc/) - media player - [iMovie](https://www.apple.com/imovie/) - video editor @@ -223,6 +246,7 @@ cask 'firefox' cask 'flux' cask 'fork' cask 'google-chrome' +cask 'kap' cask 'keepingyouawake' cask 'keka' cask 'mamp' @@ -233,6 +257,7 @@ cask 'skype' cask 'slack' cask 'spectacle' cask 'transmission' +cask 'tunnelblick' cask 'visual-studio-code' cask 'vlc' From efd239c03d09f1e9df9c6ffca7cd203d93575426 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 6 May 2018 19:19:53 +0200 Subject: [PATCH 15/61] Typo --- api/defaults.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/defaults.sh b/api/defaults.sh index 2918ca4..e01b0ee 100755 --- a/api/defaults.sh +++ b/api/defaults.sh @@ -106,7 +106,7 @@ defaults write com.apple.dock showLaunchpadGestureEnabled -int 1 defaults write com.apple.dock showAppExposeGestureEnabled -int 1 ################################# -#### Keyboard +#### KEYBOARD ################################# # Disable press-and-hold for keys in favor of key repeat @@ -136,7 +136,7 @@ defaults write NSGlobalDomain InitialKeyRepeat -int 15 defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 ################################# -#### Other +#### OTHER ################################# # Disable transparency From 8a174c73904be40c2aeb9907c75f8fcbe9d33bdc Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 23 May 2018 14:28:02 +0200 Subject: [PATCH 16/61] .bash_profile: Add comments, make file easier to read --- .bash_profile | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.bash_profile b/.bash_profile index 6407823..ca67072 100755 --- a/.bash_profile +++ b/.bash_profile @@ -1,12 +1,27 @@ +# Update Homebrew itself, upgrade all packages, remove dead symlinks, remove old versions +# of installed formulas, clean old downloads from cache, remove versions of formulas, which +# are downloaded, but not installed, check system for potential problems, remove cached +# Homebrew-Cask downloads alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' + +# Remove bash history and exit bash shell alias rmhis='rm .bash_history; history -c; logout' + +# Easier navigation alias ..="cd .." +alias ....="cd ../.." + +# Shortcuts alias p="cd ~/Projects" alias d="cd ~/Desktop" +# Enable ANSI colors sequences to distinguish file types export CLICOLOR=1 + +# Value of this variable describes what color to use for which attribute export LSCOLORS=GxFxCxDxBxegedabagaced +# Color definitions RED='\[\033[1;31m\]' GREEN='\[\033[1;32m\]' YELLOW='\[\033[1;33m\]' @@ -14,8 +29,21 @@ PURPLE='\[\033[1;35m\]' GRAY='\[\033[1;30m\]' DEFAULT='\[\033[0m\]' +# Function which current Git branch name from 'git branch' command parse_git_branch() { - git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' + git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } -export PS1="${RED}\u ${GRAY}• ${GREEN}\h ${GRAY}• ${YELLOW}\w${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" •\")${PURPLE}\$(parse_git_branch)\n${GRAY}\$ ${DEFAULT}" +# Set up prompt +PS1="${RED}\u" # Username +PS1+=" ${GRAY}• " # Separator +PS1+="${GREEN}\h" # Hostname +PS1+=" ${GRAY}• " # Seprataor +PS1+="${YELLOW}\w" # Working directory +PS1+=" ${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \"•\") " # Separator +PS1+="${PURPLE}\$(parse_git_branch)" # Git branch +PS1+="\n" # New line +PS1+="${GRAY}\$ " # Dollar sign +PS1+="${DEFAULT}" # Get back default color + +export PS1; From 2e5214d6ea35a349421e0ff36023d323e99baf99 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 23 May 2018 16:23:17 +0200 Subject: [PATCH 17/61] defaults.sh: Remove not working commands --- api/defaults.sh | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/api/defaults.sh b/api/defaults.sh index e01b0ee..dede653 100755 --- a/api/defaults.sh +++ b/api/defaults.sh @@ -11,10 +11,6 @@ defaults write com.apple.finder ShowPathbar -bool true # When performing a search, search the current folder by default defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" -# Always open everything in Finder's columns view. -# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`, 'Nlsv' -defaults write com.apple.finder FXPreferredViewStyle -string "clmv" - # Keep folders on top when sorting by name defaults write com.apple.finder _FXSortFoldersFirst -bool true @@ -123,6 +119,7 @@ defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false # Disable auto-correct defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false +defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -int 0 # Disable automatic capitalization defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false @@ -152,9 +149,6 @@ defaults write com.apple.TextEdit CheckSpellingWhileTyping -int 0 defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true -# Save to disk (not to iCloud) by default -defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false - # Enable Dark Mode defaults write NSGlobalDomain AppleInterfaceStyle Dark @@ -175,44 +169,32 @@ defaults write NSGlobalDomain com.apple.sound.beep.sound -string "/System/Librar defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -int 0 -# Show fast user switching menu as: icon -# TODO: first enable switching user -defaults write NSGlobalDomain userMenuExtraStyle -int 2 - # Set up date format in menubar defaults write "com.apple.menuextra.clock" DateFormat -string "EEE d.MM HH:mm" defaults write "com.apple.systemuiserver" DateFormat -string "EEE d.MM HH:mm" # Enable snap-to-grid for icons on the desktop and in other icon views /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist -# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist # Decrease grid spacing for icons on the desktop and in other icon views -/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 20" ~/Library/Preferences/com.apple.finder.plist -# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 20" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 20" ~/Library/Preferences/com.apple.finder.plist +/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 15" ~/Library/Preferences/com.apple.finder.plist +/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 15" ~/Library/Preferences/com.apple.finder.plist # Decrease the size of icons on the desktop and in other icon views /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist -# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist # Disable icons preview on the desktop and in other icon views /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist -# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist # Set order of menu bar icons defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.bluetooth" -int 489 defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.airport" -int 435 -defaults write "org.herf.Flux" "NSStatusItem Preferred Position Item-0" -float 408.5 -defaults write "com.divisiblebyzero.Spectacle" "NSStatusItem Preferred Position Item-0" -int 383 -defaults write "info.marcel-dierkes.KeepingYouAwake" "NSStatusItem Preferred Position Item-0" -int 354 defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.volume" -int 324 defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.battery" -int 273 defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.clock" -int 179 -defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.appleuser" -string "101.5" defaults write "com.apple.systemuiserver" "NSStatusItem Visible Siri" -int 0 defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.airport" -int 1 defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.appleuser" -int 1 @@ -220,15 +202,10 @@ defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuex defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.bluetooth" -int 1 defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.clock" -int 1 defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.volume" -int 1 -defaults write "com.apple.systemuiserver" menuExtras -array "/System/Library/CoreServices/Menu Extras/Clock.menu" "/System/Library/CoreServices/Menu Extras/AirPort.menu" "/System/Library/CoreServices/Menu Extras/User.menu" "/System/Library/CoreServices/Menu Extras/Battery.menu" "/System/Library/CoreServices/Menu Extras/Volume.menu" "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" +defaults write "com.apple.systemuiserver" menuExtras -array "/System/Library/CoreServices/Menu Extras/Clock.menu" "/System/Library/CoreServices/Menu Extras/AirPort.menu" "/System/Library/CoreServices/Menu Extras/Battery.menu" "/System/Library/CoreServices/Menu Extras/Volume.menu" "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" # Disable the sound effects on boot -sudo nvram SystemAudioVolume=" " - -# Set computer name -sudo scutil --set ComputerName "mba" -sudo scutil --set HostName "mba" -sudo scutil --set LocalHostName "mba" +sudo nvram SystemAudioVolume=0 applications_to_kill=( "Activity Monitor" From fa15b86c5c5fab7c077ccade23abbc04cea7600b Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 23 May 2018 17:14:28 +0200 Subject: [PATCH 18/61] install.sh: Improve UX --- api/install.sh | 213 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 153 insertions(+), 60 deletions(-) diff --git a/api/install.sh b/api/install.sh index 172800a..6b9bf47 100644 --- a/api/install.sh +++ b/api/install.sh @@ -2,6 +2,26 @@ clear ARROW=$(tput bold)$(tput setaf 6; echo -n '==>'; tput sgr0;) +IS_HOMEBREW_INSTALLED=false +if hash brew 2>/dev/null; then + IS_HOMEBREW_INSTALLED=true +fi + +IS_NVM_INSTALLED=false +if ! [ -x "$(command -v nvm)" ]; then + IS_NVM_INSTALLED=true +fi + +IS_NODE_INSTALLED=false +if hash node 2>/dev/null; then + IS_NODE_INSTALLED=true +fi + +IS_VSCODE_INSTALLED=false +if hash code 2>/dev/null; then + IS_VSCODE_INSTALLED=true +fi + echo "Welcome to the installer!" echo -e "First, introduce your password to execute all the commands as super user. \n" echo -e "\033[1;31mImportant:\033[0m You can be asked more times for password during the process." @@ -11,23 +31,6 @@ echo sudo -v while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & -install_homebrew() { - if hash brew 2>/dev/null; then - echo "Homebrew already installed!" - else - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - fi -} - -update_homebrew() { - brew update - brew upgrade -} - -install_git() { - brew install git -} - install_bundle() { brew tap caskroom/cask @@ -73,23 +76,41 @@ install_npm_packages() { npm install -g "${npm_packages[@]}" } -read -ep "${ARROW} Install Homebrew and update it? [y/n]: " +#---------------------------- +# Homebrew +#---------------------------- +if $IS_HOMEBREW_INSTALLED; then + echo "${ARROW} Homebrew already installed!" +else + read -ep "${ARROW} Install Homebrew and update it? [y/n]: " -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Homebrew..." - install_homebrew + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Homebrew..." + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + + echo "${ARROW} Updating Homebrew formulas..." + brew update + brew upgrade - echo "${ARROW} Updating Homebrew formulas..." - update_homebrew + IS_HOMEBREW_INSTALLED=true + fi fi -read -p "${ARROW} Install latest Git version? [y/n]: " +#---------------------------- +# Git +#---------------------------- +if $IS_HOMEBREW_INSTALLED; then + read -p "${ARROW} Install latest Git version via Homebrew? [y/n]: " -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Git..." - install_git + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Git..." + brew install git + fi fi +#---------------------------- +# .bash_profile +#---------------------------- read -p "${ARROW} Configure .bash_profile? [y/n]: " if [ "$REPLY" == "y" ]; then @@ -97,16 +118,25 @@ if [ "$REPLY" == "y" ]; then cp .bash_profile ~ fi -read -p "${ARROW} Install bundle of applications? [y/n]: " +#---------------------------- +# Application bundle +#---------------------------- +if $IS_HOMEBREW_INSTALLED; then + read -p "${ARROW} Install bundle of applications via Homebrew-Cask? [y/n]: " -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing applications..." - install_bundle - echo "${ARROW} Installing applications..." - open /Applications/Flux.app - open /Applications/Spectacle.app + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing applications..." + install_bundle + + open /Applications/Flux.app + open /Applications/Spectacle.app + open /Applications/KeepingYouAwake.app + fi fi +#---------------------------- +# Terminal profile +#---------------------------- read -p "${ARROW} Configure Terminal profile? [y/n]: " if [ "$REPLY" == "y" ]; then @@ -114,42 +144,81 @@ if [ "$REPLY" == "y" ]; then open ./Flat.terminal fi -read -p "${ARROW} Install nvm (Node Version Manager)? [y/n]: " +#---------------------------- +# Node Version Manager +#---------------------------- +if $IS_NVM_INSTALLED; then + echo "${ARROW} Node Version Manager already installed!" +else + read -p "${ARROW} Install nvm (Node Version Manager)? [y/n]: " -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Node Version Manager..." - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash - source ~/.bash_profile + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Node Version Manager..." + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash + source ~/.bash_profile + + IS_NVM_INSTALLED=true + fi fi -read -p "${ARROW} Install Node.js v9.10.0? [y/n]: " +#---------------------------- +# Node.js +#---------------------------- +if $IS_NODE_INSTALLED; then + echo "${ARROW} Node.js already installed!" +else + if [ $IS_NVM_INSTALLED == true ]; then + read -p "${ARROW} Install Node.js v9.10.0? [y/n]: " -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Node.js v9.10.0..." - nvm install 9.10.0 + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Node.js v9.10.0..." + nvm install 9.10.0 + + IS_NODE_INSTALLED=true + fi + fi fi -read -p "${ARROW} Install bundle of npm packages? [y/n]: " +#---------------------------- +# Npm packages +#---------------------------- +if $IS_NODE_INSTALLED; then + read -p "${ARROW} Install bundle of npm packages? [y/n]: " -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing npm packages.." - install_npm_packages + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing npm packages.." + install_npm_packages + fi fi -read -p "${ARROW} Install bundle of Visual Studio Code extensions? [y/n]: " +#---------------------------- +# VSCode extensions +#---------------------------- +if $IS_VSCODE_INSTALLED; then + read -p "${ARROW} Install bundle of Visual Studio Code extensions? [y/n]: " -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Visual Studio Code extensions..." - code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Visual Studio Code extensions..." + code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets + fi fi -read -p "${ARROW} Configure Visual Studio Code settings? [y/n]: " +#---------------------------- +# VSCode Settings +#---------------------------- +if $IS_VSCODE_INSTALLED; then + read -p "${ARROW} Configure Visual Studio Code settings? [y/n]: " -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring Visual Studio Code..." - cp settings.json /Users/${USER}/Library/Application\ Support/Code/User + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring Visual Studio Code..." + cp settings.json /Users/${USER}/Library/Application\ Support/Code/User + fi fi +#---------------------------- +# .gitconfig +#---------------------------- + read -p "${ARROW} Configure .gitconfig? [y/n]: " if [ "$REPLY" == "y" ]; then @@ -157,6 +226,10 @@ if [ "$REPLY" == "y" ]; then cp .gitconfig ~ fi +#---------------------------- +# Spectacle shortcuts +#---------------------------- + read -p "${ARROW} Configure Spectacle shotrcuts? [y/n]: " if [ "$REPLY" == "y" ]; then @@ -164,16 +237,36 @@ if [ "$REPLY" == "y" ]; then cp -r spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null fi -read -p "${ARROW} Set up firmware password? [y/n]: " +#---------------------------- +# Firmware password +#---------------------------- +if [[ $(sudo firmwarepasswd -check) =~ "Password Enabled: Yes" ]]; then + echo "${ARROW} Firmware password is already set up!" +else + read -p "${ARROW} Set up firmware password? [y/n]: " -if [ "$REPLY" == "y" ]; then - if [[ $(sudo firmwarepasswd -check) =~ "Password Enabled: Yes" ]]; then - echo "Firmware password is already set up!" - else + if [ "$REPLY" == "y" ]; then sudo firmwarepasswd -setpasswd -setmode command fi fi +#---------------------------- +# Computer name +#---------------------------- +read -p "${ARROW} Set computer name? [y/n]: " + +if [ "$REPLY" == "y" ]; then + read -p 'Please enter computer name: ' uservar + + sudo scutil --set ComputerName $uservar + sudo scutil --set HostName $uservar + sudo scutil --set LocalHostName $uservar +fi + +#---------------------------- +# macOS Defaults +#---------------------------- + read -p "${ARROW} Configure macOS Defaults? [y/n]: " if [ "$REPLY" == "y" ]; then From a2d5d0a80db58e8347e30dda8452a1299a03a8d9 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 23 May 2018 17:17:15 +0200 Subject: [PATCH 19/61] Update README.md --- README.md | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e61994f..cffb503 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ This document describes how I set up front end web development environment on my ## Installation You can follow the instructions below or use shell script to configure settings automatically. -How to automatically configure Mac? There are two options: +There are two ways to do it: - clone/download the repository into your computer and then execute ```mac-setup.sh``` script, - one line installation - open your terminal and paste the following code: @@ -57,7 +57,7 @@ $ curl -L https://github.com/appalaszynski/mac-setup/archive/master.tar.gz | tar ```
- +
--- @@ -141,18 +141,30 @@ To use it as default profile open downloaded `Flat.terminal` file and click **Sh ## Bash ```shell -# Aliases +# Update Homebrew itself, upgrade all packages, remove dead symlinks, remove old versions +# of installed formulas, clean old downloads from cache, remove versions of formulas, which +# are downloaded, but not installed, check system for potential problems, remove cached +# Homebrew-Cask downloads alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' + +# Remove bash history and exit bash shell alias rmhis='rm .bash_history; history -c; logout' + +# Easier navigation alias ..="cd .." +alias ....="cd ../.." + +# Shortcuts alias p="cd ~/Projects" alias d="cd ~/Desktop" -# Colors for `ls` command output +# Enable ANSI colors sequences to distinguish file types export CLICOLOR=1 + +# Value of this variable describes what color to use for which attribute export LSCOLORS=GxFxCxDxBxegedabagaced -# Colors used in prompt +# Color definitions RED='\[\033[1;31m\]' GREEN='\[\033[1;32m\]' YELLOW='\[\033[1;33m\]' @@ -160,16 +172,27 @@ PURPLE='\[\033[1;35m\]' GRAY='\[\033[1;30m\]' DEFAULT='\[\033[0m\]' -# Function used in prompt, displaying current Git branch +# Function which current Git branch name from 'git branch' command parse_git_branch() { - git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' + git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } -# Prompt -export PS1="${RED}\u ${GRAY}• ${GREEN}\h ${GRAY}• ${YELLOW}\w${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" •\")${PURPLE}\$(parse_git_branch)\n${GRAY}\$ ${DEFAULT}" +# Set up prompt +PS1="${RED}\u" # Username +PS1+=" ${GRAY}• " # Separator +PS1+="${GREEN}\h" # Hostname +PS1+=" ${GRAY}• " # Seprataor +PS1+="${YELLOW}\w" # Working directory +PS1+=" ${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \"•\") " # Separator +PS1+="${PURPLE}\$(parse_git_branch)" # Git branch +PS1+="\n" # New line +PS1+="${GRAY}\$ " # Dollar sign +PS1+="${DEFAULT}" # Get back default color + +export PS1; ``` -In my `.bash_profile` file I create, among others, a `brewup` alias to keep Homebrew (which we are going to install in a second) up to date and `rmhis` to remove bash history. I also set color scheme for `ls` command output and for custom prompt which contains username, computer name, working directory and current Git branch. +In my `.bash_profile` file I create, among others, a `brewup` alias to keep Homebrew (which we are going to install in a second) up to date. I also set color scheme for `ls` command output and for custom prompt which contains username, computer name, working directory and current Git branch. To download `.bash_profile` and execute its content, use: @@ -278,13 +301,13 @@ To download my `Brewfile` file type: $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/Brewfile ``` -To install listed applications use: +To install applications listed in `Brewfile` use: ```shell $ brew bundle ``` -in directory that contains `Brewfile` file. +in directory that contains `Brewfile`. --- @@ -374,6 +397,7 @@ For main development I use Google Chrome. - [uBlock Origin](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm) - block ads - [Privacy Badger](https://chrome.google.com/webstore/detail/privacy-badger/pkehgijcmpdhfbdbbnkijodmdjhbjlgp) - block spying ads and invisible trackers - [Nano Defender](https://chrome.google.com/webstore/detail/nano-defender/ggolfgbegefeeoocgjbmkembbncoadlb) - anti-adblock defuser +- [HTTPS Everywhere](https://chrome.google.com/webstore/detail/https-everywhere/gcbommkclmclpchllfjekcdonpmejbdp?hl=pl) - automatically switch from "http" to "https" - [JSONView](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc) - validate and view JSON documents - [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) - inspect component hierarchies and states - [Redux DevTools](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) - debug state changes From 3dac28c83f92bfdc1c30beccf19f92d5fc7ca0b9 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 3 Jun 2018 23:04:28 +0200 Subject: [PATCH 20/61] Switch Node.js from 9.10.0 to latest LTS --- api/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/install.sh b/api/install.sh index 6b9bf47..457c404 100644 --- a/api/install.sh +++ b/api/install.sh @@ -168,11 +168,11 @@ if $IS_NODE_INSTALLED; then echo "${ARROW} Node.js already installed!" else if [ $IS_NVM_INSTALLED == true ]; then - read -p "${ARROW} Install Node.js v9.10.0? [y/n]: " + read -p "${ARROW} Install latest LTS version of Node.js? [y/n]: " if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Node.js v9.10.0..." - nvm install 9.10.0 + echo "${ARROW} Installing Node.js..." + nvm install --lts IS_NODE_INSTALLED=true fi From 76d17743e040c0b36d310b1c4d684c1aec533264 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 3 Jun 2018 23:05:06 +0200 Subject: [PATCH 21/61] Add Pesticide Google Chrome extension --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cffb503..c93aa53 100644 --- a/README.md +++ b/README.md @@ -401,6 +401,7 @@ For main development I use Google Chrome. - [JSONView](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc) - validate and view JSON documents - [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) - inspect component hierarchies and states - [Redux DevTools](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) - debug state changes +- [Pesticide](https://chrome.google.com/webstore/detail/pesticide-for-chrome/bblbgcheenepgnnajgfpiicnbbdmmooh) - toggle different colored outlines on every element for quick CSS layout debug --- From d8fb95f3a37eb10a783cafd453eddccb6654b71a Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Thu, 7 Jun 2018 16:25:08 +0200 Subject: [PATCH 22/61] Update macOS version to 10.13.5 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c93aa53..d21bde9 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@
- + @@ -25,7 +25,7 @@
-This document describes how I set up front end web development environment on my MacBook Air with macOS High Sierra 10.13.4. +This document describes how I set up front end web development environment on my MacBook Air with macOS High Sierra 10.13.5. --- From e2bf56bd813982ef32b0de7ffd467eedc12d440c Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Thu, 7 Jun 2018 16:27:25 +0200 Subject: [PATCH 23/61] defaults.sh: Remove not working command --- api/defaults.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/api/defaults.sh b/api/defaults.sh index dede653..8da3053 100755 --- a/api/defaults.sh +++ b/api/defaults.sh @@ -204,9 +204,6 @@ defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuex defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.volume" -int 1 defaults write "com.apple.systemuiserver" menuExtras -array "/System/Library/CoreServices/Menu Extras/Clock.menu" "/System/Library/CoreServices/Menu Extras/AirPort.menu" "/System/Library/CoreServices/Menu Extras/Battery.menu" "/System/Library/CoreServices/Menu Extras/Volume.menu" "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" -# Disable the sound effects on boot -sudo nvram SystemAudioVolume=0 - applications_to_kill=( "Activity Monitor" "Dock" From 927c9574651ac4b45b84eaa2c960c93a52883b59 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Thu, 7 Jun 2018 16:48:35 +0200 Subject: [PATCH 24/61] Add GitHub SSH authentication --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index d21bde9..5ae20f2 100644 --- a/README.md +++ b/README.md @@ -342,6 +342,37 @@ $ open .gitconfig Here I set my name, email, GitHub username, core editor and connect Git to the macOS Keychain so I don’t have to type my username and password every time I want to push to GitHub. +### SSH + +You can also authenticate GiHub using SSH public key. You must generate one if they don’t already have one. To do is use following code: + +```shell +$ ssh-keygen -t rsa -b 4096 -C "your_email_used_in_github@example.com" +``` + +but first make sure that htere is a `~/.ssh` directory on your computer. + +Above command will create private key (`id_rsa`) and public key (`id_rsa.pub`) in `~/.ssh` directory. +Next add your newly created SSH key to the ssh-agent to be able to manage your keys. + +```shell +$ ssh-add +``` + +Now just login into your Github account and paste content of `id_rsa.pub` file in **Settings** > **SSH and GPG keys** > **New SSH key**. + +After you've set up your SSH key and added it to your GitHub account, you can test your connection. Open Terminal and paste following code: + +```shell +$ ssh -T git@github.com +``` + +After verifying figerprint by typing `yes` you should see following message: + +```shell +Hi ! You've successfully authenticated, but GitHub does not provide shell access. +``` + --- ## Node.js From 7bf8923ad58d3f868c889383fe2bf15d177caa61 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Sat, 9 Jun 2018 15:54:05 +0200 Subject: [PATCH 25/61] Fix spelling --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5ae20f2..d91fd24 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ $ curl -L https://github.com/appalaszynski/mac-setup/archive/master.tar.gz | tar ## System Preferences -After clean install of operating system, there are a couple tweaks I like to make to the System Preferences. Some of them are not strictly related to web development enviroment - I use them because of my personal habits. +After a clean install of operating system, there are a couple tweaks I like to make to the System Preferences. Some of them are not strictly related to web development environment - I use them because of my personal habits. - General > User dark menu bar and Dock @@ -128,7 +128,7 @@ You can find a lot more settings in [defaults.sh](https://github.com/appalaszyns ## Terminal -I use my custom Terminal profile called **Flat**. You can download it by typing: +I use my custom Terminal profile which I called **Flat**. You can download it by typing: ```shell $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/Flat.terminal @@ -313,7 +313,7 @@ in directory that contains `Brewfile`. ## Git -You can set Git global configuration two ways. The first is to run bunch of commands which will update the Git configuration file, e.g. +You can set Git global configuration two ways. The first is to run a bunch of commands which will update the Git configuration file, e.g. ```shell $ git config --global user.name "First Last" @@ -350,9 +350,9 @@ You can also authenticate GiHub using SSH public key. You must generate one if t $ ssh-keygen -t rsa -b 4096 -C "your_email_used_in_github@example.com" ``` -but first make sure that htere is a `~/.ssh` directory on your computer. +but first make sure that there is a `~/.ssh` directory on your computer. -Above command will create private key (`id_rsa`) and public key (`id_rsa.pub`) in `~/.ssh` directory. +Above command will create a private key (`id_rsa`) and public key (`id_rsa.pub`) in `~/.ssh` directory. Next add your newly created SSH key to the ssh-agent to be able to manage your keys. ```shell @@ -367,7 +367,7 @@ After you've set up your SSH key and added it to your GitHub account, you can te $ ssh -T git@github.com ``` -After verifying figerprint by typing `yes` you should see following message: +After verifying figerprint by typing `yes` you should see the following message: ```shell Hi ! You've successfully authenticated, but GitHub does not provide shell access. From 01358020f8992ba988f0a823eef2bc7136d2d2bd Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 10 Jun 2018 09:57:36 +0200 Subject: [PATCH 26/61] Fix typo --- .bash_profile | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bash_profile b/.bash_profile index ca67072..40dbfc4 100755 --- a/.bash_profile +++ b/.bash_profile @@ -29,7 +29,7 @@ PURPLE='\[\033[1;35m\]' GRAY='\[\033[1;30m\]' DEFAULT='\[\033[0m\]' -# Function which current Git branch name from 'git branch' command +# Function which prints current Git branch name parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } diff --git a/README.md b/README.md index d91fd24..dfd7f05 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ PURPLE='\[\033[1;35m\]' GRAY='\[\033[1;30m\]' DEFAULT='\[\033[0m\]' -# Function which current Git branch name from 'git branch' command +# Function which prints current Git branch name parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } From 9ecd662c6e32070a926906923fe82fc720530f8b Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Tue, 26 Jun 2018 11:54:18 +0200 Subject: [PATCH 27/61] Update VS Code settings --- README.md | 5 ++++- settings.json | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dfd7f05..59f9dcd 100644 --- a/README.md +++ b/README.md @@ -463,8 +463,10 @@ Here are my `settings.json` contents: "**/node_modules/": true, "**/.vscode/": true, }, - "material-icon-theme.folders.theme": "none", + "material-icon-theme.folders.theme": "classic", "material-icon-theme.hidesExplorerArrows": true, + "material-icon-theme.folders.color": "#90a4ae", + "material-icon-theme.opacity": 0.8, "eslint.autoFixOnSave": true, "todohighlight.isEnable": true, "todohighlight.keywords": [ @@ -497,6 +499,7 @@ Here are my `settings.json` contents: "backgroundColor : {color}" ], "bracketPairColorizer.highlightActiveScope": true, + "debug.allowBreakpointsEverywhere": true, } ``` diff --git a/settings.json b/settings.json index 93dc811..2ce5f80 100644 --- a/settings.json +++ b/settings.json @@ -19,8 +19,10 @@ "**/node_modules/": true, "**/.vscode/": true, }, - "material-icon-theme.folders.theme": "none", + "material-icon-theme.folders.theme": "classic", "material-icon-theme.hidesExplorerArrows": true, + "material-icon-theme.folders.color": "#90a4ae", + "material-icon-theme.opacity": 0.8, "eslint.autoFixOnSave": true, "todohighlight.isEnable": true, "todohighlight.keywords": [ @@ -53,4 +55,5 @@ "backgroundColor : {color}" ], "bracketPairColorizer.highlightActiveScope": true, + "debug.allowBreakpointsEverywhere": true, } From 65da5490bfe2af7c64a2b1e592472c550bdb98bf Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Tue, 26 Jun 2018 11:58:29 +0200 Subject: [PATCH 28/61] Update VS Code extensions --- README.md | 3 ++- api/install.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 59f9dcd..b7aaa08 100644 --- a/README.md +++ b/README.md @@ -516,6 +516,7 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti - [Bracket Pair Colorizer](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer) - match brackets to be identified with colours - [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) - debug JavaScript code running in Google Chrome from VS Code - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - integrate ESLint into VS Code +- [JavaScript (ES6) code snippets](https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets) - code snippets for JavaScript in ES6 syntax - [Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) - icons based on Material Design - [open in browser](https://marketplace.visualstudio.com/items?itemName=techer.open-in-browser) - open any file in browser right from VS Code explorer - [Path Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense) - autocomplete filenames @@ -527,5 +528,5 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti To install all extensions by one command use: ```shell -$ code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets +$ code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets --install-extension xabikos.JavaScriptSnippets ``` diff --git a/api/install.sh b/api/install.sh index 457c404..0ef7a47 100644 --- a/api/install.sh +++ b/api/install.sh @@ -199,7 +199,7 @@ if $IS_VSCODE_INSTALLED; then if [ "$REPLY" == "y" ]; then echo "${ARROW} Installing Visual Studio Code extensions..." - code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets + code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets --install-extension xabikos.JavaScriptSnippets fi fi From 31d7b40d189673feb1fc1cbcbc0284108537ee6f Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 1 Jul 2018 10:36:02 +0200 Subject: [PATCH 29/61] Update README.md --- README.md | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b7aaa08..9270a4f 100644 --- a/README.md +++ b/README.md @@ -76,12 +76,16 @@ After a clean install of operating system, there are a couple tweaks I like to m ### Set Dock size +In my opinion, the best size of the dock is 35. Remember that this is due to the size and resolution of the screen. + ```shell $ defaults write com.apple.dock tilesize -int 35; killall Dock ``` ### Disable "Press and hold" +"Press and Hold" function is used to create accents or diacritical marks. I don't need it, so I turn it off. You can always turn it on back by changing `false` to `true`. + ```shell $ defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false ``` @@ -192,7 +196,8 @@ PS1+="${DEFAULT}" # Get back default color export PS1; ``` -In my `.bash_profile` file I create, among others, a `brewup` alias to keep Homebrew (which we are going to install in a second) up to date. I also set color scheme for `ls` command output and for custom prompt which contains username, computer name, working directory and current Git branch. +When bash is invoked it looks for `~/.bash_profile`, reads it and executes commands from it. +In my `.bash_profile` file I create, among others, a `brewup` alias (keyboard shortcut to avoiding typing a long command sequence) to keep Homebrew (which we are going to install in a second) up to date. I also set color scheme for `ls` command output and for custom prompt which contains username, computer name, working directory and current Git branch. To download `.bash_profile` and execute its content, use: @@ -258,11 +263,14 @@ Here are all the programs I install with a brief description. Below are the entire contents of my `Brewfile`, which will install all the above programs with a single command. ```ruby +# Install Cask (Homebrew extension). tap 'caskroom/cask' -brew 'git' +# Install Git and mas-cli by Homebrew. +brew 'git' brew 'mas' +# Install programs by Cask. cask 'appcleaner' cask 'filezilla' cask 'firefox' @@ -284,6 +292,7 @@ cask 'tunnelblick' cask 'visual-studio-code' cask 'vlc' +# Install apps from App Store by mas-cli. mas "iMovie", id: 408981434 mas "Numbers", id: 409203825 mas "Pages", id: 409201541 @@ -295,6 +304,8 @@ To check App Store application's IDs use: $ mas search ``` +but, of course, you must first install `mas-cli`. + To download my `Brewfile` file type: ```shell @@ -320,7 +331,7 @@ $ git config --global user.name "First Last" $ git config --global user.email "email@email.com" ``` -The other and faster way is creating the Git configuration file and input it all ourselves. +The other and faster way is creating the Git configuration file (`~/.gitconfig`) and input it all ourselves. ```shell $ cd ~ @@ -400,14 +411,17 @@ $ nvm install ## Node Package Manager Packages which I use globally at the moment are: -* [Gulp](https://gulpjs.com) -* [Webpack](https://webpack.js.org) -* [npm-upgrade](https://www.npmjs.com/package/npm-upgrade) +* [create-react-app](https://github.com/facebook/create-react-app) +* [gulp-cli](https://gulpjs.com) +* [Jest](http://jestjs.io/) +* [live-server](http://tapiov.net/live-server/) +* [npm-upgrade](https://github.com/th0r/npm-upgrade) +* [webpack](https://webpack.js.org) To install them use: ```shell -$ npm install -g gulp-cli webpack npm-upgrade +$ npm install -g create-react-app gulp-cli jest live-server npm-upgrade webpack ``` --- @@ -438,7 +452,7 @@ For main development I use Google Chrome. ## Visual Studio Code -All default settings changes are stored in `settings.json` file. You can open it by pressing `Command ⌘` + `,` going to Code > Preferences > Settings. +All default settings changes are stored in `settings.json` file. You can open it by pressing `Command ⌘` + `,` or by going to Code > Preferences > Settings. `settings.json` file is located in `/Users/Your Username/Library/Application Support/Code/User`. Here are my `settings.json` contents: ```json From 5cd67459a46a5c493d11e07c50d4a4ad4b8cd917 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 1 Jul 2018 10:36:18 +0200 Subject: [PATCH 30/61] Add new npm packages --- api/install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/install.sh b/api/install.sh index 0ef7a47..f16bb27 100644 --- a/api/install.sh +++ b/api/install.sh @@ -68,9 +68,12 @@ install_bundle() { install_npm_packages() { npm_packages=( + create-react-app gulp-cli - webpack + jest + live-server npm-upgrade + webpack ) npm install -g "${npm_packages[@]}" From 18ebff3f6141884da4cd1cebde793c43a5a713d2 Mon Sep 17 00:00:00 2001 From: Adam <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 1 Jul 2018 10:45:12 +0200 Subject: [PATCH 31/61] Fix typos --- .bash_profile | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bash_profile b/.bash_profile index 40dbfc4..632422c 100755 --- a/.bash_profile +++ b/.bash_profile @@ -38,7 +38,7 @@ parse_git_branch() { PS1="${RED}\u" # Username PS1+=" ${GRAY}• " # Separator PS1+="${GREEN}\h" # Hostname -PS1+=" ${GRAY}• " # Seprataor +PS1+=" ${GRAY}• " # Separator PS1+="${YELLOW}\w" # Working directory PS1+=" ${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \"•\") " # Separator PS1+="${PURPLE}\$(parse_git_branch)" # Git branch diff --git a/README.md b/README.md index 9270a4f..903527d 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ parse_git_branch() { PS1="${RED}\u" # Username PS1+=" ${GRAY}• " # Separator PS1+="${GREEN}\h" # Hostname -PS1+=" ${GRAY}• " # Seprataor +PS1+=" ${GRAY}• " # Separator PS1+="${YELLOW}\w" # Working directory PS1+=" ${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \"•\") " # Separator PS1+="${PURPLE}\$(parse_git_branch)" # Git branch @@ -378,7 +378,7 @@ After you've set up your SSH key and added it to your GitHub account, you can te $ ssh -T git@github.com ``` -After verifying figerprint by typing `yes` you should see the following message: +After verifying fingerprint by typing `yes` you should see the following message: ```shell Hi ! You've successfully authenticated, but GitHub does not provide shell access. From d95dbeaf4faa8f0938a1cc502321338c3bd9cc75 Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Tue, 3 Jul 2018 14:24:36 +0200 Subject: [PATCH 32/61] Update Update VS Code settings, switch from Filezilla to Cyberduck, remove Keka, make some fixes in shell script. --- Brewfile | 3 +-- README.md | 40 +++++++++++++++++------------ api/install.sh | 69 +++++++++++++++++++++++++++++--------------------- settings.json | 23 +++++++++++++---- 4 files changed, 83 insertions(+), 52 deletions(-) diff --git a/Brewfile b/Brewfile index ba829b6..a384fdb 100755 --- a/Brewfile +++ b/Brewfile @@ -4,12 +4,11 @@ brew 'git' brew 'mas' cask 'appcleaner' -cask 'filezilla' +cask 'cyberduck' cask 'firefox' cask 'flux' cask 'fork' cask 'google-chrome' -cask 'kap' cask 'keepingyouawake' cask 'keka' cask 'mamp' diff --git a/README.md b/README.md index 903527d..4818eb8 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,6 @@
- - - @@ -237,12 +234,11 @@ Here are all the programs I install with a brief description. - [Git](https://git-scm.com) - version control system - [mas-cli](https://github.com/mas-cli/mas) - Mac App Store command line interface - [AppCleaner](https://freemacsoft.net/appcleaner/) - apps uninstaller -- [Filezilla](https://filezilla-project.org) - FTP client +- [Cyberduck](https://cyberduck.io/) - FTP client - [Firefox](https://www.mozilla.org/firefox/new/) - web browser - [Flux](https://justgetflux.com) - screen color temperature adjusting app - [Fork](https://git-fork.com) - Git GUI client - [Google Chrome](https://www.google.pl/chrome/browser/desktop/index.html) - web browser -- [Kap](https://getkap.co/) - screen recorder - [KeepingYouAwake](https://github.com/newmarcel/KeepingYouAwake) - app which prevents Mac from entering sleep mode - [Keka](http://www.kekaosx.com) - file archiver - [MAMP](https://www.mamp.info/en/) - Apache, MySQL and PHP package @@ -272,12 +268,11 @@ brew 'mas' # Install programs by Cask. cask 'appcleaner' -cask 'filezilla' +cask 'cyberduck' cask 'firefox' cask 'flux' cask 'fork' cask 'google-chrome' -cask 'kap' cask 'keepingyouawake' cask 'keka' cask 'mamp' @@ -364,7 +359,7 @@ $ ssh-keygen -t rsa -b 4096 -C "your_email_used_in_github@example.com" but first make sure that there is a `~/.ssh` directory on your computer. Above command will create a private key (`id_rsa`) and public key (`id_rsa.pub`) in `~/.ssh` directory. -Next add your newly created SSH key to the ssh-agent to be able to manage your keys. +Next, add your newly created SSH key to the ssh-agent to be able to manage your keys. ```shell $ ssh-add @@ -413,7 +408,7 @@ $ nvm install Packages which I use globally at the moment are: * [create-react-app](https://github.com/facebook/create-react-app) * [gulp-cli](https://gulpjs.com) -* [Jest](http://jestjs.io/) +* [jest](http://jestjs.io/) * [live-server](http://tapiov.net/live-server/) * [npm-upgrade](https://github.com/th0r/npm-upgrade) * [webpack](https://webpack.js.org) @@ -462,6 +457,8 @@ Here are my `settings.json` contents: "workbench.activityBar.visible": false, "workbench.iconTheme": "material-icon-theme", "workbench.statusBar.feedback.visible": false, + "workbench.list.openMode": "doubleClick", + "workbench.tips.enabled": false, "editor.fontSize": 12, "editor.tabSize": 2, "editor.multiCursorModifier": "ctrlCmd", @@ -472,11 +469,12 @@ Here are my `settings.json` contents: "explorer.openEditors.visible": 0, "explorer.decorations.colors": false, "files.insertFinalNewline": true, - "html.autoClosingTags": false, "files.exclude": { "**/node_modules/": true, "**/.vscode/": true, + "**/.localized": true, }, + "html.autoClosingTags": false, "material-icon-theme.folders.theme": "classic", "material-icon-theme.hidesExplorerArrows": true, "material-icon-theme.folders.color": "#90a4ae", @@ -497,9 +495,6 @@ Here are my `settings.json` contents: "overviewRulerColor": "red" } ], - "todohighlight.exclude": [ - "**/public/" - ], "auto-rename-tag.activationOnLanguage": [ "html", "xml", @@ -513,7 +508,20 @@ Here are my `settings.json` contents: "backgroundColor : {color}" ], "bracketPairColorizer.highlightActiveScope": true, - "debug.allowBreakpointsEverywhere": true, + "colorize.activate_variables_support_beta": true, + "colorize.languages": [ + "css", + "sass", + "scss", + "less", + "postcss", + "sss", + "stylus", + "xml", + "svg", + "javascript", + "javascriptreact" + ], } ``` @@ -528,9 +536,9 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti - [Auto Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) - automatically rename paired HTML tag - [Bracket Pair Colorizer](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer) - match brackets to be identified with colours +- [colorize](https://marketplace.visualstudio.com/items?itemName=kamikillerto.vscode-colorize) - visualize CSS colors in CSS/Sass/Less/PostCSS/Stylus/XML files (works also with variables) - [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) - debug JavaScript code running in Google Chrome from VS Code - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - integrate ESLint into VS Code -- [JavaScript (ES6) code snippets](https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets) - code snippets for JavaScript in ES6 syntax - [Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) - icons based on Material Design - [open in browser](https://marketplace.visualstudio.com/items?itemName=techer.open-in-browser) - open any file in browser right from VS Code explorer - [Path Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense) - autocomplete filenames @@ -542,5 +550,5 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti To install all extensions by one command use: ```shell -$ code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets --install-extension xabikos.JavaScriptSnippets +$ code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets --install-extension kamikillerto.vscode-colorize ``` diff --git a/api/install.sh b/api/install.sh index f16bb27..c1d7311 100644 --- a/api/install.sh +++ b/api/install.sh @@ -2,26 +2,6 @@ clear ARROW=$(tput bold)$(tput setaf 6; echo -n '==>'; tput sgr0;) -IS_HOMEBREW_INSTALLED=false -if hash brew 2>/dev/null; then - IS_HOMEBREW_INSTALLED=true -fi - -IS_NVM_INSTALLED=false -if ! [ -x "$(command -v nvm)" ]; then - IS_NVM_INSTALLED=true -fi - -IS_NODE_INSTALLED=false -if hash node 2>/dev/null; then - IS_NODE_INSTALLED=true -fi - -IS_VSCODE_INSTALLED=false -if hash code 2>/dev/null; then - IS_VSCODE_INSTALLED=true -fi - echo "Welcome to the installer!" echo -e "First, introduce your password to execute all the commands as super user. \n" echo -e "\033[1;31mImportant:\033[0m You can be asked more times for password during the process." @@ -38,12 +18,11 @@ install_bundle() { applications_to_install=( appcleaner - filezilla + cyberduck firefox flux fork google-chrome - kap keepingyouawake keka mamp @@ -59,7 +38,10 @@ install_bundle() { vlc ) - brew cask install "${applications_to_install[@]}" + for application in "${applications_to_install[@]}" + do + brew cask install ${application} + done mas install 408981434 #iMovie mas install 409203825 #Numbers @@ -76,12 +58,20 @@ install_npm_packages() { webpack ) - npm install -g "${npm_packages[@]}" + for package in "${npm_packages[@]}" + do + npm install -g ${package} + done } #---------------------------- # Homebrew #---------------------------- +IS_HOMEBREW_INSTALLED=false +if hash brew 2>/dev/null; then + IS_HOMEBREW_INSTALLED=true +fi + if $IS_HOMEBREW_INSTALLED; then echo "${ARROW} Homebrew already installed!" else @@ -150,6 +140,11 @@ fi #---------------------------- # Node Version Manager #---------------------------- +IS_NVM_INSTALLED=false +if ! [ -x "$(command -v nvm)" ]; then + IS_NVM_INSTALLED=true +fi + if $IS_NVM_INSTALLED; then echo "${ARROW} Node Version Manager already installed!" else @@ -167,6 +162,11 @@ fi #---------------------------- # Node.js #---------------------------- +IS_NODE_INSTALLED=false +if hash node 2>/dev/null; then + IS_NODE_INSTALLED=true +fi + if $IS_NODE_INSTALLED; then echo "${ARROW} Node.js already installed!" else @@ -197,12 +197,17 @@ fi #---------------------------- # VSCode extensions #---------------------------- +IS_VSCODE_INSTALLED=false +if hash code 2>/dev/null; then + IS_VSCODE_INSTALLED=true +fi + if $IS_VSCODE_INSTALLED; then read -p "${ARROW} Install bundle of Visual Studio Code extensions? [y/n]: " if [ "$REPLY" == "y" ]; then echo "${ARROW} Installing Visual Studio Code extensions..." - code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets --install-extension xabikos.JavaScriptSnippets + code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets --install-extension kamikillerto.vscode-colorize fi fi @@ -233,11 +238,17 @@ fi # Spectacle shortcuts #---------------------------- -read -p "${ARROW} Configure Spectacle shotrcuts? [y/n]: " +if [ -d /Applications/Spectacle.app/ ]; then + IS_SPECTACLE_INSTALLED=true +fi -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring Spectacle shotrcuts..." - cp -r spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null +if $IS_SPECTACLE_INSTALLED; then + read -p "${ARROW} Configure Spectacle shotrcuts? [y/n]: " + + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring Spectacle shotrcuts..." + cp -r spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null + fi fi #---------------------------- diff --git a/settings.json b/settings.json index 2ce5f80..adff329 100644 --- a/settings.json +++ b/settings.json @@ -4,6 +4,8 @@ "workbench.activityBar.visible": false, "workbench.iconTheme": "material-icon-theme", "workbench.statusBar.feedback.visible": false, + "workbench.list.openMode": "doubleClick", + "workbench.tips.enabled": false, "editor.fontSize": 12, "editor.tabSize": 2, "editor.multiCursorModifier": "ctrlCmd", @@ -14,11 +16,12 @@ "explorer.openEditors.visible": 0, "explorer.decorations.colors": false, "files.insertFinalNewline": true, - "html.autoClosingTags": false, "files.exclude": { "**/node_modules/": true, "**/.vscode/": true, + "**/.localized": true, }, + "html.autoClosingTags": false, "material-icon-theme.folders.theme": "classic", "material-icon-theme.hidesExplorerArrows": true, "material-icon-theme.folders.color": "#90a4ae", @@ -39,9 +42,6 @@ "overviewRulerColor": "red" } ], - "todohighlight.exclude": [ - "**/public/" - ], "auto-rename-tag.activationOnLanguage": [ "html", "xml", @@ -55,5 +55,18 @@ "backgroundColor : {color}" ], "bracketPairColorizer.highlightActiveScope": true, - "debug.allowBreakpointsEverywhere": true, + "colorize.activate_variables_support_beta": true, + "colorize.languages": [ + "css", + "sass", + "scss", + "less", + "postcss", + "sss", + "stylus", + "xml", + "svg", + "javascript", + "javascriptreact" + ], } From 456f92f99fd3dee69442dad2d065b80c98fb1bda Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Tue, 10 Jul 2018 21:32:00 +0200 Subject: [PATCH 33/61] Update Better bash script files structure, remove unused .gitconfig file settings. --- .gitconfig | 2 -- README.md | 66 ++++++++++++++++++----------------- api/brew.sh | 43 +++++++++++++++++++++++ api/install.sh | 95 +++++++++++++++----------------------------------- api/npm.sh | 19 ++++++++++ bootstrap.sh | 57 ++++++++++++++++++++++++++++++ mac-setup.sh | 35 ------------------- 7 files changed, 181 insertions(+), 136 deletions(-) create mode 100644 api/brew.sh create mode 100644 api/npm.sh create mode 100755 bootstrap.sh delete mode 100755 mac-setup.sh diff --git a/.gitconfig b/.gitconfig index ef9131e..7e45dfc 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,8 +1,6 @@ [user] name = First Last email = email@email.com -[github] - user = username [core] editor = editor [credential] diff --git a/README.md b/README.md index 4818eb8..e003286 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,23 @@
- + -

Mac Setup

Front End Web Development Setup for macOS

- - - - + Stars - + Last Commit


-
-This document describes how I set up front end web development environment on my MacBook Air with macOS High Sierra 10.13.5. +This document describes how I set up front end web development environment on my MacBook Air with **macOS High Sierra 10.13.6**. --- @@ -44,25 +39,32 @@ This document describes how I set up front end web development environment on my ## Installation You can follow the instructions below or use shell script to configure settings automatically. -There are two ways to do it: +If you decided on the second option, there are two ways: -- clone/download the repository into your computer and then execute ```mac-setup.sh``` script, +- clone/download the repository into your computer and execute `bootstrap.sh` script from directory where `bootstrap.sh` is located: +```shell +$ cd mac-setup +$ ls +Brewfile README.md bootstrap.sh spectacle.json +Flat.terminal api settings.json +$ bash bootstrap.sh +``` - one line installation - open your terminal and paste the following code: ```shell -$ curl -L https://github.com/appalaszynski/mac-setup/archive/master.tar.gz | tar -xvz; cd mac-setup-master; chmod +x mac-setup.sh; ./mac-setup.sh +$ curl -L https://github.com/appalaszynski/mac-setup/archive/master.tar.gz | tar -xvz; cd mac-setup-master; chmod +x mac-setup.sh; ./bootstrap.sh ```
- +
+
--- ## System Preferences -After a clean install of operating system, there are a couple tweaks I like to make to the System Preferences. Some of them are not strictly related to web development environment - I use them because of my personal habits. - +After a clean install of operating system, there are a couple of tweaks I like to make to the System Preferences. Some of them are not strictly related to web development environment - I use them because of my personal habits. - General > User dark menu bar and Dock - General > Ask to keep changes when closing documents @@ -71,9 +73,11 @@ After a clean install of operating system, there are a couple tweaks I like to m - Keyboard > Key Repeat > Fast (all the way to the right) - Keyboard > Delay Until Repeat > Short (all the way to the right) +Much more settings can be configured by macOS `defaults` - command line utility that manipulates system configuration files. The system stores user preferences in a `.plist` files located in `~/Library/Preferences` directory. + ### Set Dock size -In my opinion, the best size of the dock is 35. Remember that this is due to the size and resolution of the screen. +In my opinion, the best size of the dock is `35`. Remember that this is due to the size and resolution of my MacBook screen. ```shell $ defaults write com.apple.dock tilesize -int 35; killall Dock @@ -135,7 +139,7 @@ I use my custom Terminal profile which I called **Flat**. You can download it by $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/Flat.terminal ``` -To use it as default profile open downloaded `Flat.terminal` file and click **Shell** > **Use settings as default** option. +To use it as default profile, open downloaded `Flat.terminal` file and click **Shell** > **Use settings as default** option. --- @@ -259,14 +263,14 @@ Here are all the programs I install with a brief description. Below are the entire contents of my `Brewfile`, which will install all the above programs with a single command. ```ruby -# Install Cask (Homebrew extension). +# Install Cask (Homebrew extension) tap 'caskroom/cask' -# Install Git and mas-cli by Homebrew. +# Install Git and mas-cli by Homebrew brew 'git' brew 'mas' -# Install programs by Cask. +# Install programs by Cask cask 'appcleaner' cask 'cyberduck' cask 'firefox' @@ -287,13 +291,13 @@ cask 'tunnelblick' cask 'visual-studio-code' cask 'vlc' -# Install apps from App Store by mas-cli. +# Install apps from App Store by mas-cli mas "iMovie", id: 408981434 mas "Numbers", id: 409203825 mas "Pages", id: 409201541 ``` -To check App Store application's IDs use: +To check App Store application IDs use: ```shell $ mas search @@ -338,22 +342,20 @@ $ open .gitconfig [user] name = First Last email = email@email.com -[github] - user = username [core] editor = editor [credential] helper = osxkeychain ``` -Here I set my name, email, GitHub username, core editor and connect Git to the macOS Keychain so I don’t have to type my username and password every time I want to push to GitHub. +Here I set my name, email, core editor and connect Git to the macOS Keychain so I don’t have to type my username and password every time I want to push to GitHub. ### SSH -You can also authenticate GiHub using SSH public key. You must generate one if they don’t already have one. To do is use following code: +You can also authenticate with GiHub using SSH key. To generate it, use following code: ```shell -$ ssh-keygen -t rsa -b 4096 -C "your_email_used_in_github@example.com" +$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com" ``` but first make sure that there is a `~/.ssh` directory on your computer. @@ -367,7 +369,7 @@ $ ssh-add Now just login into your Github account and paste content of `id_rsa.pub` file in **Settings** > **SSH and GPG keys** > **New SSH key**. -After you've set up your SSH key and added it to your GitHub account, you can test your connection. Open Terminal and paste following code: +After you've set up your SSH key and added it to your GitHub account, you can test your connection. Open terminal and paste following code: ```shell $ ssh -T git@github.com @@ -423,7 +425,7 @@ $ npm install -g create-react-app gulp-cli jest live-server npm-upgrade webpack ## Web Browsers -Currently I have installed all major web browsers: +Currently, I have installed all major web browsers: - [Chrome](https://www.google.com/chrome/) - [Safari](https://www.apple.com/safari/) @@ -440,14 +442,14 @@ For main development I use Google Chrome. - [HTTPS Everywhere](https://chrome.google.com/webstore/detail/https-everywhere/gcbommkclmclpchllfjekcdonpmejbdp?hl=pl) - automatically switch from "http" to "https" - [JSONView](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc) - validate and view JSON documents - [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) - inspect component hierarchies and states -- [Redux DevTools](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) - debug state changes +- [Redux DevTools](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) - inspect and debug state changes - [Pesticide](https://chrome.google.com/webstore/detail/pesticide-for-chrome/bblbgcheenepgnnajgfpiicnbbdmmooh) - toggle different colored outlines on every element for quick CSS layout debug --- ## Visual Studio Code -All default settings changes are stored in `settings.json` file. You can open it by pressing `Command ⌘` + `,` or by going to Code > Preferences > Settings. `settings.json` file is located in `/Users/Your Username/Library/Application Support/Code/User`. +All default settings changes are stored in `settings.json` file. You can open it by pressing `Command ⌘` + `,` or by going to **Code** > **Preferences** > **Settings**. This file is located in `/Users//Library/Application Support/Code/User`. Here are my `settings.json` contents: ```json @@ -528,7 +530,7 @@ Here are my `settings.json` contents: You can copy and paste them or just download whole file by: ```shell -$ cd /Users/Your Username/Library/Application Support/Code/User +$ cd /Users//Library/Application Support/Code/User $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/settings.json ``` diff --git a/api/brew.sh b/api/brew.sh new file mode 100644 index 0000000..6adb985 --- /dev/null +++ b/api/brew.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +install_bundle() { + # Install Cask (Homebrew extension) + brew tap caskroom/cask + + # Install mas-cli by Homebrew + brew install mas + + # List of programs to install by Cask + applications_to_install=( + appcleaner + cyberduck + firefox + flux + fork + google-chrome + keepingyouawake + keka + mamp + opera + postman + sequel-pro + skype + slack + spectacle + transmission + tunnelblick + visual-studio-code + vlc + ) + + # Install all listed programs + for application in "${applications_to_install[@]}" + do + brew cask install ${application} + done + + # Install apps from App Store by mas-cli + mas install 408981434 #iMovie + mas install 409203825 #Numbers + mas install 409201541 #Pages +} diff --git a/api/install.sh b/api/install.sh index c1d7311..11e1175 100644 --- a/api/install.sh +++ b/api/install.sh @@ -1,73 +1,25 @@ -clear +#!/bin/bash + +source ../bootstrap.sh +source ./brew.sh +source ./npm.sh -ARROW=$(tput bold)$(tput setaf 6; echo -n '==>'; tput sgr0;) +# Clear the terminal screen +clear echo "Welcome to the installer!" -echo -e "First, introduce your password to execute all the commands as super user. \n" -echo -e "\033[1;31mImportant:\033[0m You can be asked more times for password during the process." -echo "Also, make sure that You are logged in to the Mac App Store." -echo +echo -e "First, introduce your password to execute all the commands as super user.$NEW_LINE" +echo -e "${RED}${BOLD}Important:$DEFAULT You can be asked more times for password during the process." +echo -e "Also, make sure that You are logged in to the Mac App Store.$NEW_LINE" +# Prompt user for password sudo -v while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & -install_bundle() { - brew tap caskroom/cask - - brew install mas - - applications_to_install=( - appcleaner - cyberduck - firefox - flux - fork - google-chrome - keepingyouawake - keka - mamp - opera - postman - sequel-pro - skype - slack - spectacle - transmission - tunnelblick - visual-studio-code - vlc - ) - - for application in "${applications_to_install[@]}" - do - brew cask install ${application} - done - - mas install 408981434 #iMovie - mas install 409203825 #Numbers - mas install 409201541 #Pages -} - -install_npm_packages() { - npm_packages=( - create-react-app - gulp-cli - jest - live-server - npm-upgrade - webpack - ) - - for package in "${npm_packages[@]}" - do - npm install -g ${package} - done -} - #---------------------------- # Homebrew #---------------------------- -IS_HOMEBREW_INSTALLED=false + if hash brew 2>/dev/null; then IS_HOMEBREW_INSTALLED=true fi @@ -92,6 +44,7 @@ fi #---------------------------- # Git #---------------------------- + if $IS_HOMEBREW_INSTALLED; then read -p "${ARROW} Install latest Git version via Homebrew? [y/n]: " @@ -104,6 +57,7 @@ fi #---------------------------- # .bash_profile #---------------------------- + read -p "${ARROW} Configure .bash_profile? [y/n]: " if [ "$REPLY" == "y" ]; then @@ -114,6 +68,7 @@ fi #---------------------------- # Application bundle #---------------------------- + if $IS_HOMEBREW_INSTALLED; then read -p "${ARROW} Install bundle of applications via Homebrew-Cask? [y/n]: " @@ -130,6 +85,7 @@ fi #---------------------------- # Terminal profile #---------------------------- + read -p "${ARROW} Configure Terminal profile? [y/n]: " if [ "$REPLY" == "y" ]; then @@ -140,7 +96,7 @@ fi #---------------------------- # Node Version Manager #---------------------------- -IS_NVM_INSTALLED=false + if ! [ -x "$(command -v nvm)" ]; then IS_NVM_INSTALLED=true fi @@ -162,7 +118,7 @@ fi #---------------------------- # Node.js #---------------------------- -IS_NODE_INSTALLED=false + if hash node 2>/dev/null; then IS_NODE_INSTALLED=true fi @@ -183,8 +139,9 @@ else fi #---------------------------- -# Npm packages +# npm packages #---------------------------- + if $IS_NODE_INSTALLED; then read -p "${ARROW} Install bundle of npm packages? [y/n]: " @@ -195,9 +152,9 @@ if $IS_NODE_INSTALLED; then fi #---------------------------- -# VSCode extensions +# VS Code extensions #---------------------------- -IS_VSCODE_INSTALLED=false + if hash code 2>/dev/null; then IS_VSCODE_INSTALLED=true fi @@ -212,8 +169,9 @@ if $IS_VSCODE_INSTALLED; then fi #---------------------------- -# VSCode Settings +# VS Code Settings #---------------------------- + if $IS_VSCODE_INSTALLED; then read -p "${ARROW} Configure Visual Studio Code settings? [y/n]: " @@ -254,6 +212,7 @@ fi #---------------------------- # Firmware password #---------------------------- + if [[ $(sudo firmwarepasswd -check) =~ "Password Enabled: Yes" ]]; then echo "${ARROW} Firmware password is already set up!" else @@ -267,6 +226,7 @@ fi #---------------------------- # Computer name #---------------------------- + read -p "${ARROW} Set computer name? [y/n]: " if [ "$REPLY" == "y" ]; then @@ -288,6 +248,7 @@ if [ "$REPLY" == "y" ]; then . ./api/defaults.sh fi -echo -e "\033[1;33m\nNote:\033[0m Some changes may need system restart to be applied!\n\033[1;32m\nCongratulations, installation complete!\033[0m" +echo -e "${NEW_LINE}${YELLOW}${BOLD}Note:$DEFAULT Some changes may need system restart to be applied!" +echo -e "${NEW_LINE}${GREEN}${BOLD}Congratulations, installation complete!${DEFUALT}" exit 1 diff --git a/api/npm.sh b/api/npm.sh new file mode 100644 index 0000000..6aa74e4 --- /dev/null +++ b/api/npm.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +install_npm_packages() { + # List of packages to install by npm + npm_packages=( + create-react-app + gulp-cli + jest + live-server + npm-upgrade + webpack + ) + + # Install all listed packages + for package in "${npm_packages[@]}" + do + npm install -g ${package} + done +} diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..8511111 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# Colors +BOLD=$(tput bold) +CYAN=$(tput setaf 6) +RED=$(tput setaf 1) +GREEN=$(tput setaf 2) +YELLOW=$(tput setaf 3) +DEFAULT=$(tput sgr0) +# Arrow used when reading from input e.g. '==> Install Homebrew and update it? [y/n]: ' +ARROW="$CYAN$BOLD==>$DEFAULT" +# For now, assume that none of necessary programs is installed +IS_HOMEBREW_INSTALLED=false +IS_NVM_INSTALLED=false +IS_NODE_INSTALLED=false +IS_VSCODE_INSTALLED=false +# Horizonal line in cyan color +DIVIDER="${CYAN}${BOLD}------------------------------------------------$DEFAULT" +# New line character +NEW_LINE="\n" +# Project logo +LOGO=" __ __ _____ _ +| \/ | / ____| | | +| \ / | __ _ ___ | (___ ___| |_ _ _ _ __ +| |\/| |/ _\` |/ __| \___ \ / _ \ __| | | | '_ \\ +| | | | (_| | (__ ____) | __/ |_| |_| | |_) | +|_| |_|\__,_|\___| |_____/ \___|\__|\__,_| .__/ + | | + |_|" + +# Clear the terminal screen +clear + +# Print logo and description +echo -e "${CYAN}${BOLD}${LOGO}${DEFAULT}${NEW_LINE}" +echo -e "${CYAN}${BOLD} Front End Web Development Setup for macOS$NEW_LINE" +echo -e "$DIVIDER" +echo " " +echo " " +echo -e "${DIVIDER}${NEW_LINE}" + +PS3=' +Number to execute: ' + +options=("Install" "Quit") +select opt in "${options[@]}" +do + case $opt in + "Install") + . api/install.sh + ;; + "Quit") + break + ;; + *) echo Invalid option!;; + esac +done diff --git a/mac-setup.sh b/mac-setup.sh deleted file mode 100755 index 080245e..0000000 --- a/mac-setup.sh +++ /dev/null @@ -1,35 +0,0 @@ -clear - -LOGO="\033[1;36m __ __ _____ _ -| \/ | / ____| | | -| \ / | __ _ ___ | (___ ___| |_ _ _ _ __ -| |\/| |/ _\` |/ __| \___ \ / _ \ __| | | | '_ \\ -| | | | (_| | (__ ____) | __/ |_| |_| | |_) | -|_| |_|\__,_|\___| |_____/ \___|\__|\__,_| .__/ - | | - |_|\033[0m" - -echo -e "$LOGO" - -echo -e "\033[1;36m\n Front end web development setup for macOS\n" -echo -e "------------------------------------------------\033[0m" -echo -e " " -echo -e " " -echo -e "\033[1;36m------------------------------------------------\033[0m\n" - -PS3=' -Number to execute: ' - -options=("Install" "Quit") -select opt in "${options[@]}" -do - case $opt in - "Install") - . api/install.sh - ;; - "Quit") - break - ;; - *) echo Invalid option!;; - esac -done From 15b8d37ae0357bd54c50630910d91399c984568d Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 15 Jul 2018 09:37:47 +0200 Subject: [PATCH 34/61] Update VS Code settings --- README.md | 23 +++++++++++++---------- settings.json | 3 +++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e003286..06a304d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
- +

Mac Setup

@@ -75,7 +75,7 @@ After a clean install of operating system, there are a couple of tweaks I like t Much more settings can be configured by macOS `defaults` - command line utility that manipulates system configuration files. The system stores user preferences in a `.plist` files located in `~/Library/Preferences` directory. -### Set Dock size +### Set Dock Size In my opinion, the best size of the dock is `35`. Remember that this is due to the size and resolution of my MacBook screen. @@ -91,7 +91,7 @@ $ defaults write com.apple.dock tilesize -int 35; killall Dock $ defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false ``` -### Reset icons in Launchpad +### Reset Icons in Launchpad I usually use this command after installing every application that I need - it keeps Apple applications on the first page and moves the rest to the next pages. @@ -99,7 +99,7 @@ I usually use this command after installing every application that I need - it k $ defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock ``` -### Show hidden files +### Show Hidden Files This can also be done by pressing `Command ⌘` + `Shift ⇧` + `.`. @@ -107,19 +107,19 @@ This can also be done by pressing `Command ⌘` + `Shift ⇧` + `.`. $ defaults write com.apple.finder AppleShowAllFiles YES ``` -### Show path bar in Finder +### Show Path Bar in Finder ```shell $ defaults write com.apple.finder ShowPathbar -bool true ``` -### Show status bar in Finder +### Show Status Bar in Finder ```shell $ defaults write com.apple.finder ShowStatusBar -bool true ``` -### Set firmware password +### Set Firmware Password Setting a firmware password prevents your Mac from starting up from any device other than your startup disk. It may also be set to be required on each boot. @@ -198,7 +198,7 @@ export PS1; ``` When bash is invoked it looks for `~/.bash_profile`, reads it and executes commands from it. -In my `.bash_profile` file I create, among others, a `brewup` alias (keyboard shortcut to avoiding typing a long command sequence) to keep Homebrew (which we are going to install in a second) up to date. I also set color scheme for `ls` command output and for custom prompt which contains username, computer name, working directory and current Git branch. +In my `.bash_profile` file I create, among others, a `brewup` alias (keyboard shortcut to avoiding typing a long command sequence) to keep Homebrew (which we are going to install in a second) up to date. I also set color scheme for `ls` command output and configure custom prompt which contains username, computer name, working directory and current Git branch. To download `.bash_profile` and execute its content, use: @@ -297,7 +297,7 @@ mas "Numbers", id: 409203825 mas "Pages", id: 409201541 ``` -To check App Store application IDs use: +To check App Store application ID use: ```shell $ mas search @@ -434,7 +434,7 @@ Currently, I have installed all major web browsers: For main development I use Google Chrome. -### Chrome extensions +### Chrome Extensions - [uBlock Origin](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm) - block ads - [Privacy Badger](https://chrome.google.com/webstore/detail/privacy-badger/pkehgijcmpdhfbdbbnkijodmdjhbjlgp) - block spying ads and invisible trackers @@ -470,6 +470,8 @@ Here are my `settings.json` contents: "problems.decorations.enabled": false, "explorer.openEditors.visible": 0, "explorer.decorations.colors": false, + "extensions.showRecommendationsOnlyOnDemand": true, + "extensions.ignoreRecommendations": true, "files.insertFinalNewline": true, "files.exclude": { "**/node_modules/": true, @@ -482,6 +484,7 @@ Here are my `settings.json` contents: "material-icon-theme.folders.color": "#90a4ae", "material-icon-theme.opacity": 0.8, "eslint.autoFixOnSave": true, + "npm.enableScriptExplorer": true, "todohighlight.isEnable": true, "todohighlight.keywords": [ { diff --git a/settings.json b/settings.json index adff329..f495674 100644 --- a/settings.json +++ b/settings.json @@ -15,6 +15,8 @@ "problems.decorations.enabled": false, "explorer.openEditors.visible": 0, "explorer.decorations.colors": false, + "extensions.showRecommendationsOnlyOnDemand": true, + "extensions.ignoreRecommendations": true, "files.insertFinalNewline": true, "files.exclude": { "**/node_modules/": true, @@ -27,6 +29,7 @@ "material-icon-theme.folders.color": "#90a4ae", "material-icon-theme.opacity": 0.8, "eslint.autoFixOnSave": true, + "npm.enableScriptExplorer": true, "todohighlight.isEnable": true, "todohighlight.keywords": [ { From db9736967dac77898fc01decda25353d835a19a0 Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Sat, 21 Jul 2018 21:16:52 +0200 Subject: [PATCH 35/61] Update Spectacle settings --- spectacle.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spectacle.json b/spectacle.json index 2effb7c..be0b744 100644 --- a/spectacle.json +++ b/spectacle.json @@ -40,7 +40,7 @@ "shortcut_name": "MoveToPreviousDisplay" }, { - "shortcut_key_binding": "alt+cmd+z", + "shortcut_key_binding": null, "shortcut_name": "UndoLastMove" }, { From 83462bca0374ae5a713c4dea2b2540d9af457012 Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 29 Jul 2018 09:36:58 +0200 Subject: [PATCH 36/61] Add new applications Background Music, GPG Suite, Xcode --- Brewfile | 3 +++ README.md | 6 ++++++ api/brew.sh | 3 +++ 3 files changed, 12 insertions(+) diff --git a/Brewfile b/Brewfile index a384fdb..34b0d74 100755 --- a/Brewfile +++ b/Brewfile @@ -4,11 +4,13 @@ brew 'git' brew 'mas' cask 'appcleaner' +cask 'background-music' cask 'cyberduck' cask 'firefox' cask 'flux' cask 'fork' cask 'google-chrome' +cask 'gpg-suite' cask 'keepingyouawake' cask 'keka' cask 'mamp' @@ -26,3 +28,4 @@ cask 'vlc' mas "iMovie", id: 408981434 mas "Numbers", id: 409203825 mas "Pages", id: 409201541 +mas "Xcode", id: 497799835 diff --git a/README.md b/README.md index 06a304d..1cf4bdc 100644 --- a/README.md +++ b/README.md @@ -238,11 +238,13 @@ Here are all the programs I install with a brief description. - [Git](https://git-scm.com) - version control system - [mas-cli](https://github.com/mas-cli/mas) - Mac App Store command line interface - [AppCleaner](https://freemacsoft.net/appcleaner/) - apps uninstaller +- [Background Music](https://github.com/kyleneideck/BackgroundMusic) - audio utility - [Cyberduck](https://cyberduck.io/) - FTP client - [Firefox](https://www.mozilla.org/firefox/new/) - web browser - [Flux](https://justgetflux.com) - screen color temperature adjusting app - [Fork](https://git-fork.com) - Git GUI client - [Google Chrome](https://www.google.pl/chrome/browser/desktop/index.html) - web browser +- [GPG Suite](https://gpgtools.org/) - communication and files encryption tools - [KeepingYouAwake](https://github.com/newmarcel/KeepingYouAwake) - app which prevents Mac from entering sleep mode - [Keka](http://www.kekaosx.com) - file archiver - [MAMP](https://www.mamp.info/en/) - Apache, MySQL and PHP package @@ -259,6 +261,7 @@ Here are all the programs I install with a brief description. - [iMovie](https://www.apple.com/imovie/) - video editor - [Pages](https://www.apple.com/pages/) - text editor - [Numbers](https://www.apple.com/numbers/) - spreadsheet editor +- [Xcode](https://developer.apple.com/xcode/) - IDE for developing software for Apple products Below are the entire contents of my `Brewfile`, which will install all the above programs with a single command. @@ -272,11 +275,13 @@ brew 'mas' # Install programs by Cask cask 'appcleaner' +cask 'background-music' cask 'cyberduck' cask 'firefox' cask 'flux' cask 'fork' cask 'google-chrome' +cask 'gpg-suite' cask 'keepingyouawake' cask 'keka' cask 'mamp' @@ -295,6 +300,7 @@ cask 'vlc' mas "iMovie", id: 408981434 mas "Numbers", id: 409203825 mas "Pages", id: 409201541 +mas "Xcode", id: 497799835 ``` To check App Store application ID use: diff --git a/api/brew.sh b/api/brew.sh index 6adb985..fd02ab3 100644 --- a/api/brew.sh +++ b/api/brew.sh @@ -10,11 +10,13 @@ install_bundle() { # List of programs to install by Cask applications_to_install=( appcleaner + background-music cyberduck firefox flux fork google-chrome + gpg-suite keepingyouawake keka mamp @@ -40,4 +42,5 @@ install_bundle() { mas install 408981434 #iMovie mas install 409203825 #Numbers mas install 409201541 #Pages + mas install 497799835 #Xcode } From cd66d9c955de64560001c073f75dff45e8d514d0 Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 1 Aug 2018 07:47:04 +0200 Subject: [PATCH 37/61] Remove "rmhis" Bash alias --- .bash_profile | 3 --- README.md | 3 --- 2 files changed, 6 deletions(-) diff --git a/.bash_profile b/.bash_profile index 632422c..49b7443 100755 --- a/.bash_profile +++ b/.bash_profile @@ -4,9 +4,6 @@ # Homebrew-Cask downloads alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' -# Remove bash history and exit bash shell -alias rmhis='rm .bash_history; history -c; logout' - # Easier navigation alias ..="cd .." alias ....="cd ../.." diff --git a/README.md b/README.md index 1cf4bdc..88d6234 100644 --- a/README.md +++ b/README.md @@ -152,9 +152,6 @@ To use it as default profile, open downloaded `Flat.terminal` file and click **S # Homebrew-Cask downloads alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' -# Remove bash history and exit bash shell -alias rmhis='rm .bash_history; history -c; logout' - # Easier navigation alias ..="cd .." alias ....="cd ../.." From a69f620286bf1e418fd0f200febbe77bbba7c45b Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 1 Aug 2018 08:08:03 +0200 Subject: [PATCH 38/61] Better ".bash_profile" comments --- .bash_profile | 16 +++++++--------- README.md | 16 +++++++--------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.bash_profile b/.bash_profile index 49b7443..37662b6 100755 --- a/.bash_profile +++ b/.bash_profile @@ -12,13 +12,11 @@ alias ....="cd ../.." alias p="cd ~/Projects" alias d="cd ~/Desktop" -# Enable ANSI colors sequences to distinguish file types -export CLICOLOR=1 +# Configure ls command +export CLICOLOR=1 # Enable ANSI colors sequences to distinguish file types +export LSCOLORS=GxFxCxDxBxegedabagaced # Value of this variable describes what color to use for which file type -# Value of this variable describes what color to use for which attribute -export LSCOLORS=GxFxCxDxBxegedabagaced - -# Color definitions +# Color definitions (used in prompt) RED='\[\033[1;31m\]' GREEN='\[\033[1;32m\]' YELLOW='\[\033[1;33m\]' @@ -26,18 +24,18 @@ PURPLE='\[\033[1;35m\]' GRAY='\[\033[1;30m\]' DEFAULT='\[\033[0m\]' -# Function which prints current Git branch name +# Function which prints current Git branch name (used in prompt) parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } -# Set up prompt +# Configure prompt PS1="${RED}\u" # Username PS1+=" ${GRAY}• " # Separator PS1+="${GREEN}\h" # Hostname PS1+=" ${GRAY}• " # Separator PS1+="${YELLOW}\w" # Working directory -PS1+=" ${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \"•\") " # Separator +PS1+=" ${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \"•\") " # Separator (if there is a Git repository) PS1+="${PURPLE}\$(parse_git_branch)" # Git branch PS1+="\n" # New line PS1+="${GRAY}\$ " # Dollar sign diff --git a/README.md b/README.md index 88d6234..d1a551c 100644 --- a/README.md +++ b/README.md @@ -160,13 +160,11 @@ alias ....="cd ../.." alias p="cd ~/Projects" alias d="cd ~/Desktop" -# Enable ANSI colors sequences to distinguish file types -export CLICOLOR=1 +# Configure ls command +export CLICOLOR=1 # Enable ANSI colors sequences to distinguish file types +export LSCOLORS=GxFxCxDxBxegedabagaced # Value of this variable describes what color to use for which file type -# Value of this variable describes what color to use for which attribute -export LSCOLORS=GxFxCxDxBxegedabagaced - -# Color definitions +# Color definitions (used in prompt) RED='\[\033[1;31m\]' GREEN='\[\033[1;32m\]' YELLOW='\[\033[1;33m\]' @@ -174,18 +172,18 @@ PURPLE='\[\033[1;35m\]' GRAY='\[\033[1;30m\]' DEFAULT='\[\033[0m\]' -# Function which prints current Git branch name +# Function which prints current Git branch name (used in prompt) parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } -# Set up prompt +# Configure prompt PS1="${RED}\u" # Username PS1+=" ${GRAY}• " # Separator PS1+="${GREEN}\h" # Hostname PS1+=" ${GRAY}• " # Separator PS1+="${YELLOW}\w" # Working directory -PS1+=" ${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \"•\") " # Separator +PS1+=" ${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \"•\") " # Separator (if there is a Git repository) PS1+="${PURPLE}\$(parse_git_branch)" # Git branch PS1+="\n" # New line PS1+="${GRAY}\$ " # Dollar sign From 3e87bb6fb3383a18021643487927981921a180d2 Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 1 Aug 2018 08:34:29 +0200 Subject: [PATCH 39/61] Update npm packages --- README.md | 8 +++----- api/npm.sh | 2 -- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d1a551c..02cbd20 100644 --- a/README.md +++ b/README.md @@ -229,7 +229,7 @@ Installing each package separately may take some time. That's why I use [Homebre Here are all the programs I install with a brief description. -- [Cask](https://caskroom.github.io) - an extension to Homebrew which allows to install almost any program that exists for a Mac +- [Cask](https://github.com/Homebrew/homebrew-cask) - an extension to Homebrew which allows to install almost any program that exists for a Mac - [Git](https://git-scm.com) - version control system - [mas-cli](https://github.com/mas-cli/mas) - Mac App Store command line interface - [AppCleaner](https://freemacsoft.net/appcleaner/) - apps uninstaller @@ -254,8 +254,8 @@ Here are all the programs I install with a brief description. - [Visual Studio Code](https://code.visualstudio.com) - code editor - [VLC](https://www.videolan.org/vlc/) - media player - [iMovie](https://www.apple.com/imovie/) - video editor -- [Pages](https://www.apple.com/pages/) - text editor - [Numbers](https://www.apple.com/numbers/) - spreadsheet editor +- [Pages](https://www.apple.com/pages/) - text editor - [Xcode](https://developer.apple.com/xcode/) - IDE for developing software for Apple products Below are the entire contents of my `Brewfile`, which will install all the above programs with a single command. @@ -409,17 +409,15 @@ $ nvm install ## Node Package Manager Packages which I use globally at the moment are: -* [create-react-app](https://github.com/facebook/create-react-app) * [gulp-cli](https://gulpjs.com) * [jest](http://jestjs.io/) * [live-server](http://tapiov.net/live-server/) * [npm-upgrade](https://github.com/th0r/npm-upgrade) -* [webpack](https://webpack.js.org) To install them use: ```shell -$ npm install -g create-react-app gulp-cli jest live-server npm-upgrade webpack +$ npm install -g gulp-cli jest live-server npm-upgrade ``` --- diff --git a/api/npm.sh b/api/npm.sh index 6aa74e4..dab1268 100644 --- a/api/npm.sh +++ b/api/npm.sh @@ -3,12 +3,10 @@ install_npm_packages() { # List of packages to install by npm npm_packages=( - create-react-app gulp-cli jest live-server npm-upgrade - webpack ) # Install all listed packages From 2cef92545c6ed640f0d566c0421a2a0c784e4903 Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 1 Aug 2018 09:48:10 +0200 Subject: [PATCH 40/61] Update VS Code settings and extensions --- README.md | 33 ++++++--------------------------- api/install.sh | 2 +- settings.json | 28 ++++------------------------ 3 files changed, 11 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 02cbd20..1a9d0fb 100644 --- a/README.md +++ b/README.md @@ -484,35 +484,11 @@ Here are my `settings.json` contents: "material-icon-theme.opacity": 0.8, "eslint.autoFixOnSave": true, "npm.enableScriptExplorer": true, - "todohighlight.isEnable": true, - "todohighlight.keywords": [ - { - "text": "TODO:", - "color": "black", - "backgroundColor": "yellow", - "overviewRulerColor": "yellow" - }, - { - "text": "FIXME:", - "color": "white", - "backgroundColor": "red", - "overviewRulerColor": "red" - } - ], - "auto-rename-tag.activationOnLanguage": [ - "html", - "xml", - "javascript", - "javascriptreact" - ], "bracketPairColorizer.activeScopeCSS": [ - "borderStyle : solid", - "borderWidth : 1px", "borderColor : {color}; opacity: 0.5", "backgroundColor : {color}" ], "bracketPairColorizer.highlightActiveScope": true, - "colorize.activate_variables_support_beta": true, "colorize.languages": [ "css", "sass", @@ -526,6 +502,10 @@ Here are my `settings.json` contents: "javascript", "javascriptreact" ], + "colorize.colorized_variables": [ + "CSS", + "SASS" + ], } ``` @@ -539,6 +519,7 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti ### Extensions - [Auto Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) - automatically rename paired HTML tag +- [Better Comments](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments) - create more human-friendly comments by highlighting annotations within code - [Bracket Pair Colorizer](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer) - match brackets to be identified with colours - [colorize](https://marketplace.visualstudio.com/items?itemName=kamikillerto.vscode-colorize) - visualize CSS colors in CSS/Sass/Less/PostCSS/Stylus/XML files (works also with variables) - [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) - debug JavaScript code running in Google Chrome from VS Code @@ -547,12 +528,10 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti - [open in browser](https://marketplace.visualstudio.com/items?itemName=techer.open-in-browser) - open any file in browser right from VS Code explorer - [Path Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense) - autocomplete filenames - [Project Manager](https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager) - manage projects right inside VS Code -- [Reactjs code snippets](https://marketplace.visualstudio.com/items?itemName=xabikos.ReactSnippets) - code snippets for React development - [SCSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-scss) - autocomplete variables, mixins, functions etc. -- [TODO Highlight](https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight) - highlight and list TODO, FIXME or any annotations within code To install all extensions by one command use: ```shell -$ code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets --install-extension kamikillerto.vscode-colorize +$ code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension aaron-bond.better-comments --install-extension kamikillerto.vscode-colorize ``` diff --git a/api/install.sh b/api/install.sh index 11e1175..8a8a803 100644 --- a/api/install.sh +++ b/api/install.sh @@ -164,7 +164,7 @@ if $IS_VSCODE_INSTALLED; then if [ "$REPLY" == "y" ]; then echo "${ARROW} Installing Visual Studio Code extensions..." - code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension wayou.vscode-todo-highlight --install-extension xabikos.ReactSnippets --install-extension kamikillerto.vscode-colorize + code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension aaron-bond.better-comments --install-extension kamikillerto.vscode-colorize fi fi diff --git a/settings.json b/settings.json index f495674..06397f9 100644 --- a/settings.json +++ b/settings.json @@ -30,35 +30,11 @@ "material-icon-theme.opacity": 0.8, "eslint.autoFixOnSave": true, "npm.enableScriptExplorer": true, - "todohighlight.isEnable": true, - "todohighlight.keywords": [ - { - "text": "TODO:", - "color": "black", - "backgroundColor": "yellow", - "overviewRulerColor": "yellow" - }, - { - "text": "FIXME:", - "color": "white", - "backgroundColor": "red", - "overviewRulerColor": "red" - } - ], - "auto-rename-tag.activationOnLanguage": [ - "html", - "xml", - "javascript", - "javascriptreact" - ], "bracketPairColorizer.activeScopeCSS": [ - "borderStyle : solid", - "borderWidth : 1px", "borderColor : {color}; opacity: 0.5", "backgroundColor : {color}" ], "bracketPairColorizer.highlightActiveScope": true, - "colorize.activate_variables_support_beta": true, "colorize.languages": [ "css", "sass", @@ -72,4 +48,8 @@ "javascript", "javascriptreact" ], + "colorize.colorized_variables": [ + "CSS", + "SASS" + ], } From e31958683ae709e680eea69591e7af6d2f7506e0 Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 1 Aug 2018 09:57:59 +0200 Subject: [PATCH 41/61] Remove not working macOS defaults --- api/defaults.sh | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/api/defaults.sh b/api/defaults.sh index 8da3053..ae1f31e 100755 --- a/api/defaults.sh +++ b/api/defaults.sh @@ -164,12 +164,10 @@ defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -int 0 # Ask to kepp change when closing documents defaults write NSGlobalDomain NSCloseAlwaysConfirmsChanges -int 1 -# Set up alert sound +# Set alert sound defaults write NSGlobalDomain com.apple.sound.beep.sound -string "/System/Library/Sounds/Funk.aiff" -defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -int 0 - -# Set up date format in menubar +# Set date format in menubar defaults write "com.apple.menuextra.clock" DateFormat -string "EEE d.MM HH:mm" defaults write "com.apple.systemuiserver" DateFormat -string "EEE d.MM HH:mm" @@ -189,21 +187,6 @@ defaults write "com.apple.systemuiserver" DateFormat -string "EEE d.MM HH:mm" /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist -# Set order of menu bar icons -defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.bluetooth" -int 489 -defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.airport" -int 435 -defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.volume" -int 324 -defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.battery" -int 273 -defaults write "com.apple.systemuiserver" "NSStatusItem Preferred Position com.apple.menuextra.clock" -int 179 -defaults write "com.apple.systemuiserver" "NSStatusItem Visible Siri" -int 0 -defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.airport" -int 1 -defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.appleuser" -int 1 -defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.battery" -int 1 -defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.bluetooth" -int 1 -defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.clock" -int 1 -defaults write "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.volume" -int 1 -defaults write "com.apple.systemuiserver" menuExtras -array "/System/Library/CoreServices/Menu Extras/Clock.menu" "/System/Library/CoreServices/Menu Extras/AirPort.menu" "/System/Library/CoreServices/Menu Extras/Battery.menu" "/System/Library/CoreServices/Menu Extras/Volume.menu" "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" - applications_to_kill=( "Activity Monitor" "Dock" From 60a9062ef6aebbb55bbb54943638c62c7048428a Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Fri, 3 Aug 2018 15:58:55 +0200 Subject: [PATCH 42/61] Create VS Code snippets --- README.md | 6 +++ api/install.sh | 15 +++++++- snippets.code-snippets | 85 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 snippets.code-snippets diff --git a/README.md b/README.md index 1a9d0fb..b59e30d 100644 --- a/README.md +++ b/README.md @@ -535,3 +535,9 @@ To install all extensions by one command use: ```shell $ code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension aaron-bond.better-comments --install-extension kamikillerto.vscode-colorize ``` + +### Snippets + +I use my own global snippets instead of installing an extensions. User custom global snippets are located in `/Users//Library/Application Support/Code/User/snippets` as files with `code-snippets` extension. You can easily create or edit them by going to **Code** > **Preferences** > **User Snippets** and selecting specific file from a list. + +You can find all my snippets in [snippets.code-snippets](https://github.com/appalaszynski/mac-setup/blob/master/snippets.code-snippets). diff --git a/api/install.sh b/api/install.sh index 8a8a803..58cef85 100644 --- a/api/install.sh +++ b/api/install.sh @@ -169,7 +169,7 @@ if $IS_VSCODE_INSTALLED; then fi #---------------------------- -# VS Code Settings +# VS Code settings #---------------------------- if $IS_VSCODE_INSTALLED; then @@ -181,6 +181,19 @@ if $IS_VSCODE_INSTALLED; then fi fi +#---------------------------- +# VS Code snippets +#---------------------------- + +if $IS_VSCODE_INSTALLED; then + read -p "${ARROW} Configure Visual Studio Code snippets? [y/n]: " + + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring Visual Studio Code snippets..." + cp snippets.code-snippets /Users/${USER}/Library/Application\ Support/Code/User/snippets + fi +fi + #---------------------------- # .gitconfig #---------------------------- diff --git a/snippets.code-snippets b/snippets.code-snippets new file mode 100644 index 0000000..2087d72 --- /dev/null +++ b/snippets.code-snippets @@ -0,0 +1,85 @@ +{ + // React + "importReact": { + "prefix": "impr", + "body": "import React from 'react';", + "description": "Import React" + }, + "importReactWithComponent": { + "prefix": "imprc", + "body": "import React, { Component } from 'react';", + "description": "Import React with Component element" + }, + "importReactDOM": { + "prefix": "imprd", + "body": "import ReactDOM from 'react-dom';", + "description": "Import ReactDOM" + }, + "destructState": { + "prefix": "dss", + "body": "const { $1 } = this.state;", + "description": "Destruct React class component state" + }, + "destructProps": { + "prefix": "dsp", + "body": "const { $1 } = this.props;", + "description": "Destruct React class component props" + }, + "reactClassComponent": { + "prefix": "rcc", + "body": "import React, { Component } from 'react';\n\nclass ${1:${TM_FILENAME_BASE}} extends Component {\n\trender() {\n\t\treturn (\n\t\t\t

\n\t\t\t\t$0\n\t\t\t
\n\t\t);\n\t}\n}\n\nexport default ${1:${TM_FILENAME_BASE}};", + "description": "Create React class component" + }, + "reactClassComponentPropTypes": { + "prefix": "rccp", + "body": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass ${1:${TM_FILENAME_BASE}} extends Component {\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t$0\n\t\t\t
\n\t\t);\n\t}\n}\n\n${1:${TM_FILENAME_BASE}}.propTypes = {\n\n};\n\nexport default ${1:${TM_FILENAME_BASE}};", + "description": "Create React class component with PropTypes" + }, + "reactStateless": { + "prefix": "rsc", + "body": "import React from 'react';\n\nconst ${1:${TM_FILENAME_BASE}} = () => {\n\treturn (\n\t\t
\n\t\t\t$0\n\t\t
\n\t);\n};\n\nexport default ${1:${TM_FILENAME_BASE}};", + "description": "Create React stateless component" + }, + "reactStatelessProps": { + "prefix": "rscp", + "body": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst ${1:${TM_FILENAME_BASE}} = props => {\n\treturn (\n\t\t
\n\t\t\t\n\t\t
\n\t);\n};\n\n${1:${TM_FILENAME_BASE}}.propTypes = {\n\t$0\n};\n\nexport default ${1:${TM_FILENAME_BASE}};", + "description": "Create React stateless component with PropTypes" + }, + // React Native + "importReactNative": { + "prefix": "imrn", + "body": "import { ${1:View} } from 'react-native';", + "description": "Import React Native element" + }, + "createReactNativeStyleSheet": { + "prefix": "rnss", + "body": "const ${1:styles} = StyleSheet.create({\n\t$2\n});", + "description": "Create React Native StyleSheet" + }, + // CommonJS + "require": { + "prefix": "req", + "body": "require('$2');", + "description": "Require module" + }, + "requireConstant": { + "prefix": "reqc", + "body": "const $1 = require('$2');", + "description": "Require module and assign it to constant" + }, + // Other + "consoleLog": { + "prefix": "con", + "body": "console.log($1);", + "description": "Output a message to console" + }, + "import": { + "prefix": "imp", + "body": "import $2 from '$1';", + "description": "Import entire module" + }, + "importDestructing": { + "prefix": "impd", + "body": "import { $2 } from '$1';" + }, +} From 4bc6e6ae2eac105f7fe3641189f90312730069d4 Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 22 Aug 2018 15:38:20 +0200 Subject: [PATCH 43/61] Add draw.io application --- README.md | 2 ++ api/brew.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index b59e30d..1a4f8c9 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,7 @@ Here are all the programs I install with a brief description. - [AppCleaner](https://freemacsoft.net/appcleaner/) - apps uninstaller - [Background Music](https://github.com/kyleneideck/BackgroundMusic) - audio utility - [Cyberduck](https://cyberduck.io/) - FTP client +- [draw.io](https://www.draw.io/) - diagramming tool - [Firefox](https://www.mozilla.org/firefox/new/) - web browser - [Flux](https://justgetflux.com) - screen color temperature adjusting app - [Fork](https://git-fork.com) - Git GUI client @@ -272,6 +273,7 @@ brew 'mas' cask 'appcleaner' cask 'background-music' cask 'cyberduck' +cask 'drawio' cask 'firefox' cask 'flux' cask 'fork' diff --git a/api/brew.sh b/api/brew.sh index fd02ab3..b4598eb 100644 --- a/api/brew.sh +++ b/api/brew.sh @@ -12,6 +12,7 @@ install_bundle() { appcleaner background-music cyberduck + drawio firefox flux fork From 713c2f8c8607f07badea7bbe6a6394394b21260a Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Wed, 22 Aug 2018 15:40:44 +0200 Subject: [PATCH 44/61] Remove deprecated 'brew cask cleanup' command --- .bash_profile | 5 ++--- README.md | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.bash_profile b/.bash_profile index 37662b6..79e0d4d 100755 --- a/.bash_profile +++ b/.bash_profile @@ -1,8 +1,7 @@ # Update Homebrew itself, upgrade all packages, remove dead symlinks, remove old versions # of installed formulas, clean old downloads from cache, remove versions of formulas, which -# are downloaded, but not installed, check system for potential problems, remove cached -# Homebrew-Cask downloads -alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' +# are downloaded, but not installed, check system for potential problems +alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor' # Easier navigation alias ..="cd .." diff --git a/README.md b/README.md index 1a4f8c9..a93fc12 100644 --- a/README.md +++ b/README.md @@ -148,9 +148,8 @@ To use it as default profile, open downloaded `Flat.terminal` file and click **S ```shell # Update Homebrew itself, upgrade all packages, remove dead symlinks, remove old versions # of installed formulas, clean old downloads from cache, remove versions of formulas, which -# are downloaded, but not installed, check system for potential problems, remove cached -# Homebrew-Cask downloads -alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup' +# are downloaded, but not installed, check system for potential problems +alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor' # Easier navigation alias ..="cd .." From 024b1a77a5a30816694db55fc48ecbbfb739aac1 Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Sun, 23 Sep 2018 19:43:10 +0200 Subject: [PATCH 45/61] Update VS Code settings and extensions --- README.md | 7 +++++-- api/install.sh | 2 +- settings.json | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a93fc12..f8239da 100644 --- a/README.md +++ b/README.md @@ -467,6 +467,8 @@ Here are my `settings.json` contents: "editor.minimap.enabled": false, "editor.formatOnPaste": true, "editor.detectIndentation": false, + "editor.dragAndDrop": false, + "editor.snippetSuggestions": "top", "problems.decorations.enabled": false, "explorer.openEditors.visible": 0, "explorer.decorations.colors": false, @@ -476,7 +478,7 @@ Here are my `settings.json` contents: "files.exclude": { "**/node_modules/": true, "**/.vscode/": true, - "**/.localized": true, + "**/.localized": true }, "html.autoClosingTags": false, "material-icon-theme.folders.theme": "classic", @@ -526,6 +528,7 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti - [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) - debug JavaScript code running in Google Chrome from VS Code - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - integrate ESLint into VS Code - [Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) - icons based on Material Design +- [npm Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.npm-intellisense) - autocomplete npm modules in import statements - [open in browser](https://marketplace.visualstudio.com/items?itemName=techer.open-in-browser) - open any file in browser right from VS Code explorer - [Path Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense) - autocomplete filenames - [Project Manager](https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager) - manage projects right inside VS Code @@ -534,7 +537,7 @@ $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/setti To install all extensions by one command use: ```shell -$ code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension aaron-bond.better-comments --install-extension kamikillerto.vscode-colorize +$ code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension aaron-bond.better-comments --install-extension kamikillerto.vscode-colorize --install-extension christian-kohler.npm-intellisense ``` ### Snippets diff --git a/api/install.sh b/api/install.sh index 58cef85..fb52f3c 100644 --- a/api/install.sh +++ b/api/install.sh @@ -164,7 +164,7 @@ if $IS_VSCODE_INSTALLED; then if [ "$REPLY" == "y" ]; then echo "${ARROW} Installing Visual Studio Code extensions..." - code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension aaron-bond.better-comments --install-extension kamikillerto.vscode-colorize + code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension aaron-bond.better-comments --install-extension kamikillerto.vscode-colorize --install-extension christian-kohler.npm-intellisense fi fi diff --git a/settings.json b/settings.json index 06397f9..6866132 100644 --- a/settings.json +++ b/settings.json @@ -12,6 +12,8 @@ "editor.minimap.enabled": false, "editor.formatOnPaste": true, "editor.detectIndentation": false, + "editor.dragAndDrop": false, + "editor.snippetSuggestions": "top", "problems.decorations.enabled": false, "explorer.openEditors.visible": 0, "explorer.decorations.colors": false, @@ -21,7 +23,7 @@ "files.exclude": { "**/node_modules/": true, "**/.vscode/": true, - "**/.localized": true, + "**/.localized": true }, "html.autoClosingTags": false, "material-icon-theme.folders.theme": "classic", From 4aedb0f6d6f0760ef9a87b7d5ba99135ab43dd9b Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Mon, 1 Oct 2018 19:54:44 +0200 Subject: [PATCH 46/61] Remove unused VS Code snippets --- snippets.code-snippets | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/snippets.code-snippets b/snippets.code-snippets index 2087d72..3df0f1b 100644 --- a/snippets.code-snippets +++ b/snippets.code-snippets @@ -45,17 +45,6 @@ "body": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst ${1:${TM_FILENAME_BASE}} = props => {\n\treturn (\n\t\t
\n\t\t\t\n\t\t
\n\t);\n};\n\n${1:${TM_FILENAME_BASE}}.propTypes = {\n\t$0\n};\n\nexport default ${1:${TM_FILENAME_BASE}};", "description": "Create React stateless component with PropTypes" }, - // React Native - "importReactNative": { - "prefix": "imrn", - "body": "import { ${1:View} } from 'react-native';", - "description": "Import React Native element" - }, - "createReactNativeStyleSheet": { - "prefix": "rnss", - "body": "const ${1:styles} = StyleSheet.create({\n\t$2\n});", - "description": "Create React Native StyleSheet" - }, // CommonJS "require": { "prefix": "req", @@ -80,6 +69,7 @@ }, "importDestructing": { "prefix": "impd", - "body": "import { $2 } from '$1';" + "body": "import { $2 } from '$1';", + "description": "Import element from module" }, } From 058e8ac315d2a765ac0f9843e0cb32cb5256c67a Mon Sep 17 00:00:00 2001 From: appalaszynski <35331661+appalaszynski@users.noreply.github.com> Date: Mon, 1 Oct 2018 19:57:55 +0200 Subject: [PATCH 47/61] Better installation script, remove not working macOS defaults, update VS Code settings and Brewfile --- Brewfile | 2 - README.md | 77 ++++---- api/brew.sh | 47 ----- api/install.sh | 267 --------------------------- api/npm.sh | 17 -- bootstrap.sh | 57 ------ {api => script}/defaults.sh | 57 +----- script/install.sh | 356 ++++++++++++++++++++++++++++++++++++ settings.json | 2 +- 9 files changed, 398 insertions(+), 484 deletions(-) delete mode 100644 api/brew.sh delete mode 100644 api/install.sh delete mode 100644 api/npm.sh delete mode 100755 bootstrap.sh rename {api => script}/defaults.sh (61%) create mode 100644 script/install.sh diff --git a/Brewfile b/Brewfile index 34b0d74..bd6ee77 100755 --- a/Brewfile +++ b/Brewfile @@ -1,5 +1,3 @@ -tap 'caskroom/cask' - brew 'git' brew 'mas' diff --git a/README.md b/README.md index f8239da..82cb00c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@
-This document describes how I set up front end web development environment on my MacBook Air with **macOS High Sierra 10.13.6**. +This document describes how I set up front end web development environment on my MacBook Air with **macOS Mojave 10.14**. --- @@ -38,33 +38,34 @@ This document describes how I set up front end web development environment on my ## Installation -You can follow the instructions below or use shell script to configure settings automatically. -If you decided on the second option, there are two ways: +You can follow the instructions below or use shell script to configure settings automatically. If you decided on the second option there are two ways: + +- clone/download the repository into your computer and execute `install.sh` from repo root directory: -- clone/download the repository into your computer and execute `bootstrap.sh` script from directory where `bootstrap.sh` is located: ```shell $ cd mac-setup $ ls -Brewfile README.md bootstrap.sh spectacle.json -Flat.terminal api settings.json -$ bash bootstrap.sh +Brewfile README.md settings.json spectacle.json +Flat.terminal script snippets.code-snippets +$ bash script/install.sh ``` + - one line installation - open your terminal and paste the following code: ```shell -$ curl -L https://github.com/appalaszynski/mac-setup/archive/master.tar.gz | tar -xvz; cd mac-setup-master; chmod +x mac-setup.sh; ./bootstrap.sh +$ curl -L https://github.com/appalaszynski/mac-setup/archive/master.tar.gz | tar -xvz; cd mac-setup-master; chmod +x script/install.sh; script/install.sh ```

- +
--- ## System Preferences -After a clean install of operating system, there are a couple of tweaks I like to make to the System Preferences. Some of them are not strictly related to web development environment - I use them because of my personal habits. +After clean install of operating system there are a couple of tweaks I like to make to the System Preferences. Some of them are not strictly related to web development environment - I use them because of my personal habits. - General > User dark menu bar and Dock - General > Ask to keep changes when closing documents @@ -194,7 +195,7 @@ export PS1; When bash is invoked it looks for `~/.bash_profile`, reads it and executes commands from it. In my `.bash_profile` file I create, among others, a `brewup` alias (keyboard shortcut to avoiding typing a long command sequence) to keep Homebrew (which we are going to install in a second) up to date. I also set color scheme for `ls` command output and configure custom prompt which contains username, computer name, working directory and current Git branch. -To download `.bash_profile` and execute its content, use: +To download my `.bash_profile` and execute its content use: ```shell $ cd ~ @@ -206,7 +207,7 @@ $ source ~/.bash_profile ## Homebrew -[Homebrew](http://brew.sh/) package manager allows to install almost any app right from the command line. +[Homebrew](http://brew.sh/) package manager allows to install almost any application right from the command line. ### Installation @@ -216,19 +217,24 @@ $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/inst ### Usage -To install specific package use ```brew install ``` e.g. +To install Homebrew package use ```brew install ```: ```shell -$ brew install git +$ brew install +``` + +To install GUI macOS applications use [Homebrew Cask](https://github.com/Homebrew/homebrew-cask): + +```shell +$ brew cask install ``` ### Brewfile -Installing each package separately may take some time. That's why I use [Homebrew Bundle](https://github.com/Homebrew/homebrew-bundle), which allows to automatically install all packages and applications listed in the `Brewfile` file. +Installing each application and package separately may take some time. [Homebrew Bundle](https://github.com/Homebrew/homebrew-bundle) allows to automatically install everything listed in the `Brewfile` file. -Here are all the programs I install with a brief description. +Here are all applications I usually install with a brief description. -- [Cask](https://github.com/Homebrew/homebrew-cask) - an extension to Homebrew which allows to install almost any program that exists for a Mac - [Git](https://git-scm.com) - version control system - [mas-cli](https://github.com/mas-cli/mas) - Mac App Store command line interface - [AppCleaner](https://freemacsoft.net/appcleaner/) - apps uninstaller @@ -258,17 +264,14 @@ Here are all the programs I install with a brief description. - [Pages](https://www.apple.com/pages/) - text editor - [Xcode](https://developer.apple.com/xcode/) - IDE for developing software for Apple products -Below are the entire contents of my `Brewfile`, which will install all the above programs with a single command. +Below are the entire contents of my `Brewfile`. ```ruby -# Install Cask (Homebrew extension) -tap 'caskroom/cask' - -# Install Git and mas-cli by Homebrew +# Install Git and mas-cli via Homebrew brew 'git' brew 'mas' -# Install programs by Cask +# Install applications via Homebrew Cask cask 'appcleaner' cask 'background-music' cask 'cyberduck' @@ -292,28 +295,26 @@ cask 'tunnelblick' cask 'visual-studio-code' cask 'vlc' -# Install apps from App Store by mas-cli +# Install applications from App Store via mas-cli mas "iMovie", id: 408981434 mas "Numbers", id: 409203825 mas "Pages", id: 409201541 mas "Xcode", id: 497799835 ``` -To check App Store application ID use: +To check App Store application ID you must install `mas-cli` first. Then use: ```shell $ mas search ``` -but, of course, you must first install `mas-cli`. - -To download my `Brewfile` file type: +My `Brewfile` file can be downloaded using: ```shell $ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/Brewfile ``` -To install applications listed in `Brewfile` use: +To install listed applications type: ```shell $ brew bundle @@ -354,14 +355,12 @@ Here I set my name, email, core editor and connect Git to the macOS Keychain so ### SSH -You can also authenticate with GiHub using SSH key. To generate it, use following code: +You can also authenticate with GiHub using SSH key. To generate it use following code: ```shell $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com" ``` -but first make sure that there is a `~/.ssh` directory on your computer. - Above command will create a private key (`id_rsa`) and public key (`id_rsa.pub`) in `~/.ssh` directory. Next, add your newly created SSH key to the ssh-agent to be able to manage your keys. @@ -393,7 +392,7 @@ For installation of Node.js I like to use [Node Version Manager](https://github. $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash ``` -You can check all available Node.js versions by: +You can check all available Node.js versions by typing: ```shell $ nvm list-remote @@ -413,12 +412,12 @@ Packages which I use globally at the moment are: * [gulp-cli](https://gulpjs.com) * [jest](http://jestjs.io/) * [live-server](http://tapiov.net/live-server/) -* [npm-upgrade](https://github.com/th0r/npm-upgrade) +* [create-react-app](https://github.com/facebook/create-react-app) To install them use: ```shell -$ npm install -g gulp-cli jest live-server npm-upgrade +$ npm install -g gulp-cli jest live-server create-react-app ``` --- @@ -449,7 +448,7 @@ For main development I use Google Chrome. ## Visual Studio Code -All default settings changes are stored in `settings.json` file. You can open it by pressing `Command ⌘` + `,` or by going to **Code** > **Preferences** > **Settings**. This file is located in `/Users//Library/Application Support/Code/User`. +All default settings changes are stored in `settings.json` file located in `/Users//Library/Application Support/Code/User`. You can open it by pressing `Command ⌘` + `Shift ⇧` + `p` and choosing `Preferences: Open Settings (JSON)`. Here are my `settings.json` contents: ```json @@ -464,6 +463,7 @@ Here are my `settings.json` contents: "editor.fontSize": 12, "editor.tabSize": 2, "editor.multiCursorModifier": "ctrlCmd", + "editor.wordWrap": "on", "editor.minimap.enabled": false, "editor.formatOnPaste": true, "editor.detectIndentation": false, @@ -477,7 +477,6 @@ Here are my `settings.json` contents: "files.insertFinalNewline": true, "files.exclude": { "**/node_modules/": true, - "**/.vscode/": true, "**/.localized": true }, "html.autoClosingTags": false, @@ -512,7 +511,7 @@ Here are my `settings.json` contents: } ``` -You can copy and paste them or just download whole file by: +You can copy and paste them or just download whole file by typing: ```shell $ cd /Users//Library/Application Support/Code/User @@ -542,6 +541,6 @@ $ code --install-extension CoenraadS.bracket-pair-colorizer --install-extension ### Snippets -I use my own global snippets instead of installing an extensions. User custom global snippets are located in `/Users//Library/Application Support/Code/User/snippets` as files with `code-snippets` extension. You can easily create or edit them by going to **Code** > **Preferences** > **User Snippets** and selecting specific file from a list. +I use my own global snippets instead of installing snippets extensions. User custom global snippets are located in `/Users//Library/Application Support/Code/User/snippets` as files with `code-snippets` extension. You can easily create or edit them by going to **Code** > **Preferences** > **User Snippets**. You can find all my snippets in [snippets.code-snippets](https://github.com/appalaszynski/mac-setup/blob/master/snippets.code-snippets). diff --git a/api/brew.sh b/api/brew.sh deleted file mode 100644 index b4598eb..0000000 --- a/api/brew.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -install_bundle() { - # Install Cask (Homebrew extension) - brew tap caskroom/cask - - # Install mas-cli by Homebrew - brew install mas - - # List of programs to install by Cask - applications_to_install=( - appcleaner - background-music - cyberduck - drawio - firefox - flux - fork - google-chrome - gpg-suite - keepingyouawake - keka - mamp - opera - postman - sequel-pro - skype - slack - spectacle - transmission - tunnelblick - visual-studio-code - vlc - ) - - # Install all listed programs - for application in "${applications_to_install[@]}" - do - brew cask install ${application} - done - - # Install apps from App Store by mas-cli - mas install 408981434 #iMovie - mas install 409203825 #Numbers - mas install 409201541 #Pages - mas install 497799835 #Xcode -} diff --git a/api/install.sh b/api/install.sh deleted file mode 100644 index fb52f3c..0000000 --- a/api/install.sh +++ /dev/null @@ -1,267 +0,0 @@ -#!/bin/bash - -source ../bootstrap.sh -source ./brew.sh -source ./npm.sh - -# Clear the terminal screen -clear - -echo "Welcome to the installer!" -echo -e "First, introduce your password to execute all the commands as super user.$NEW_LINE" -echo -e "${RED}${BOLD}Important:$DEFAULT You can be asked more times for password during the process." -echo -e "Also, make sure that You are logged in to the Mac App Store.$NEW_LINE" - -# Prompt user for password -sudo -v -while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & - -#---------------------------- -# Homebrew -#---------------------------- - -if hash brew 2>/dev/null; then - IS_HOMEBREW_INSTALLED=true -fi - -if $IS_HOMEBREW_INSTALLED; then - echo "${ARROW} Homebrew already installed!" -else - read -ep "${ARROW} Install Homebrew and update it? [y/n]: " - - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Homebrew..." - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - - echo "${ARROW} Updating Homebrew formulas..." - brew update - brew upgrade - - IS_HOMEBREW_INSTALLED=true - fi -fi - -#---------------------------- -# Git -#---------------------------- - -if $IS_HOMEBREW_INSTALLED; then - read -p "${ARROW} Install latest Git version via Homebrew? [y/n]: " - - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Git..." - brew install git - fi -fi - -#---------------------------- -# .bash_profile -#---------------------------- - -read -p "${ARROW} Configure .bash_profile? [y/n]: " - -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring .bash_profile..." - cp .bash_profile ~ -fi - -#---------------------------- -# Application bundle -#---------------------------- - -if $IS_HOMEBREW_INSTALLED; then - read -p "${ARROW} Install bundle of applications via Homebrew-Cask? [y/n]: " - - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing applications..." - install_bundle - - open /Applications/Flux.app - open /Applications/Spectacle.app - open /Applications/KeepingYouAwake.app - fi -fi - -#---------------------------- -# Terminal profile -#---------------------------- - -read -p "${ARROW} Configure Terminal profile? [y/n]: " - -if [ "$REPLY" == "y" ]; then - echo -e "\033[1;33mNote:\033[0m New Terminal window opened. Click 'Shell' > 'Use settings as default' to use it as default profile." - open ./Flat.terminal -fi - -#---------------------------- -# Node Version Manager -#---------------------------- - -if ! [ -x "$(command -v nvm)" ]; then - IS_NVM_INSTALLED=true -fi - -if $IS_NVM_INSTALLED; then - echo "${ARROW} Node Version Manager already installed!" -else - read -p "${ARROW} Install nvm (Node Version Manager)? [y/n]: " - - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Node Version Manager..." - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash - source ~/.bash_profile - - IS_NVM_INSTALLED=true - fi -fi - -#---------------------------- -# Node.js -#---------------------------- - -if hash node 2>/dev/null; then - IS_NODE_INSTALLED=true -fi - -if $IS_NODE_INSTALLED; then - echo "${ARROW} Node.js already installed!" -else - if [ $IS_NVM_INSTALLED == true ]; then - read -p "${ARROW} Install latest LTS version of Node.js? [y/n]: " - - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Node.js..." - nvm install --lts - - IS_NODE_INSTALLED=true - fi - fi -fi - -#---------------------------- -# npm packages -#---------------------------- - -if $IS_NODE_INSTALLED; then - read -p "${ARROW} Install bundle of npm packages? [y/n]: " - - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing npm packages.." - install_npm_packages - fi -fi - -#---------------------------- -# VS Code extensions -#---------------------------- - -if hash code 2>/dev/null; then - IS_VSCODE_INSTALLED=true -fi - -if $IS_VSCODE_INSTALLED; then - read -p "${ARROW} Install bundle of Visual Studio Code extensions? [y/n]: " - - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Visual Studio Code extensions..." - code --install-extension CoenraadS.bracket-pair-colorizer --install-extension PKief.material-icon-theme --install-extension alefragnani.project-manager --install-extension christian-kohler.path-intellisense --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mrmlnc.vscode-scss --install-extension msjsdiag.debugger-for-chrome --install-extension techer.open-in-browser --install-extension aaron-bond.better-comments --install-extension kamikillerto.vscode-colorize --install-extension christian-kohler.npm-intellisense - fi -fi - -#---------------------------- -# VS Code settings -#---------------------------- - -if $IS_VSCODE_INSTALLED; then - read -p "${ARROW} Configure Visual Studio Code settings? [y/n]: " - - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring Visual Studio Code..." - cp settings.json /Users/${USER}/Library/Application\ Support/Code/User - fi -fi - -#---------------------------- -# VS Code snippets -#---------------------------- - -if $IS_VSCODE_INSTALLED; then - read -p "${ARROW} Configure Visual Studio Code snippets? [y/n]: " - - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring Visual Studio Code snippets..." - cp snippets.code-snippets /Users/${USER}/Library/Application\ Support/Code/User/snippets - fi -fi - -#---------------------------- -# .gitconfig -#---------------------------- - -read -p "${ARROW} Configure .gitconfig? [y/n]: " - -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring .gitconfig..." - cp .gitconfig ~ -fi - -#---------------------------- -# Spectacle shortcuts -#---------------------------- - -if [ -d /Applications/Spectacle.app/ ]; then - IS_SPECTACLE_INSTALLED=true -fi - -if $IS_SPECTACLE_INSTALLED; then - read -p "${ARROW} Configure Spectacle shotrcuts? [y/n]: " - - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring Spectacle shotrcuts..." - cp -r spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null - fi -fi - -#---------------------------- -# Firmware password -#---------------------------- - -if [[ $(sudo firmwarepasswd -check) =~ "Password Enabled: Yes" ]]; then - echo "${ARROW} Firmware password is already set up!" -else - read -p "${ARROW} Set up firmware password? [y/n]: " - - if [ "$REPLY" == "y" ]; then - sudo firmwarepasswd -setpasswd -setmode command - fi -fi - -#---------------------------- -# Computer name -#---------------------------- - -read -p "${ARROW} Set computer name? [y/n]: " - -if [ "$REPLY" == "y" ]; then - read -p 'Please enter computer name: ' uservar - - sudo scutil --set ComputerName $uservar - sudo scutil --set HostName $uservar - sudo scutil --set LocalHostName $uservar -fi - -#---------------------------- -# macOS Defaults -#---------------------------- - -read -p "${ARROW} Configure macOS Defaults? [y/n]: " - -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring macOS Defaults..." - . ./api/defaults.sh -fi - -echo -e "${NEW_LINE}${YELLOW}${BOLD}Note:$DEFAULT Some changes may need system restart to be applied!" -echo -e "${NEW_LINE}${GREEN}${BOLD}Congratulations, installation complete!${DEFUALT}" - -exit 1 diff --git a/api/npm.sh b/api/npm.sh deleted file mode 100644 index dab1268..0000000 --- a/api/npm.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -install_npm_packages() { - # List of packages to install by npm - npm_packages=( - gulp-cli - jest - live-server - npm-upgrade - ) - - # Install all listed packages - for package in "${npm_packages[@]}" - do - npm install -g ${package} - done -} diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index 8511111..0000000 --- a/bootstrap.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -# Colors -BOLD=$(tput bold) -CYAN=$(tput setaf 6) -RED=$(tput setaf 1) -GREEN=$(tput setaf 2) -YELLOW=$(tput setaf 3) -DEFAULT=$(tput sgr0) -# Arrow used when reading from input e.g. '==> Install Homebrew and update it? [y/n]: ' -ARROW="$CYAN$BOLD==>$DEFAULT" -# For now, assume that none of necessary programs is installed -IS_HOMEBREW_INSTALLED=false -IS_NVM_INSTALLED=false -IS_NODE_INSTALLED=false -IS_VSCODE_INSTALLED=false -# Horizonal line in cyan color -DIVIDER="${CYAN}${BOLD}------------------------------------------------$DEFAULT" -# New line character -NEW_LINE="\n" -# Project logo -LOGO=" __ __ _____ _ -| \/ | / ____| | | -| \ / | __ _ ___ | (___ ___| |_ _ _ _ __ -| |\/| |/ _\` |/ __| \___ \ / _ \ __| | | | '_ \\ -| | | | (_| | (__ ____) | __/ |_| |_| | |_) | -|_| |_|\__,_|\___| |_____/ \___|\__|\__,_| .__/ - | | - |_|" - -# Clear the terminal screen -clear - -# Print logo and description -echo -e "${CYAN}${BOLD}${LOGO}${DEFAULT}${NEW_LINE}" -echo -e "${CYAN}${BOLD} Front End Web Development Setup for macOS$NEW_LINE" -echo -e "$DIVIDER" -echo " " -echo " " -echo -e "${DIVIDER}${NEW_LINE}" - -PS3=' -Number to execute: ' - -options=("Install" "Quit") -select opt in "${options[@]}" -do - case $opt in - "Install") - . api/install.sh - ;; - "Quit") - break - ;; - *) echo Invalid option!;; - esac -done diff --git a/api/defaults.sh b/script/defaults.sh similarity index 61% rename from api/defaults.sh rename to script/defaults.sh index ae1f31e..1219e80 100755 --- a/api/defaults.sh +++ b/script/defaults.sh @@ -20,40 +20,6 @@ defaults write com.apple.finder NewWindowTarget -string "PfHm" # Disable showing tags defaults write com.apple.finder ShowRecentTags -int 0 -################################# -#### SAFARI -################################# - -# Disable auto-fill -defaults write com.apple.Safari AutoFillCreditCardData -int 0 -defaults write com.apple.Safari AutoFillFromAddressBook -int 0 -defaults write com.apple.Safari AutoFillMiscellaneousForms -int 0 -defaults write com.apple.Safari AutoFillPasswords -int 0 - -# Prevent Safari from opening ‘safe’ files automatically after downloading -defaults write com.apple.Safari AutoOpenSafeDownloads -int 0 - -# Remove history after one day -defaults write com.apple.Safari HistoryAgeInDaysLimit -int 1 - -# Prevent Safari from loading "best match" site before opening it -defaults write com.apple.Safari PreloadTopHit -int 0 - -# Enable “Do Not Track” -defaults write com.apple.Safari SendDoNotTrackHTTPHeader -int 1 - -# Show the full URL in the address bar -defaults write com.apple.Safari ShowFullURLInSmartSearchField -int 1 - -# Don’t send search queries to Apple -defaults write com.apple.Safari SuppressSearchSuggestions -int 0 -defaults write com.apple.Safari UniversalSearchEnabled -int 0 -defaults write com.apple.Safari WebsiteSpecificSearchEnabled -int 0 - -# Enable the Develop menu and the Web Inspector in Safari -defaults write com.apple.Safari IncludeDevelopMenu -int 1 -defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -int 1 - ######################################## #### DOCK ######################################## @@ -137,13 +103,13 @@ defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 ################################# # Disable transparency -defaults write com.apple.universalaccess reduceTransparency -bool true +defaults read com.apple.universalaccess reduceTransparency -bool true # Use plain text mode for new TextEdit documents -defaults write com.apple.TextEdit RichText -int 0 +defaults read com.apple.TextEdit RichText -int 0 # Disable spelling check in TextEdit documents -defaults write com.apple.TextEdit CheckSpellingWhileTyping -int 0 +defaults read com.apple.TextEdit CheckSpellingWhileTyping -int 0 # Expand save panel by default defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true @@ -169,23 +135,6 @@ defaults write NSGlobalDomain com.apple.sound.beep.sound -string "/System/Librar # Set date format in menubar defaults write "com.apple.menuextra.clock" DateFormat -string "EEE d.MM HH:mm" -defaults write "com.apple.systemuiserver" DateFormat -string "EEE d.MM HH:mm" - -# Enable snap-to-grid for icons on the desktop and in other icon views -/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist - -# Decrease grid spacing for icons on the desktop and in other icon views -/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 15" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 15" ~/Library/Preferences/com.apple.finder.plist - -# Decrease the size of icons on the desktop and in other icon views -/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 44" ~/Library/Preferences/com.apple.finder.plist - -# Disable icons preview on the desktop and in other icon views -/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showIconPreview 0" ~/Library/Preferences/com.apple.finder.plist applications_to_kill=( "Activity Monitor" diff --git a/script/install.sh b/script/install.sh new file mode 100644 index 0000000..0b19413 --- /dev/null +++ b/script/install.sh @@ -0,0 +1,356 @@ +#!/bin/bash + +# Logo +LOGO=" __ __ _____ _ +| \/ | / ____| | | +| \ / | __ _ ___ | (___ ___| |_ _ _ _ __ +| |\/| |/ _\` |/ __| \___ \ / _ \ __| | | | '_ \\ +| | | | (_| | (__ ____) | __/ |_| |_| | |_) | +|_| |_|\__,_|\___| |_____/ \___|\__|\__,_| .__/ + | | + |_|" +# Colors +BOLD=$(tput bold) +CYAN=$(tput setaf 6) +RED=$(tput setaf 1) +GREEN=$(tput setaf 2) +YELLOW=$(tput setaf 3) +DEFAULT=$(tput sgr0) +# New line character +NEW_LINE="\n" +# Horizonal line in cyan color +DIVIDER="${CYAN}${BOLD}------------------------------------------------$DEFAULT" +# Arrows +ARROW="$CYAN$BOLD==>$DEFAULT" +ARROW_GREEN="$GREEN$BOLD==>$DEFAULT" +ARROW_YELLOW="$YELLOW$BOLD==>$DEFAULT" +# Array of available applications that can be installed via Homebrew Cask +AVAILABLE_CASK_APPLICATIONS=(appcleaner background-music cyberduck drawio firefox flux fork google-chrome gpg-suite keepingyouawake keka mamp opera postman sequel-pro skype slack spectacle transmission tunnelblick visual-studio-code vlc) +# Array of available npm packages +AVAILABLE_NPM_PACKAGES=(gulp-cli jest live-server create-react-app) +# Array of available VS Code extensions +AVAILABLE_VSCODE_EXTENSIONS=(CoenraadS.bracket-pair-colorizer PKief.material-icon-theme alefragnani.project-manager christian-kohler.path-intellisense dbaeumer.vscode-eslint formulahendry.auto-rename-tag mrmlnc.vscode-scss msjsdiag.debugger-for-chrome techer.open-in-browser aaron-bond.better-comments kamikillerto.vscode-colorize christian-kohler.npm-intellisense) +# Arrays of applications/packages/extensions selected by user (empty by default) +SELECTED_CASK_APPLICATIONS=() +SELECTED_NPM_PACKAGES=() +SELECTED_VSCODE_EXTENTIONS=() +# Booleans to track if specific programs are already installed +IS_HOMEBREW_INSTALLED=false +IS_MAS_INSTALLED=false +IS_NVM_INSTALLED=false +IS_NODE_INSTALLED=false +IS_VSCODE_INSTALLED=false + +clear + +# Print logo and description +echo -e "${CYAN}${BOLD}${LOGO}${DEFAULT}${NEW_LINE}" +echo -e "${CYAN}${BOLD} Front End Web Development Setup for macOS$NEW_LINE" +echo -e "$DIVIDER" +echo " " +echo " " +echo -e "${DIVIDER}${NEW_LINE}" + +echo "Welcome to the installer!" +echo -e "First, introduce your password to execute all the commands as super user.$NEW_LINE" + +echo -e "${RED}${BOLD}Important:$DEFAULT You can be asked more times for password during the process." +echo -e "Also, make sure that You are logged in to the Mac App Store.$NEW_LINE" + +# Prompt user for password +sudo -v + +clear + +#---------------------------- +# Homebrew +#---------------------------- + +if hash brew 2>/dev/null; then + IS_HOMEBREW_INSTALLED=true +fi + +if $IS_HOMEBREW_INSTALLED; then + echo "${ARROW_GREEN} Homebrew already installed!" + echo "${ARROW} Updating Homebrew formulas..." + + brew update + brew upgrade +else + read -ep "${ARROW_YELLOW} Install Homebrew? [y/n]: " + + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Homebrew..." + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + + IS_HOMEBREW_INSTALLED=true + fi +fi + +#---------------------------- +# Git +#---------------------------- + +if $IS_HOMEBREW_INSTALLED; then + read -p "${ARROW_YELLOW} Install latest Git version via Homebrew? [y/n]: " + + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Git..." + brew install git + fi +fi + +#---------------------------- +# .gitconfig +#---------------------------- + +read -p "${ARROW_YELLOW} Configure Git by creating ~/.gitconfig file? [y/n]: " + +if [ "$REPLY" == "y" ]; then + read -p "${ARROW_YELLOW} Please enter Git username: " username + read -p "${ARROW_YELLOW} Please enter Git e-mail: " email + read -p "${ARROW_YELLOW} Please enter Git editor: " editor + echo "${ARROW} Creating ~/.gitconfig file..." + + cp .gitconfig ~ + sed -i -e "s/First Last/$username/g" ~/.gitconfig + sed -i -e "s/email@email.com/$email/g" ~/.gitconfig + sed -i -e "s/= editor/= $editor/g" ~/.gitconfig +fi + +#---------------------------- +# .bash_profile +#---------------------------- + +read -p "${ARROW_YELLOW} Configure bash by creating ~/.bash_profile file? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Creating ~/.bash_profile file..." + cp .bash_profile ~ +fi + +#---------------------------- +# Application bundle +#---------------------------- + +if $IS_HOMEBREW_INSTALLED; then + read -p "${ARROW_YELLOW} Install applications via Homebrew Cask? [y/n]: " + + if [ "$REPLY" == "y" ]; then + for item in "${AVAILABLE_CASK_APPLICATIONS[@]}"; do + read -ep "${ARROW_YELLOW} Install \"$item\"? [y/n]: " + if [ "$REPLY" == "y" ]; then + SELECTED_CASK_APPLICATIONS+=("$item") + fi + done + + if [ ${#SELECTED_CASK_APPLICATIONS[@]} -gt 0 ]; then + echo "${ARROW} Installing applications via Homebrew Cask..." + for application in "${SELECTED_CASK_APPLICATIONS[@]}"; do + brew cask install ${application} + done + fi + + fi + +fi + +#---------------------------- +# Terminal profile +#---------------------------- + +read -p "${ARROW_YELLOW} Download Flat Terminal profile? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW_YELLOW} New Terminal window opened. Click 'Shell' > 'Use settings as default' to use it as default profile." + open ./Flat.terminal +fi + +#---------------------------- +# Node Version Manager +#---------------------------- + +if ! [ -x "$(command -v nvm)" ]; then + IS_NVM_INSTALLED=true +fi + +if $IS_NVM_INSTALLED; then + echo "${ARROW_GREEN} Node Version Manager already installed!" +else + read -p "${ARROW_YELLOW} Install nvm (Node Version Manager)? [y/n]: " + + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Node Version Manager..." + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash + source ~/.bash_profile + + IS_NVM_INSTALLED=true + fi +fi + +#---------------------------- +# Node.js +#---------------------------- + +if hash node 2>/dev/null; then + IS_NODE_INSTALLED=true +fi + +if $IS_NODE_INSTALLED; then + echo "${ARROW_GREEN} Node.js already installed!" +else + if [ $IS_NVM_INSTALLED == true ]; then + read -p "${ARROW_YELLOW} Install latest LTS version of Node.js? [y/n]: " + + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Node.js..." + nvm install --lts + + IS_NODE_INSTALLED=true + fi + fi +fi + +#---------------------------- +# npm packages +#---------------------------- + +if $IS_NODE_INSTALLED; then + read -p "${ARROW_YELLOW} Install global npm packages? [y/n]: " + + if [ "$REPLY" == "y" ]; then + + for item in "${AVAILABLE_NPM_PACKAGES[@]}"; do + read -ep "${ARROW_YELLOW} Install \"$item\"? [y/n]: " + if [ "$REPLY" == "y" ]; then + SELECTED_NPM_PACKAGES+=("$item") + fi + done + + if [ ${#SELECTED_NPM_PACKAGES[@]} -gt 0 ]; then + echo "${ARROW} Installing global npm packages.." + for application in "${SELECTED_NPM_PACKAGES[@]}"; do + npm install -g ${application} + done + fi + + fi + +fi + +#---------------------------- +# VS Code extensions +#---------------------------- + +if hash code 2>/dev/null; then + IS_VSCODE_INSTALLED=true +fi + +if $IS_VSCODE_INSTALLED; then + read -p "${ARROW_YELLOW} Install Visual Studio Code extensions? [y/n]: " + + if [ "$REPLY" == "y" ]; then + for item in "${AVAILABLE_VSCODE_EXTENSIONS[@]}"; do + read -ep "${ARROW_YELLOW} Install \"$item\"? [y/n]: " + if [ "$REPLY" == "y" ]; then + SELECTED_VSCODE_EXTENSIONS+=("$item") + fi + done + + if [ ${#SELECTED_VSCODE_EXTENSIONS[@]} -gt 0 ]; then + echo "${ARROW} Installing Visual Studio Code extensions..." + for application in "${SELECTED_NPM_PACKAGES[@]}"; do + code --install-extension ${application} + done + fi + + fi + +fi + +#---------------------------- +# VS Code settings +#---------------------------- + +if $IS_VSCODE_INSTALLED; then + read -p "${ARROW_YELLOW} Configure Visual Studio Code settings? [y/n]: " + + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring Visual Studio Code settings..." + cp settings.json /Users/${USER}/Library/Application\ Support/Code/User + fi +fi + +#---------------------------- +# VS Code snippets +#---------------------------- + +if $IS_VSCODE_INSTALLED; then + read -p "${ARROW_YELLOW} Configure Visual Studio Code snippets? [y/n]: " + + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring Visual Studio Code snippets..." + cp snippets.code-snippets /Users/${USER}/Library/Application\ Support/Code/User/snippets + fi +fi + +#---------------------------- +# Spectacle shortcuts +#---------------------------- + +if [ -d /Applications/Spectacle.app/ ]; then + IS_SPECTACLE_INSTALLED=true +fi + +if $IS_SPECTACLE_INSTALLED; then + read -p "${ARROW_YELLOW} Configure Spectacle shotrcuts? [y/n]: " + + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring Spectacle shotrcuts..." + cp -r spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null + fi +fi + +#---------------------------- +# Firmware password +#---------------------------- + +if [[ $(sudo firmwarepasswd -check) =~ "Password Enabled: Yes" ]]; then + echo "${ARROW_GREEN} Firmware password is already set up!" +else + read -p "${ARROW_YELLOW} Set up firmware password? [y/n]: " + + if [ "$REPLY" == "y" ]; then + sudo firmwarepasswd -setpasswd -setmode command + fi +fi + +#---------------------------- +# Computer name +#---------------------------- + +read -p "${ARROW_YELLOW} Set computer name? [y/n]: " + +if [ "$REPLY" == "y" ]; then + read -p "${ARROW_YELLOW} Please enter computer name: " uservar + + sudo scutil --set ComputerName $uservar + sudo scutil --set HostName $uservar + sudo scutil --set LocalHostName $uservar +fi + +#---------------------------- +# macOS Defaults +#---------------------------- + +read -p "${ARROW_YELLOW} Configure macOS Defaults? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Configuring macOS Defaults..." + . ./api/defaults.sh +fi + +echo -e "${NEW_LINE}${YELLOW}${BOLD}Note:$DEFAULT Some changes may need system restart to be applied!" +echo -e "${NEW_LINE}${GREEN}${BOLD}Congratulations, installation complete!${DEFUALT}${NEW_LINE}" + +exit 1 diff --git a/settings.json b/settings.json index 6866132..ea2c0b1 100644 --- a/settings.json +++ b/settings.json @@ -9,6 +9,7 @@ "editor.fontSize": 12, "editor.tabSize": 2, "editor.multiCursorModifier": "ctrlCmd", + "editor.wordWrap": "on", "editor.minimap.enabled": false, "editor.formatOnPaste": true, "editor.detectIndentation": false, @@ -22,7 +23,6 @@ "files.insertFinalNewline": true, "files.exclude": { "**/node_modules/": true, - "**/.vscode/": true, "**/.localized": true }, "html.autoClosingTags": false, From cb3c6b914e3c8aacb27a72f877487abd3b6ad001 Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Tue, 16 Oct 2018 08:04:42 -0400 Subject: [PATCH 48/61] Customize mac-setup for my development needs. - Install oh-my-zsh - Install ruby-build and rbenv - Custom macOS Defaults - Temporarily disable Code customizations and other front end stuff - Prefer iTerm over Terminal app - Other things I can't remember --- .bash_profile | 43 ---- .gitconfig | 15 ++ .zshrc | 114 +++++++++ Dracula.itermcolors | 225 +++++++++++++++++ Flat.terminal | 295 ---------------------- oh-my-zsh/aliases.zsh | 10 + oh-my-zsh/plugins/zsh-autosuggestions | 1 + oh-my-zsh/plugins/zsh-syntax-highlighting | 1 + oh-my-zsh/themes/tranquility.zsh-theme | 100 ++++++++ script/defaults.sh | 168 +++++++++--- script/install.sh | 225 +++++++++-------- spectacle.json | 74 +++--- 12 files changed, 761 insertions(+), 510 deletions(-) delete mode 100755 .bash_profile create mode 100644 .zshrc create mode 100755 Dracula.itermcolors delete mode 100644 Flat.terminal create mode 100644 oh-my-zsh/aliases.zsh create mode 160000 oh-my-zsh/plugins/zsh-autosuggestions create mode 160000 oh-my-zsh/plugins/zsh-syntax-highlighting create mode 100644 oh-my-zsh/themes/tranquility.zsh-theme diff --git a/.bash_profile b/.bash_profile deleted file mode 100755 index 79e0d4d..0000000 --- a/.bash_profile +++ /dev/null @@ -1,43 +0,0 @@ -# Update Homebrew itself, upgrade all packages, remove dead symlinks, remove old versions -# of installed formulas, clean old downloads from cache, remove versions of formulas, which -# are downloaded, but not installed, check system for potential problems -alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor' - -# Easier navigation -alias ..="cd .." -alias ....="cd ../.." - -# Shortcuts -alias p="cd ~/Projects" -alias d="cd ~/Desktop" - -# Configure ls command -export CLICOLOR=1 # Enable ANSI colors sequences to distinguish file types -export LSCOLORS=GxFxCxDxBxegedabagaced # Value of this variable describes what color to use for which file type - -# Color definitions (used in prompt) -RED='\[\033[1;31m\]' -GREEN='\[\033[1;32m\]' -YELLOW='\[\033[1;33m\]' -PURPLE='\[\033[1;35m\]' -GRAY='\[\033[1;30m\]' -DEFAULT='\[\033[0m\]' - -# Function which prints current Git branch name (used in prompt) -parse_git_branch() { - git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' -} - -# Configure prompt -PS1="${RED}\u" # Username -PS1+=" ${GRAY}• " # Separator -PS1+="${GREEN}\h" # Hostname -PS1+=" ${GRAY}• " # Separator -PS1+="${YELLOW}\w" # Working directory -PS1+=" ${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \"•\") " # Separator (if there is a Git repository) -PS1+="${PURPLE}\$(parse_git_branch)" # Git branch -PS1+="\n" # New line -PS1+="${GRAY}\$ " # Dollar sign -PS1+="${DEFAULT}" # Get back default color - -export PS1; diff --git a/.gitconfig b/.gitconfig index 7e45dfc..5ff1442 100644 --- a/.gitconfig +++ b/.gitconfig @@ -5,3 +5,18 @@ editor = editor [credential] helper = osxkeychain +[color] + ui = true + diff = auto + status = auto + branch = auto + interactive = auto + pager = true +[color "branch"] + current = green reverse +[color "diff"] + meta = yellow +[color "status"] + untracked = cyan +[pager] + branch = false diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..bc4630d --- /dev/null +++ b/.zshrc @@ -0,0 +1,114 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. +export ZSH="$HOME/.oh-my-zsh" + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes +ZSH_THEME="tranquility" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +# DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +ZSH_CUSTOM=custom_path + +# bundler plugin settings +BUNDLED_COMMANDS=(rubocop) + +# Which plugins would you like to load? +# Standard plugins can be found in ~/.oh-my-zsh/plugins/* +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=( + bundler + git + rails + tig + urltools + zsh-syntax-highlighting + zsh-autosuggestions +) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi +if which direnv > /dev/null; then eval "$(direnv hook zsh)"; fi + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='mvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# ssh +# export SSH_KEY_PATH="~/.ssh/rsa_id" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" diff --git a/Dracula.itermcolors b/Dracula.itermcolors new file mode 100755 index 0000000..619da48 --- /dev/null +++ b/Dracula.itermcolors @@ -0,0 +1,225 @@ + + + + + + + + Ansi 0 Color + + Blue Component + 0.0 + Green Component + 0.0 + Red Component + 0.0 + + Ansi 1 Color + + Blue Component + 0.3333333432674408 + Green Component + 0.3333333432674408 + Red Component + 1 + + Ansi 10 Color + + Blue Component + 0.4823529411764706 + Green Component + 0.98039215686274506 + Red Component + 0.31372549019607843 + + Ansi 11 Color + + Blue Component + 0.5490196078431373 + Green Component + 0.98039215686274506 + Red Component + 0.94509803921568625 + + Ansi 12 Color + + Blue Component + 0.97647058823529409 + Green Component + 0.57647058823529407 + Red Component + 0.74117647058823533 + + Ansi 13 Color + + Blue Component + 0.77647058823529413 + Green Component + 0.47450980392156861 + Red Component + 1 + + Ansi 14 Color + + Blue Component + 0.99215686274509807 + Green Component + 0.9137254901960784 + Red Component + 0.54509803921568623 + + Ansi 15 Color + + Blue Component + 1 + Green Component + 1 + Red Component + 1 + + Ansi 2 Color + + Blue Component + 0.4823529411764706 + Green Component + 0.98039215686274506 + Red Component + 0.31372549019607843 + + Ansi 3 Color + + Blue Component + 0.5490196078431373 + Green Component + 0.98039215686274506 + Red Component + 0.94509803921568625 + + Ansi 4 Color + + Blue Component + 0.97647058823529409 + Green Component + 0.57647058823529407 + Red Component + 0.74117647058823533 + + Ansi 5 Color + + Blue Component + 0.77647058823529413 + Green Component + 0.47450980392156861 + Red Component + 1 + + Ansi 6 Color + + Blue Component + 0.99215686274509807 + Green Component + 0.9137254901960784 + Red Component + 0.54509803921568623 + + Ansi 7 Color + + Blue Component + 0.73333334922790527 + Green Component + 0.73333334922790527 + Red Component + 0.73333334922790527 + + Ansi 8 Color + + Blue Component + 0.33333333333333331 + Green Component + 0.33333333333333331 + Red Component + 0.33333333333333331 + + Ansi 9 Color + + Blue Component + 0.33333333333333331 + Green Component + 0.33333333333333331 + Red Component + 1 + + Background Color + + Blue Component + 0.15977837145328522 + Green Component + 0.12215272337198257 + Red Component + 0.11765811592340469 + + Bold Color + + Blue Component + 0.90237069129943848 + Green Component + 0.90237069129943848 + Red Component + 0.90237069129943848 + + Cursor Color + + Blue Component + 0.73333334922790527 + Green Component + 0.73333334922790527 + Red Component + 0.73333334922790527 + + Cursor Text Color + + Blue Component + 1 + Green Component + 1 + Red Component + 1 + + Foreground Color + + Blue Component + 0.90032327175140381 + Green Component + 0.90032327175140381 + Red Component + 0.90032327175140381 + + Selected Text Color + + Blue Component + 1 + Green Component + 1 + Red Component + 1 + + Selection Color + + Blue Component + 0.35294118523597717 + Green Component + 0.27843138575553894 + Red Component + 0.26666668057441711 + + + diff --git a/Flat.terminal b/Flat.terminal deleted file mode 100644 index ba7c5a4..0000000 --- a/Flat.terminal +++ /dev/null @@ -1,295 +0,0 @@ - - - - - BackgroundColor - - YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T - Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECcwLjE2OTc2MzUw - NTUgMC4yNDI0MTMwNDQgMC4zMTQwMTcyMzYyIDFPECcwLjEyODczODMyODggMC4xODM0 - NTkzODYyIDAuMjQ2MTk5MjY1MQAQAYACgAbTFBUNFhcYVE5TSURVTlNJQ0MQB4ADgAXS - Gg0bHFdOUy5kYXRhTxEMSAAADEhMaW5vAhAAAG1udHJSR0IgWFlaIAfOAAIACQAGADEA - AGFjc3BNU0ZUAAAAAElFQyBzUkdCAAAAAAAAAAAAAAAAAAD21gABAAAAANMtSFAgIAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEWNwcnQA - AAFQAAAAM2Rlc2MAAAGEAAAAbHd0cHQAAAHwAAAAFGJrcHQAAAIEAAAAFHJYWVoAAAIY - AAAAFGdYWVoAAAIsAAAAFGJYWVoAAAJAAAAAFGRtbmQAAAJUAAAAcGRtZGQAAALEAAAA - iHZ1ZWQAAANMAAAAhnZpZXcAAAPUAAAAJGx1bWkAAAP4AAAAFG1lYXMAAAQMAAAAJHRl - Y2gAAAQwAAAADHJUUkMAAAQ8AAAIDGdUUkMAAAQ8AAAIDGJUUkMAAAQ8AAAIDHRleHQA - AAAAQ29weXJpZ2h0IChjKSAxOTk4IEhld2xldHQtUGFja2FyZCBDb21wYW55AABkZXNj - AAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAEnNSR0IgSUVDNjE5NjYt - Mi4xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AABYWVogAAAAAAAA81EAAQAAAAEWzFhZWiAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAA - AG+iAAA49QAAA5BYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAkoAAAD4QAALbP - ZGVzYwAAAAAAAAAWSUVDIGh0dHA6Ly93d3cuaWVjLmNoAAAAAAAAAAAAAAAWSUVDIGh0 - dHA6Ly93d3cuaWVjLmNoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAGRlc2MAAAAAAAAALklFQyA2MTk2Ni0yLjEgRGVmYXVsdCBSR0IgY29s - b3VyIHNwYWNlIC0gc1JHQgAAAAAAAAAAAAAALklFQyA2MTk2Ni0yLjEgRGVmYXVsdCBS - R0IgY29sb3VyIHNwYWNlIC0gc1JHQgAAAAAAAAAAAAAAAAAAAAAAAAAAAABkZXNjAAAA - AAAAACxSZWZlcmVuY2UgVmlld2luZyBDb25kaXRpb24gaW4gSUVDNjE5NjYtMi4xAAAA - AAAAAAAAAAAsUmVmZXJlbmNlIFZpZXdpbmcgQ29uZGl0aW9uIGluIElFQzYxOTY2LTIu - MQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdmlldwAAAAAAE6T+ABRfLgAQzxQAA+3M - AAQTCwADXJ4AAAABWFlaIAAAAAAATAlWAFAAAABXH+dtZWFzAAAAAAAAAAEAAAAAAAAA - AAAAAAAAAAAAAAACjwAAAAJzaWcgAAAAAENSVCBjdXJ2AAAAAAAABAAAAAAFAAoADwAU - ABkAHgAjACgALQAyADcAOwBAAEUASgBPAFQAWQBeAGMAaABtAHIAdwB8AIEAhgCLAJAA - lQCaAJ8ApACpAK4AsgC3ALwAwQDGAMsA0ADVANsA4ADlAOsA8AD2APsBAQEHAQ0BEwEZ - AR8BJQErATIBOAE+AUUBTAFSAVkBYAFnAW4BdQF8AYMBiwGSAZoBoQGpAbEBuQHBAckB - 0QHZAeEB6QHyAfoCAwIMAhQCHQImAi8COAJBAksCVAJdAmcCcQJ6AoQCjgKYAqICrAK2 - AsECywLVAuAC6wL1AwADCwMWAyEDLQM4A0MDTwNaA2YDcgN+A4oDlgOiA64DugPHA9MD - 4APsA/kEBgQTBCAELQQ7BEgEVQRjBHEEfgSMBJoEqAS2BMQE0wThBPAE/gUNBRwFKwU6 - BUkFWAVnBXcFhgWWBaYFtQXFBdUF5QX2BgYGFgYnBjcGSAZZBmoGewaMBp0GrwbABtEG - 4wb1BwcHGQcrBz0HTwdhB3QHhgeZB6wHvwfSB+UH+AgLCB8IMghGCFoIbgiCCJYIqgi+ - CNII5wj7CRAJJQk6CU8JZAl5CY8JpAm6Cc8J5Qn7ChEKJwo9ClQKagqBCpgKrgrFCtwK - 8wsLCyILOQtRC2kLgAuYC7ALyAvhC/kMEgwqDEMMXAx1DI4MpwzADNkM8w0NDSYNQA1a - DXQNjg2pDcMN3g34DhMOLg5JDmQOfw6bDrYO0g7uDwkPJQ9BD14Peg+WD7MPzw/sEAkQ - JhBDEGEQfhCbELkQ1xD1ERMRMRFPEW0RjBGqEckR6BIHEiYSRRJkEoQSoxLDEuMTAxMj - E0MTYxODE6QTxRPlFAYUJxRJFGoUixStFM4U8BUSFTQVVhV4FZsVvRXgFgMWJhZJFmwW - jxayFtYW+hcdF0EXZReJF64X0hf3GBsYQBhlGIoYrxjVGPoZIBlFGWsZkRm3Gd0aBBoq - GlEadxqeGsUa7BsUGzsbYxuKG7Ib2hwCHCocUhx7HKMczBz1HR4dRx1wHZkdwx3sHhYe - QB5qHpQevh7pHxMfPh9pH5Qfvx/qIBUgQSBsIJggxCDwIRwhSCF1IaEhziH7IiciVSKC - Iq8i3SMKIzgjZiOUI8Ij8CQfJE0kfCSrJNolCSU4JWgllyXHJfcmJyZXJocmtyboJxgn - SSd6J6sn3CgNKD8ocSiiKNQpBik4KWspnSnQKgIqNSpoKpsqzysCKzYraSudK9EsBSw5 - LG4soizXLQwtQS12Last4S4WLkwugi63Lu4vJC9aL5Evxy/+MDUwbDCkMNsxEjFKMYIx - ujHyMioyYzKbMtQzDTNGM38zuDPxNCs0ZTSeNNg1EzVNNYc1wjX9Njc2cjauNuk3JDdg - N5w31zgUOFA4jDjIOQU5Qjl/Obw5+To2OnQ6sjrvOy07azuqO+g8JzxlPKQ84z0iPWE9 - oT3gPiA+YD6gPuA/IT9hP6I/4kAjQGRApkDnQSlBakGsQe5CMEJyQrVC90M6Q31DwEQD - REdEikTORRJFVUWaRd5GIkZnRqtG8Ec1R3tHwEgFSEtIkUjXSR1JY0mpSfBKN0p9SsRL - DEtTS5pL4kwqTHJMuk0CTUpNk03cTiVObk63TwBPSU+TT91QJ1BxULtRBlFQUZtR5lIx - UnxSx1MTU19TqlP2VEJUj1TbVShVdVXCVg9WXFapVvdXRFeSV+BYL1h9WMtZGllpWbha - B1pWWqZa9VtFW5Vb5Vw1XIZc1l0nXXhdyV4aXmxevV8PX2Ffs2AFYFdgqmD8YU9homH1 - YklinGLwY0Njl2PrZEBklGTpZT1lkmXnZj1mkmboZz1nk2fpaD9olmjsaUNpmmnxakhq - n2r3a09rp2v/bFdsr20IbWBtuW4SbmtuxG8eb3hv0XArcIZw4HE6cZVx8HJLcqZzAXNd - c7h0FHRwdMx1KHWFdeF2Pnabdvh3VnezeBF4bnjMeSp5iXnnekZ6pXsEe2N7wnwhfIF8 - 4X1BfaF+AX5ifsJ/I3+Ef+WAR4CogQqBa4HNgjCCkoL0g1eDuoQdhICE44VHhauGDoZy - hteHO4efiASIaYjOiTOJmYn+imSKyoswi5aL/IxjjMqNMY2Yjf+OZo7OjzaPnpAGkG6Q - 1pE/kaiSEZJ6kuOTTZO2lCCUipT0lV+VyZY0lp+XCpd1l+CYTJi4mSSZkJn8mmia1ZtC - m6+cHJyJnPedZJ3SnkCerp8dn4uf+qBpoNihR6G2oiailqMGo3aj5qRWpMelOKWpphqm - i6b9p26n4KhSqMSpN6mpqhyqj6sCq3Wr6axcrNCtRK24ri2uoa8Wr4uwALB1sOqxYLHW - skuywrM4s660JbSctRO1irYBtnm28Ldot+C4WbjRuUq5wro7urW7LrunvCG8m70VvY++ - Cr6Evv+/er/1wHDA7MFnwePCX8Lbw1jD1MRRxM7FS8XIxkbGw8dBx7/IPci8yTrJuco4 - yrfLNsu2zDXMtc01zbXONs62zzfPuNA50LrRPNG+0j/SwdNE08bUSdTL1U7V0dZV1tjX - XNfg2GTY6Nls2fHadtr724DcBdyK3RDdlt4c3qLfKd+v4DbgveFE4cziU+Lb42Pj6+Rz - 5PzlhOYN5pbnH+ep6DLovOlG6dDqW+rl63Dr++yG7RHtnO4o7rTvQO/M8Fjw5fFy8f/y - jPMZ86f0NPTC9VD13vZt9vv3ivgZ+Kj5OPnH+lf65/t3/Af8mP0p/br+S/7c/23//4AE - 0h4fICFaJGNsYXNzbmFtZVgkY2xhc3Nlc11OU011dGFibGVEYXRhoyAiI1ZOU0RhdGFY - TlNPYmplY3TSHh8lJlxOU0NvbG9yU3BhY2WiJyNcTlNDb2xvclNwYWNl0h4fKSpXTlND - b2xvcqIpI18QD05TS2V5ZWRBcmNoaXZlctEtLlRyb290gAEACAARABoAIwAtADIANwA/ - AEUAUABdAGMAcACFAIwAtgDgAOIA5ADmAO0A8gD4APoA/AD+AQMBCw1XDVkNXg1pDXIN - gA2EDYsNlA2ZDaYNqQ22DbsNww3GDdgN2w3gAAAAAAAAAgEAAAAAAAAALwAAAAAAAAAA - AAAAAAAADeI= - - CursorBlink - - CursorColor - - YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw - LjkyMTU2ODY5MTcgMC43ODQzMTM3OTggMC4wMjc0NTA5ODI0OAAQAoAC0hAREhNaJGNs - YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp - dmVy0RcYVHJvb3SAAQgRGiMtMjc7QUhOW2KMjpCVoKmxtL3P0tcAAAAAAAABAQAAAAAA - AAAZAAAAAAAAAAAAAAAAAAAA2Q== - - CursorType - 0 - Font - - YnBsaXN0MDDUAQIDBAUGGBlYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKQHCBESVSRudWxs1AkKCwwNDg8QVk5TU2l6ZVhOU2ZGbGFnc1ZOU05hbWVWJGNs - YXNzI0AqAAAAAAAAEBCAAoADXlNGTW9uby1SZWd1bGFy0hMUFRZaJGNsYXNzbmFtZVgk - Y2xhc3Nlc1ZOU0ZvbnSiFRdYTlNPYmplY3RfEA9OU0tleWVkQXJjaGl2ZXLRGhtUcm9v - dIABCBEaIy0yNzxCS1JbYmlydHZ4h4yXoKeqs8XIzQAAAAAAAAEBAAAAAAAAABwAAAAA - AAAAAAAAAAAAAADP - - ProfileCurrentVersion - 2.0499999999999998 - SelectionColor - - YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw - LjU1Njg2Mjc3MTUgMC4yNjY2NjY2ODA2IDAuNjc4NDMxMzkxNwAQAoAC0hAREhNaJGNs - YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp - dmVy0RcYVHJvb3SAAQgRGiMtMjc7QUhOW2KMjpCVoKmxtL3P0tcAAAAAAAABAQAAAAAA - AAAZAAAAAAAAAAAAAAAAAAAA2Q== - - ShowActiveProcessArgumentsInTitle - - ShowActiveProcessInTitle - - ShowCommandKeyInTitle - - ShowDimensionsInTitle - - ShowRepresentedURLInTitle - - ShowRepresentedURLPathInTitle - - ShowShellCommandInTitle - - ShowTTYNameInTitle - - ShowWindowSettingsNameInTitle - - TextBoldColor - - YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T - Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NHMSAxIDEgMU8QGjEg - MC45OTk5NzQzNyAwLjk5OTk5MTI5NzcAEAGAAoAG0xQVDRYXGFROU0lEVU5TSUNDEAeA - A4AF0hoNGxxXTlMuZGF0YU8RDEgAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkA - BgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQ - ICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFj - cHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFla - AAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAAC - xAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAA - ACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0 - ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAA - ZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYx - OTY2LTIuMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAWFlaIAAAAAAAAPNRAAEAAAABFsxYWVogAAAAAAAAAAAAAAAAAAAAAFhZWiAA - AAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA+E - AAC2z2Rlc2MAAAAAAAAAFklFQyBodHRwOi8vd3d3LmllYy5jaAAAAAAAAAAAAAAAFklF - QyBodHRwOi8vd3d3LmllYy5jaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAABkZXNjAAAAAAAAAC5JRUMgNjE5NjYtMi4xIERlZmF1bHQgUkdC - IGNvbG91ciBzcGFjZSAtIHNSR0IAAAAAAAAAAAAAAC5JRUMgNjE5NjYtMi4xIERlZmF1 - bHQgUkdCIGNvbG91ciBzcGFjZSAtIHNSR0IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZGVz - YwAAAAAAAAAsUmVmZXJlbmNlIFZpZXdpbmcgQ29uZGl0aW9uIGluIElFQzYxOTY2LTIu - MQAAAAAAAAAAAAAALFJlZmVyZW5jZSBWaWV3aW5nIENvbmRpdGlvbiBpbiBJRUM2MTk2 - Ni0yLjEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHZpZXcAAAAAABOk/gAUXy4AEM8U - AAPtzAAEEwsAA1yeAAAAAVhZWiAAAAAAAEwJVgBQAAAAVx/nbWVhcwAAAAAAAAABAAAA - AAAAAAAAAAAAAAAAAAAAAo8AAAACc2lnIAAAAABDUlQgY3VydgAAAAAAAAQAAAAABQAK - AA8AFAAZAB4AIwAoAC0AMgA3ADsAQABFAEoATwBUAFkAXgBjAGgAbQByAHcAfACBAIYA - iwCQAJUAmgCfAKQAqQCuALIAtwC8AMEAxgDLANAA1QDbAOAA5QDrAPAA9gD7AQEBBwEN - ARMBGQEfASUBKwEyATgBPgFFAUwBUgFZAWABZwFuAXUBfAGDAYsBkgGaAaEBqQGxAbkB - wQHJAdEB2QHhAekB8gH6AgMCDAIUAh0CJgIvAjgCQQJLAlQCXQJnAnECegKEAo4CmAKi - AqwCtgLBAssC1QLgAusC9QMAAwsDFgMhAy0DOANDA08DWgNmA3IDfgOKA5YDogOuA7oD - xwPTA+AD7AP5BAYEEwQgBC0EOwRIBFUEYwRxBH4EjASaBKgEtgTEBNME4QTwBP4FDQUc - BSsFOgVJBVgFZwV3BYYFlgWmBbUFxQXVBeUF9gYGBhYGJwY3BkgGWQZqBnsGjAadBq8G - wAbRBuMG9QcHBxkHKwc9B08HYQd0B4YHmQesB78H0gflB/gICwgfCDIIRghaCG4IggiW - CKoIvgjSCOcI+wkQCSUJOglPCWQJeQmPCaQJugnPCeUJ+woRCicKPQpUCmoKgQqYCq4K - xQrcCvMLCwsiCzkLUQtpC4ALmAuwC8gL4Qv5DBIMKgxDDFwMdQyODKcMwAzZDPMNDQ0m - DUANWg10DY4NqQ3DDd4N+A4TDi4OSQ5kDn8Omw62DtIO7g8JDyUPQQ9eD3oPlg+zD88P - 7BAJECYQQxBhEH4QmxC5ENcQ9RETETERTxFtEYwRqhHJEegSBxImEkUSZBKEEqMSwxLj - EwMTIxNDE2MTgxOkE8UT5RQGFCcUSRRqFIsUrRTOFPAVEhU0FVYVeBWbFb0V4BYDFiYW - SRZsFo8WshbWFvoXHRdBF2UXiReuF9IX9xgbGEAYZRiKGK8Y1Rj6GSAZRRlrGZEZtxnd - GgQaKhpRGncanhrFGuwbFBs7G2MbihuyG9ocAhwqHFIcexyjHMwc9R0eHUcdcB2ZHcMd - 7B4WHkAeah6UHr4e6R8THz4faR+UH78f6iAVIEEgbCCYIMQg8CEcIUghdSGhIc4h+yIn - IlUigiKvIt0jCiM4I2YjlCPCI/AkHyRNJHwkqyTaJQklOCVoJZclxyX3JicmVyaHJrcm - 6CcYJ0kneierJ9woDSg/KHEooijUKQYpOClrKZ0p0CoCKjUqaCqbKs8rAis2K2krnSvR - LAUsOSxuLKIs1y0MLUEtdi2rLeEuFi5MLoIuty7uLyQvWi+RL8cv/jA1MGwwpDDbMRIx - SjGCMbox8jIqMmMymzLUMw0zRjN/M7gz8TQrNGU0njTYNRM1TTWHNcI1/TY3NnI2rjbp - NyQ3YDecN9c4FDhQOIw4yDkFOUI5fzm8Ofk6Njp0OrI67zstO2s7qjvoPCc8ZTykPOM9 - Ij1hPaE94D4gPmA+oD7gPyE/YT+iP+JAI0BkQKZA50EpQWpBrEHuQjBCckK1QvdDOkN9 - Q8BEA0RHRIpEzkUSRVVFmkXeRiJGZ0arRvBHNUd7R8BIBUhLSJFI10kdSWNJqUnwSjdK - fUrESwxLU0uaS+JMKkxyTLpNAk1KTZNN3E4lTm5Ot08AT0lPk0/dUCdQcVC7UQZRUFGb - UeZSMVJ8UsdTE1NfU6pT9lRCVI9U21UoVXVVwlYPVlxWqVb3V0RXklfgWC9YfVjLWRpZ - aVm4WgdaVlqmWvVbRVuVW+VcNVyGXNZdJ114XcleGl5sXr1fD19hX7NgBWBXYKpg/GFP - YaJh9WJJYpxi8GNDY5dj62RAZJRk6WU9ZZJl52Y9ZpJm6Gc9Z5Nn6Wg/aJZo7GlDaZpp - 8WpIap9q92tPa6dr/2xXbK9tCG1gbbluEm5rbsRvHm94b9FwK3CGcOBxOnGVcfByS3Km - cwFzXXO4dBR0cHTMdSh1hXXhdj52m3b4d1Z3s3gReG54zHkqeYl553pGeqV7BHtje8J8 - IXyBfOF9QX2hfgF+Yn7CfyN/hH/lgEeAqIEKgWuBzYIwgpKC9INXg7qEHYSAhOOFR4Wr - hg6GcobXhzuHn4gEiGmIzokziZmJ/opkisqLMIuWi/yMY4zKjTGNmI3/jmaOzo82j56Q - BpBukNaRP5GokhGSepLjk02TtpQglIqU9JVflcmWNJaflwqXdZfgmEyYuJkkmZCZ/Jpo - mtWbQpuvnByciZz3nWSd0p5Anq6fHZ+Ln/qgaaDYoUehtqImopajBqN2o+akVqTHpTil - qaYapoum/adup+CoUqjEqTepqaocqo+rAqt1q+msXKzQrUStuK4trqGvFq+LsACwdbDq - sWCx1rJLssKzOLOutCW0nLUTtYq2AbZ5tvC3aLfguFm40blKucK6O7q1uy67p7whvJu9 - Fb2Pvgq+hL7/v3q/9cBwwOzBZ8Hjwl/C28NYw9TEUcTOxUvFyMZGxsPHQce/yD3IvMk6 - ybnKOMq3yzbLtsw1zLXNNc21zjbOts83z7jQOdC60TzRvtI/0sHTRNPG1EnUy9VO1dHW - VdbY11zX4Nhk2OjZbNnx2nba+9uA3AXcit0Q3ZbeHN6i3ynfr+A24L3hROHM4lPi2+Nj - 4+vkc+T85YTmDeaW5x/nqegy6LzpRunQ6lvq5etw6/vshu0R7ZzuKO6070DvzPBY8OXx - cvH/8ozzGfOn9DT0wvVQ9d72bfb794r4Gfio+Tj5x/pX+uf7d/wH/Jj9Kf26/kv+3P9t - //+ABNIeHyAhWiRjbGFzc25hbWVYJGNsYXNzZXNdTlNNdXRhYmxlRGF0YaMgIiNWTlNE - YXRhWE5TT2JqZWN00h4fJSZcTlNDb2xvclNwYWNloicjXE5TQ29sb3JTcGFjZdIeHykq - V05TQ29sb3KiKSNfEA9OU0tleWVkQXJjaGl2ZXLRLS5Ucm9vdIABAAgAEQAaACMALQAy - ADcAPwBFAFAAXQBjAHAAhQCMAJQAsQCzALUAtwC+AMMAyQDLAM0AzwDUANwNKA0qDS8N - Og1DDVENVQ1cDWUNag13DXoNhw2MDZQNlw2pDawNsQAAAAAAAAIBAAAAAAAAAC8AAAAA - AAAAAAAAAAAAAA2z - - TextColor - - YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T - Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NHMSAxIDEgMU8QGjEg - MC45OTk5NzQzNyAwLjk5OTk5MTI5NzcAEAGAAoAG0xQVDRYXGFROU0lEVU5TSUNDEAeA - A4AF0hoNGxxXTlMuZGF0YU8RDEgAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkA - BgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQ - ICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFj - cHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFla - AAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAAC - xAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAA - ACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0 - ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAA - ZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYx - OTY2LTIuMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAWFlaIAAAAAAAAPNRAAEAAAABFsxYWVogAAAAAAAAAAAAAAAAAAAAAFhZWiAA - AAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA+E - AAC2z2Rlc2MAAAAAAAAAFklFQyBodHRwOi8vd3d3LmllYy5jaAAAAAAAAAAAAAAAFklF - QyBodHRwOi8vd3d3LmllYy5jaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAABkZXNjAAAAAAAAAC5JRUMgNjE5NjYtMi4xIERlZmF1bHQgUkdC - IGNvbG91ciBzcGFjZSAtIHNSR0IAAAAAAAAAAAAAAC5JRUMgNjE5NjYtMi4xIERlZmF1 - bHQgUkdCIGNvbG91ciBzcGFjZSAtIHNSR0IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZGVz - YwAAAAAAAAAsUmVmZXJlbmNlIFZpZXdpbmcgQ29uZGl0aW9uIGluIElFQzYxOTY2LTIu - MQAAAAAAAAAAAAAALFJlZmVyZW5jZSBWaWV3aW5nIENvbmRpdGlvbiBpbiBJRUM2MTk2 - Ni0yLjEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHZpZXcAAAAAABOk/gAUXy4AEM8U - AAPtzAAEEwsAA1yeAAAAAVhZWiAAAAAAAEwJVgBQAAAAVx/nbWVhcwAAAAAAAAABAAAA - AAAAAAAAAAAAAAAAAAAAAo8AAAACc2lnIAAAAABDUlQgY3VydgAAAAAAAAQAAAAABQAK - AA8AFAAZAB4AIwAoAC0AMgA3ADsAQABFAEoATwBUAFkAXgBjAGgAbQByAHcAfACBAIYA - iwCQAJUAmgCfAKQAqQCuALIAtwC8AMEAxgDLANAA1QDbAOAA5QDrAPAA9gD7AQEBBwEN - ARMBGQEfASUBKwEyATgBPgFFAUwBUgFZAWABZwFuAXUBfAGDAYsBkgGaAaEBqQGxAbkB - wQHJAdEB2QHhAekB8gH6AgMCDAIUAh0CJgIvAjgCQQJLAlQCXQJnAnECegKEAo4CmAKi - AqwCtgLBAssC1QLgAusC9QMAAwsDFgMhAy0DOANDA08DWgNmA3IDfgOKA5YDogOuA7oD - xwPTA+AD7AP5BAYEEwQgBC0EOwRIBFUEYwRxBH4EjASaBKgEtgTEBNME4QTwBP4FDQUc - BSsFOgVJBVgFZwV3BYYFlgWmBbUFxQXVBeUF9gYGBhYGJwY3BkgGWQZqBnsGjAadBq8G - wAbRBuMG9QcHBxkHKwc9B08HYQd0B4YHmQesB78H0gflB/gICwgfCDIIRghaCG4IggiW - CKoIvgjSCOcI+wkQCSUJOglPCWQJeQmPCaQJugnPCeUJ+woRCicKPQpUCmoKgQqYCq4K - xQrcCvMLCwsiCzkLUQtpC4ALmAuwC8gL4Qv5DBIMKgxDDFwMdQyODKcMwAzZDPMNDQ0m - DUANWg10DY4NqQ3DDd4N+A4TDi4OSQ5kDn8Omw62DtIO7g8JDyUPQQ9eD3oPlg+zD88P - 7BAJECYQQxBhEH4QmxC5ENcQ9RETETERTxFtEYwRqhHJEegSBxImEkUSZBKEEqMSwxLj - EwMTIxNDE2MTgxOkE8UT5RQGFCcUSRRqFIsUrRTOFPAVEhU0FVYVeBWbFb0V4BYDFiYW - SRZsFo8WshbWFvoXHRdBF2UXiReuF9IX9xgbGEAYZRiKGK8Y1Rj6GSAZRRlrGZEZtxnd - GgQaKhpRGncanhrFGuwbFBs7G2MbihuyG9ocAhwqHFIcexyjHMwc9R0eHUcdcB2ZHcMd - 7B4WHkAeah6UHr4e6R8THz4faR+UH78f6iAVIEEgbCCYIMQg8CEcIUghdSGhIc4h+yIn - IlUigiKvIt0jCiM4I2YjlCPCI/AkHyRNJHwkqyTaJQklOCVoJZclxyX3JicmVyaHJrcm - 6CcYJ0kneierJ9woDSg/KHEooijUKQYpOClrKZ0p0CoCKjUqaCqbKs8rAis2K2krnSvR - LAUsOSxuLKIs1y0MLUEtdi2rLeEuFi5MLoIuty7uLyQvWi+RL8cv/jA1MGwwpDDbMRIx - SjGCMbox8jIqMmMymzLUMw0zRjN/M7gz8TQrNGU0njTYNRM1TTWHNcI1/TY3NnI2rjbp - NyQ3YDecN9c4FDhQOIw4yDkFOUI5fzm8Ofk6Njp0OrI67zstO2s7qjvoPCc8ZTykPOM9 - Ij1hPaE94D4gPmA+oD7gPyE/YT+iP+JAI0BkQKZA50EpQWpBrEHuQjBCckK1QvdDOkN9 - Q8BEA0RHRIpEzkUSRVVFmkXeRiJGZ0arRvBHNUd7R8BIBUhLSJFI10kdSWNJqUnwSjdK - fUrESwxLU0uaS+JMKkxyTLpNAk1KTZNN3E4lTm5Ot08AT0lPk0/dUCdQcVC7UQZRUFGb - UeZSMVJ8UsdTE1NfU6pT9lRCVI9U21UoVXVVwlYPVlxWqVb3V0RXklfgWC9YfVjLWRpZ - aVm4WgdaVlqmWvVbRVuVW+VcNVyGXNZdJ114XcleGl5sXr1fD19hX7NgBWBXYKpg/GFP - YaJh9WJJYpxi8GNDY5dj62RAZJRk6WU9ZZJl52Y9ZpJm6Gc9Z5Nn6Wg/aJZo7GlDaZpp - 8WpIap9q92tPa6dr/2xXbK9tCG1gbbluEm5rbsRvHm94b9FwK3CGcOBxOnGVcfByS3Km - cwFzXXO4dBR0cHTMdSh1hXXhdj52m3b4d1Z3s3gReG54zHkqeYl553pGeqV7BHtje8J8 - IXyBfOF9QX2hfgF+Yn7CfyN/hH/lgEeAqIEKgWuBzYIwgpKC9INXg7qEHYSAhOOFR4Wr - hg6GcobXhzuHn4gEiGmIzokziZmJ/opkisqLMIuWi/yMY4zKjTGNmI3/jmaOzo82j56Q - BpBukNaRP5GokhGSepLjk02TtpQglIqU9JVflcmWNJaflwqXdZfgmEyYuJkkmZCZ/Jpo - mtWbQpuvnByciZz3nWSd0p5Anq6fHZ+Ln/qgaaDYoUehtqImopajBqN2o+akVqTHpTil - qaYapoum/adup+CoUqjEqTepqaocqo+rAqt1q+msXKzQrUStuK4trqGvFq+LsACwdbDq - sWCx1rJLssKzOLOutCW0nLUTtYq2AbZ5tvC3aLfguFm40blKucK6O7q1uy67p7whvJu9 - Fb2Pvgq+hL7/v3q/9cBwwOzBZ8Hjwl/C28NYw9TEUcTOxUvFyMZGxsPHQce/yD3IvMk6 - ybnKOMq3yzbLtsw1zLXNNc21zjbOts83z7jQOdC60TzRvtI/0sHTRNPG1EnUy9VO1dHW - VdbY11zX4Nhk2OjZbNnx2nba+9uA3AXcit0Q3ZbeHN6i3ynfr+A24L3hROHM4lPi2+Nj - 4+vkc+T85YTmDeaW5x/nqegy6LzpRunQ6lvq5etw6/vshu0R7ZzuKO6070DvzPBY8OXx - cvH/8ozzGfOn9DT0wvVQ9d72bfb794r4Gfio+Tj5x/pX+uf7d/wH/Jj9Kf26/kv+3P9t - //+ABNIeHyAhWiRjbGFzc25hbWVYJGNsYXNzZXNdTlNNdXRhYmxlRGF0YaMgIiNWTlNE - YXRhWE5TT2JqZWN00h4fJSZcTlNDb2xvclNwYWNloicjXE5TQ29sb3JTcGFjZdIeHykq - V05TQ29sb3KiKSNfEA9OU0tleWVkQXJjaGl2ZXLRLS5Ucm9vdIABAAgAEQAaACMALQAy - ADcAPwBFAFAAXQBjAHAAhQCMAJQAsQCzALUAtwC+AMMAyQDLAM0AzwDUANwNKA0qDS8N - Og1DDVENVQ1cDWUNag13DXoNhw2MDZQNlw2pDawNsQAAAAAAAAIBAAAAAAAAAC8AAAAA - AAAAAAAAAAAAAA2z - - UseBrightBold - - WindowTitle - Terminal - columnCount - 80 - name - Black - rowCount - 24 - type - Window Settings - - diff --git a/oh-my-zsh/aliases.zsh b/oh-my-zsh/aliases.zsh new file mode 100644 index 0000000..7e39e5f --- /dev/null +++ b/oh-my-zsh/aliases.zsh @@ -0,0 +1,10 @@ +# zsh / oh-my-zsh +alias zshconfig="subl ~/.zshrc" +alias ohmyzsh="subl ~/.oh-my-zsh" +alias reload!="source ~/.zshrc" + +alias gamd="git commit -a --amend --reuse-message=HEAD" +alias gwip="git add -u && git commit -m 'WIP'" +alias gundo="reset HEAD~1 --mixed" +alias greb="git fetch && git rebase -i origin/master" + diff --git a/oh-my-zsh/plugins/zsh-autosuggestions b/oh-my-zsh/plugins/zsh-autosuggestions new file mode 160000 index 0000000..ebaf409 --- /dev/null +++ b/oh-my-zsh/plugins/zsh-autosuggestions @@ -0,0 +1 @@ +Subproject commit ebaf409002be498a681267a75f5efcaf45cd0ccc diff --git a/oh-my-zsh/plugins/zsh-syntax-highlighting b/oh-my-zsh/plugins/zsh-syntax-highlighting new file mode 160000 index 0000000..4ce56a8 --- /dev/null +++ b/oh-my-zsh/plugins/zsh-syntax-highlighting @@ -0,0 +1 @@ +Subproject commit 4ce56a821e9988c1a24fa1b1d62ed57f72893217 diff --git a/oh-my-zsh/themes/tranquility.zsh-theme b/oh-my-zsh/themes/tranquility.zsh-theme new file mode 100644 index 0000000..f0943b9 --- /dev/null +++ b/oh-my-zsh/themes/tranquility.zsh-theme @@ -0,0 +1,100 @@ +# Tranquility ZSH Theme based on AVIT + +PROMPT=' +$(_user_host)${_current_dir} $(git_prompt_info) +%{$fg[$CARETCOLOR]%}➜%{$resetcolor%} ' + +PROMPT2='%{$fg[$CARETCOLOR]%}◀%{$reset_color%} ' + +RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}' + +local _current_dir="%{$fg_bold[blue]%}%3~%{$reset_color%} " +local _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}" +local _hist_no="%{$fg[grey]%}%h%{$reset_color%}" + +function _current_dir() { + local _max_pwd_length="65" + if [[ $(echo -n $PWD | wc -c) -gt ${_max_pwd_length} ]]; then + echo "%{$fg_bold[blue]%}%-2~ ... %3~%{$reset_color%} " + else + echo "%{$fg_bold[blue]%}%~%{$reset_color%} " + fi +} + +function _user_host() { + if [[ -n $SSH_CONNECTION ]]; then + me="%n@%m" + elif [[ $LOGNAME != $USER ]]; then + me="%n" + fi + if [[ -n $me ]]; then + echo "%{$fg[cyan]%}$me%{$reset_color%}:" + fi +} + +function _vi_status() { + if {echo $fpath | grep -q "plugins/vi-mode"}; then + echo "$(vi_mode_prompt_info)" + fi +} + +# Determine the time since last commit. If branch is clean, +# use a neutral color, otherwise colors will vary according to time. +function _git_time_since_commit() { +# Only proceed if there is actually a commit. + if last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null); then + now=$(date +%s) + seconds_since_last_commit=$((now-last_commit)) + + # Totals + minutes=$((seconds_since_last_commit / 60)) + hours=$((seconds_since_last_commit/3600)) + + # Sub-hours and sub-minutes + days=$((seconds_since_last_commit / 86400)) + sub_hours=$((hours % 24)) + sub_minutes=$((minutes % 60)) + + if [ $hours -gt 24 ]; then + commit_age="${days}d" + elif [ $minutes -gt 60 ]; then + commit_age="${sub_hours}h${sub_minutes}m" + else + commit_age="${minutes}m" + fi + + color=$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL + echo "$color$commit_age%{$reset_color%}" + fi +} + +if [[ $USER == "root" ]]; then + CARETCOLOR="red" +else + CARETCOLOR="white" +fi + +MODE_INDICATOR="%{$fg_bold[yellow]%}❮%{$reset_color%}%{$fg[yellow]%}❮❮%{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}✚ " +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}⚑ " +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✖ " +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}▴ " +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}§ " +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[white]%}◒ " + +# Colors vary depending on time lapsed. +ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" +ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" +ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" +ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[white]%}" + +# LS colors, made with https://geoff.greer.fm/lscolors/ +export LSCOLORS="exfxcxdxbxegedabagacad" +export LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:' +export GREP_COLOR='1;33' diff --git a/script/defaults.sh b/script/defaults.sh index 1219e80..6fc90fd 100755 --- a/script/defaults.sh +++ b/script/defaults.sh @@ -1,6 +1,15 @@ -################################# -#### FINDER -################################# +# Sets reasonable OS X defaults. +# +# Or, in other words, set shit how I like in OS X. +# +# The original idea (and a couple settings) were grabbed from: +# https://github.com/mathiasbynens/dotfiles/blob/master/.osx +# +# Run ./defaults.sh and you'll be good to go. + +############################################################################### +# Finder # +############################################################################### # Show status bar defaults write com.apple.finder ShowStatusBar -bool true @@ -20,9 +29,68 @@ defaults write com.apple.finder NewWindowTarget -string "PfHm" # Disable showing tags defaults write com.apple.finder ShowRecentTags -int 0 -######################################## -#### DOCK -######################################## +# Use AirDrop over every interface. srsly this should be a default. +defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1 + +# Always open everything in Finder's list view. This is important. +defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" + +# Show the ~/Library folder. +chflags nohidden ~/Library + +# Set the Finder prefs for showing a few different volumes on the Desktop. +defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true +defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true +defaults write com.apple.finder ShowMountedServersOnDesktop -bool true +defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true + +# Finder: disable window animations and Get Info animations +defaults write com.apple.finder DisableAllAnimations -bool true + +# Allow text selection in Quick Look +defaults write com.apple.finder QLEnableTextSelection -bool true + +# Enable spring loading for directories +defaults write NSGlobalDomain com.apple.springing.enabled -bool true + +# Remove the spring loading delay for directories +defaults write NSGlobalDomain com.apple.springing.delay -float 0 + +############################################################################### +# Safari & WebKit # +############################################################################### + + +# Show the full URL in the address bar (note: this still hides the scheme) +defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari ShowFullURLInSmartSearchField -bool true + +# Show website icons in tabs +defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari ShowIconsInTabs -bool true + +# Hide Safari’s sidebar in Top Sites +defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari ShowSidebarInTopSites -bool false + +# Enable Safari’s debug menu +defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari IncludeInternalDebugMenu -bool true + +# Shoe Safari’s status bar +defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari ShowOverlayStatusBar -bool true + +# Enable the Develop menu and the Web Inspector in Safari +defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari IncludeDevelopMenu -bool true +defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true +defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true + +# Ask websites not to track +defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari SendDoNotTrackHTTPHeader -bool true + +# Set Safari’s home page to `about:blank` for faster loading +# defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari HomePage -string "about:blank" + + +############################################################################### +# Dock, Dashboard # +############################################################################### # Set Dock size defaults write com.apple.dock tilesize -int 35 @@ -33,8 +101,8 @@ defaults write com.apple.dock autohide -int 1 # Disable animations defaults write com.apple.dock launchanim -int 0 -# Disable minimizing windows into their application’s icon -defaults write com.apple.dock minimize-to-application -int 0 +# Minimize windows into their application’s icon +defaults write com.apple.dock minimize-to-application -bool true # Show indicator lights for open applications in the Dock defaults write com.apple.dock show-process-indicators -int 1 @@ -45,9 +113,18 @@ defaults write com.apple.dock mineffect -string "scale" # Disable double-click on window's title bar to minimize it defaults write NSGlobalDomain AppleActionOnDoubleClick None -################################# -#### TRACKPAD -################################# +# Make Dock icons of hidden applications translucent +defaults write com.apple.dock showhidden -bool true + +# Don’t show recent applications in Dock +defaults write com.apple.dock show-recents -bool false + +# Speed up Mission Control animations +defaults write com.apple.dock expose-animation-duration -float 0.1 + +############################################################################### +# Trackpad. # +############################################################################### # Enable tap to click defaults write com.apple.AppleMultitouchTrackpad Clicking -int 1 @@ -67,9 +144,9 @@ defaults write com.apple.dock showLaunchpadGestureEnabled -int 1 # Enable Expose gesture (slide down with three fingers) defaults write com.apple.dock showAppExposeGestureEnabled -int 1 -################################# -#### KEYBOARD -################################# +############################################################################### +# Keyboard # +############################################################################### # Disable press-and-hold for keys in favor of key repeat defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false @@ -84,39 +161,64 @@ defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false # Disable auto-correct -defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false -defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -int 0 +# defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false +# defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -int 0 # Disable automatic capitalization -defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false +# defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false -# Set keyboard repeat rate -defaults write NSGlobalDomain KeyRepeat -int 2 +# Set a really fast key repeat +defaults write NSGlobalDomain KeyRepeat -int 1 defaults write NSGlobalDomain InitialKeyRepeat -int 15 # Enable full keyboard access for all controls # (e.g. enable Tab in modal dialogs) defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 -################################# -#### OTHER -################################# +############################################################################### +# Appearance # +############################################################################### -# Disable transparency -defaults read com.apple.universalaccess reduceTransparency -bool true +# Enable Dark Mode +defaults write NSGlobalDomain AppleInterfaceStyle Dark -# Use plain text mode for new TextEdit documents -defaults read com.apple.TextEdit RichText -int 0 +# Set appearance color to graphite +defaults write NSGlobalDomain AppleAquaColorVariant -int 6 + +# Set highlight color to graphite +defaults write NSGlobalDomain AppleHighlightColor -string "0.847059 0.847059 0.862745" + +# Only show scrollbars when scrolling +# Possible values: `WhenScrolling`, `Automatic` and `Always` +defaults write NSGlobalDomain AppleShowScrollBars -string "WhenScrolling" -# Disable spelling check in TextEdit documents -defaults read com.apple.TextEdit CheckSpellingWhileTyping -int 0 + +############################################################################### +# Other stuff # +############################################################################### + +# Automatically quit printer app once the print jobs complete +defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true + +# Expand print panel by default +defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true +defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true # Expand save panel by default defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true -# Enable Dark Mode -defaults write NSGlobalDomain AppleInterfaceStyle Dark +# File save, save to disk by default rather than to iCloud +defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false + +# Disable opening and closing window animation +defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false + +# Text, spell checker automatically identifies languages +defaults write NSGlobalDomain NSSpellCheckerAutomaticallyIdentifiesLanguages -bool true + +# Use plain text mode for new TextEdit documents +defaults write com.apple.TextEdit RichText -int 0 # Reset icons order in Dashboard defaults write com.apple.dock ResetLaunchPad -bool true @@ -125,16 +227,16 @@ defaults write com.apple.dock ResetLaunchPad -bool true defaults write com.apple.menuextra.battery ShowPercent YES # Close windows then quitting an app -defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -int 0 +defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool true # Ask to kepp change when closing documents -defaults write NSGlobalDomain NSCloseAlwaysConfirmsChanges -int 1 +defaults write NSGlobalDomain NSCloseAlwaysConfirmsChanges -bool true # Set alert sound defaults write NSGlobalDomain com.apple.sound.beep.sound -string "/System/Library/Sounds/Funk.aiff" # Set date format in menubar -defaults write "com.apple.menuextra.clock" DateFormat -string "EEE d.MM HH:mm" +defaults write "com.apple.menuextra.clock" DateFormat -string "EEE MMM d h:mm a" applications_to_kill=( "Activity Monitor" diff --git a/script/install.sh b/script/install.sh index 0b19413..e5da350 100644 --- a/script/install.sh +++ b/script/install.sh @@ -9,6 +9,7 @@ LOGO=" __ __ _____ _ |_| |_|\__,_|\___| |_____/ \___|\__|\__,_| .__/ | | |_|" + # Colors BOLD=$(tput bold) CYAN=$(tput setaf 6) @@ -16,43 +17,54 @@ RED=$(tput setaf 1) GREEN=$(tput setaf 2) YELLOW=$(tput setaf 3) DEFAULT=$(tput sgr0) + # New line character NEW_LINE="\n" # Horizonal line in cyan color DIVIDER="${CYAN}${BOLD}------------------------------------------------$DEFAULT" +# Horizonal line in red color +RED_DIVIDER="${RED}${BOLD}------------------------------------------------$DEFAULT" + # Arrows ARROW="$CYAN$BOLD==>$DEFAULT" ARROW_GREEN="$GREEN$BOLD==>$DEFAULT" ARROW_YELLOW="$YELLOW$BOLD==>$DEFAULT" + # Array of available applications that can be installed via Homebrew Cask -AVAILABLE_CASK_APPLICATIONS=(appcleaner background-music cyberduck drawio firefox flux fork google-chrome gpg-suite keepingyouawake keka mamp opera postman sequel-pro skype slack spectacle transmission tunnelblick visual-studio-code vlc) +AVAILABLE_CASK_APPLICATIONS=(alfred amazon-music appcleaner bitbar dropbox firefox github google-chrome postman postico sequel-pro slack spectacle transmission iterm2 imageoptim 1password sublime-text visual-studio-code vlc spotify) + # Array of available npm packages AVAILABLE_NPM_PACKAGES=(gulp-cli jest live-server create-react-app) + # Array of available VS Code extensions AVAILABLE_VSCODE_EXTENSIONS=(CoenraadS.bracket-pair-colorizer PKief.material-icon-theme alefragnani.project-manager christian-kohler.path-intellisense dbaeumer.vscode-eslint formulahendry.auto-rename-tag mrmlnc.vscode-scss msjsdiag.debugger-for-chrome techer.open-in-browser aaron-bond.better-comments kamikillerto.vscode-colorize christian-kohler.npm-intellisense) + # Arrays of applications/packages/extensions selected by user (empty by default) SELECTED_CASK_APPLICATIONS=() SELECTED_NPM_PACKAGES=() SELECTED_VSCODE_EXTENTIONS=() + # Booleans to track if specific programs are already installed IS_HOMEBREW_INSTALLED=false IS_MAS_INSTALLED=false IS_NVM_INSTALLED=false +IS_OH_MY_ZSH_INSTALLED=false IS_NODE_INSTALLED=false IS_VSCODE_INSTALLED=false +IS_ITERM_INSTALLED=false clear # Print logo and description echo -e "${CYAN}${BOLD}${LOGO}${DEFAULT}${NEW_LINE}" -echo -e "${CYAN}${BOLD} Front End Web Development Setup for macOS$NEW_LINE" +echo -e "${CYAN}${BOLD} Full Stack Development Setup for macOS$NEW_LINE" echo -e "$DIVIDER" -echo " " -echo " " +echo " " +echo " " echo -e "${DIVIDER}${NEW_LINE}" echo "Welcome to the installer!" -echo -e "First, introduce your password to execute all the commands as super user.$NEW_LINE" +echo -e "First, enter your password to execute all the commands as super user.$NEW_LINE" echo -e "${RED}${BOLD}Important:$DEFAULT You can be asked more times for password during the process." echo -e "Also, make sure that You are logged in to the Mac App Store.$NEW_LINE" @@ -107,11 +119,12 @@ fi read -p "${ARROW_YELLOW} Configure Git by creating ~/.gitconfig file? [y/n]: " if [ "$REPLY" == "y" ]; then - read -p "${ARROW_YELLOW} Please enter Git username: " username + read -p "${ARROW_YELLOW} Please enter full name: " username read -p "${ARROW_YELLOW} Please enter Git e-mail: " email read -p "${ARROW_YELLOW} Please enter Git editor: " editor echo "${ARROW} Creating ~/.gitconfig file..." + cp ~/.gitconfig ~/.gitconfig.mac_setup_backup 2> /dev/null cp .gitconfig ~ sed -i -e "s/First Last/$username/g" ~/.gitconfig sed -i -e "s/email@email.com/$email/g" ~/.gitconfig @@ -119,14 +132,29 @@ if [ "$REPLY" == "y" ]; then fi #---------------------------- -# .bash_profile +# Tig #---------------------------- -read -p "${ARROW_YELLOW} Configure bash by creating ~/.bash_profile file? [y/n]: " +if $IS_HOMEBREW_INSTALLED; then + read -p "${ARROW_YELLOW} Install Tig: text-mode interface for Git via Homebrew? [y/n]: " -if [ "$REPLY" == "y" ]; then - echo "${ARROW} Creating ~/.bash_profile file..." - cp .bash_profile ~ + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing Tig..." + brew install tig + fi +fi + +#---------------------------- +# rbenv & ruby-build +#---------------------------- + +if $IS_HOMEBREW_INSTALLED; then + read -p "${ARROW_YELLOW} Install rbenv & ruby-build via Homebrew? [y/n]: " + + if [ "$REPLY" == "y" ]; then + echo "${ARROW} Installing rbenv & ruby-build..." + brew install rbenv ruby-build + fi fi #---------------------------- @@ -150,149 +178,138 @@ if $IS_HOMEBREW_INSTALLED; then brew cask install ${application} done fi - fi - fi #---------------------------- -# Terminal profile +# oh-my-zsh #---------------------------- -read -p "${ARROW_YELLOW} Download Flat Terminal profile? [y/n]: " +read -p "${ARROW_YELLOW} Install Oh My Zsh? [y/n]: " if [ "$REPLY" == "y" ]; then - echo "${ARROW_YELLOW} New Terminal window opened. Click 'Shell' > 'Use settings as default' to use it as default profile." - open ./Flat.terminal + echo -e "${NEW_LINE}${RED_DIVIDER}" + echo -e "${RED}${BOLD}Important: After the Oh My Zs installation is done, you will have to 'exit' the new shell to continue this script." + echo -e "${RED_DIVIDER}${NEW_LINE}" + + echo "${ARROW} Installing Oh My Zsh..." + sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" + + IS_OH_MY_ZSH_INSTALLED=true fi #---------------------------- -# Node Version Manager +# .zshrc #---------------------------- -if ! [ -x "$(command -v nvm)" ]; then - IS_NVM_INSTALLED=true -fi - -if $IS_NVM_INSTALLED; then - echo "${ARROW_GREEN} Node Version Manager already installed!" -else - read -p "${ARROW_YELLOW} Install nvm (Node Version Manager)? [y/n]: " +if $IS_OH_MY_ZSH_INSTALLED; then + read -p "${ARROW_YELLOW} Configure Oh My Zsh by creating ~/.zshrc file? [y/n]: " if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Node Version Manager..." - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash - source ~/.bash_profile - - IS_NVM_INSTALLED=true + echo "${ARROW} Creating ~/.zshrc file..." + cp ~/.zshrc ~/.zshrc.mac_setup_backup 2> /dev/null + cp .zshrc ~ + sed -i -e "s+custom_path+$PWD/oh-my-zsh+g" ~/.zshrc fi fi #---------------------------- -# Node.js +# iTerm2 profile #---------------------------- -if hash node 2>/dev/null; then - IS_NODE_INSTALLED=true +if [ -d /Applications/iTerm.app/ ]; then + IS_ITERM_INSTALLED=true fi -if $IS_NODE_INSTALLED; then - echo "${ARROW_GREEN} Node.js already installed!" -else - if [ $IS_NVM_INSTALLED == true ]; then - read -p "${ARROW_YELLOW} Install latest LTS version of Node.js? [y/n]: " - - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Installing Node.js..." - nvm install --lts +if $IS_ITERM_INSTALLED; then + read -p "${ARROW_YELLOW} Install Dracula iTerm2 profile? [y/n]: " - IS_NODE_INSTALLED=true - fi + if [ "$REPLY" == "y" ]; then + echo "${ARROW_YELLOW} New iTerm2 window opened. Go to 'Preferences' > 'Profiles' > 'Colors' and choose 'Dracula' from the 'Color Presets' menu." + open ./Dracula.itermcolors fi fi +# TEMPORARILY DISABLED #---------------------------- -# npm packages +# Node Version Manager #---------------------------- -if $IS_NODE_INSTALLED; then - read -p "${ARROW_YELLOW} Install global npm packages? [y/n]: " - - if [ "$REPLY" == "y" ]; then - - for item in "${AVAILABLE_NPM_PACKAGES[@]}"; do - read -ep "${ARROW_YELLOW} Install \"$item\"? [y/n]: " - if [ "$REPLY" == "y" ]; then - SELECTED_NPM_PACKAGES+=("$item") - fi - done +# if ! [ -x "$(command -v nvm)" ]; then +# IS_NVM_INSTALLED=true +# fi - if [ ${#SELECTED_NPM_PACKAGES[@]} -gt 0 ]; then - echo "${ARROW} Installing global npm packages.." - for application in "${SELECTED_NPM_PACKAGES[@]}"; do - npm install -g ${application} - done - fi +# if $IS_NVM_INSTALLED; then +# echo "${ARROW_GREEN} Node Version Manager already installed!" +# else +# read -p "${ARROW_YELLOW} Install nvm (Node Version Manager)? [y/n]: " - fi +# if [ "$REPLY" == "y" ]; then +# echo "${ARROW} Installing Node Version Manager..." +# curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash +# source ~/.bash_profile -fi +# IS_NVM_INSTALLED=true +# fi +# fi +# TEMPORARILY DISABLED #---------------------------- # VS Code extensions #---------------------------- -if hash code 2>/dev/null; then - IS_VSCODE_INSTALLED=true -fi +# if hash code 2>/dev/null; then +# IS_VSCODE_INSTALLED=true +# fi -if $IS_VSCODE_INSTALLED; then - read -p "${ARROW_YELLOW} Install Visual Studio Code extensions? [y/n]: " +# if $IS_VSCODE_INSTALLED; then +# read -p "${ARROW_YELLOW} Install Visual Studio Code extensions? [y/n]: " - if [ "$REPLY" == "y" ]; then - for item in "${AVAILABLE_VSCODE_EXTENSIONS[@]}"; do - read -ep "${ARROW_YELLOW} Install \"$item\"? [y/n]: " - if [ "$REPLY" == "y" ]; then - SELECTED_VSCODE_EXTENSIONS+=("$item") - fi - done +# if [ "$REPLY" == "y" ]; then +# for item in "${AVAILABLE_VSCODE_EXTENSIONS[@]}"; do +# read -ep "${ARROW_YELLOW} Install \"$item\"? [y/n]: " +# if [ "$REPLY" == "y" ]; then +# SELECTED_VSCODE_EXTENSIONS+=("$item") +# fi +# done - if [ ${#SELECTED_VSCODE_EXTENSIONS[@]} -gt 0 ]; then - echo "${ARROW} Installing Visual Studio Code extensions..." - for application in "${SELECTED_NPM_PACKAGES[@]}"; do - code --install-extension ${application} - done - fi +# if [ ${#SELECTED_VSCODE_EXTENSIONS[@]} -gt 0 ]; then +# echo "${ARROW} Installing Visual Studio Code extensions..." +# for application in "${SELECTED_NPM_PACKAGES[@]}"; do +# code --install-extension ${application} +# done +# fi - fi - -fi +# fi +# fi +# TEMPORARILY DISABLED #---------------------------- # VS Code settings #---------------------------- -if $IS_VSCODE_INSTALLED; then - read -p "${ARROW_YELLOW} Configure Visual Studio Code settings? [y/n]: " +# if $IS_VSCODE_INSTALLED; then +# read -p "${ARROW_YELLOW} Configure Visual Studio Code settings? [y/n]: " - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring Visual Studio Code settings..." - cp settings.json /Users/${USER}/Library/Application\ Support/Code/User - fi -fi +# if [ "$REPLY" == "y" ]; then +# echo "${ARROW} Configuring Visual Studio Code settings..." +# cp settings.json /Users/${USER}/Library/Application\ Support/Code/User +# fi +# fi +# TEMPORARILY DISABLED #---------------------------- # VS Code snippets #---------------------------- -if $IS_VSCODE_INSTALLED; then - read -p "${ARROW_YELLOW} Configure Visual Studio Code snippets? [y/n]: " +# if $IS_VSCODE_INSTALLED; then +# read -p "${ARROW_YELLOW} Configure Visual Studio Code snippets? [y/n]: " - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring Visual Studio Code snippets..." - cp snippets.code-snippets /Users/${USER}/Library/Application\ Support/Code/User/snippets - fi -fi +# if [ "$REPLY" == "y" ]; then +# echo "${ARROW} Configuring Visual Studio Code snippets..." +# cp snippets.code-snippets /Users/${USER}/Library/Application\ Support/Code/User/snippets +# fi +# fi #---------------------------- # Spectacle shortcuts @@ -303,7 +320,7 @@ if [ -d /Applications/Spectacle.app/ ]; then fi if $IS_SPECTACLE_INSTALLED; then - read -p "${ARROW_YELLOW} Configure Spectacle shotrcuts? [y/n]: " + read -p "${ARROW_YELLOW} Configure Spectacle shortcuts? [y/n]: " if [ "$REPLY" == "y" ]; then echo "${ARROW} Configuring Spectacle shotrcuts..." @@ -347,7 +364,11 @@ read -p "${ARROW_YELLOW} Configure macOS Defaults? [y/n]: " if [ "$REPLY" == "y" ]; then echo "${ARROW} Configuring macOS Defaults..." - . ./api/defaults.sh + echo -e "${NEW_LINE}${DIVIDER}" + echo -e "${YELLOW}${BOLD}Note:$DEFAULT If you see errors like 'Could not write domain', temporarily give Full Disk Access (System Preferences > Security & Privacy)" + echo -e "to the Terminal/iTerm app and re-apply macOS Defaults manually: ${CYAN}${BOLD}./script/defaults.sh" + echo -e "${DIVIDER}" + . ./script/defaults.sh fi echo -e "${NEW_LINE}${YELLOW}${BOLD}Note:$DEFAULT Some changes may need system restart to be applied!" diff --git a/spectacle.json b/spectacle.json index be0b744..0f9a24d 100644 --- a/spectacle.json +++ b/spectacle.json @@ -1,74 +1,74 @@ [ { - "shortcut_key_binding": null, - "shortcut_name": "RedoLastMove" + "shortcut_key_binding" : "ctrl+alt+left", + "shortcut_name" : "MoveToPreviousThird" }, { - "shortcut_key_binding": null, - "shortcut_name": "MakeSmaller" + "shortcut_key_binding" : null, + "shortcut_name" : "MakeSmaller" }, { - "shortcut_key_binding": "ctrl+alt+k", - "shortcut_name": "MoveToLowerRight" + "shortcut_key_binding" : null, + "shortcut_name" : "RedoLastMove" }, { - "shortcut_key_binding": "ctrl+alt+i", - "shortcut_name": "MoveToUpperRight" + "shortcut_key_binding" : null, + "shortcut_name" : "MoveToUpperRight" }, { - "shortcut_key_binding": "ctrl+alt+down", - "shortcut_name": "MoveToBottomHalf" + "shortcut_key_binding" : "alt+cmd+down", + "shortcut_name" : "MoveToBottomHalf" }, { - "shortcut_key_binding": null, - "shortcut_name": "MoveToNextDisplay" + "shortcut_key_binding" : "ctrl+alt+cmd+right", + "shortcut_name" : "MoveToNextDisplay" }, { - "shortcut_key_binding": "ctrl+alt+up", - "shortcut_name": "MoveToTopHalf" + "shortcut_key_binding" : "alt+cmd+up", + "shortcut_name" : "MoveToTopHalf" }, { - "shortcut_key_binding": "ctrl+alt+j", - "shortcut_name": "MoveToLowerLeft" + "shortcut_key_binding" : null, + "shortcut_name" : "MoveToLowerLeft" }, { - "shortcut_key_binding": null, - "shortcut_name": "MakeLarger" + "shortcut_key_binding" : null, + "shortcut_name" : "MakeLarger" }, { - "shortcut_key_binding": null, - "shortcut_name": "MoveToPreviousDisplay" + "shortcut_key_binding" : "ctrl+alt+cmd+left", + "shortcut_name" : "MoveToPreviousDisplay" }, { - "shortcut_key_binding": null, - "shortcut_name": "UndoLastMove" + "shortcut_key_binding" : null, + "shortcut_name" : "UndoLastMove" }, { - "shortcut_key_binding": "ctrl+alt+f", - "shortcut_name": "MoveToFullscreen" + "shortcut_key_binding" : "alt+1", + "shortcut_name" : "MoveToFullscreen" }, { - "shortcut_key_binding": null, - "shortcut_name": "MoveToNextThird" + "shortcut_key_binding" : "ctrl+alt+right", + "shortcut_name" : "MoveToNextThird" }, { - "shortcut_key_binding": "ctrl+alt+left", - "shortcut_name": "MoveToLeftHalf" + "shortcut_key_binding" : "alt+2", + "shortcut_name" : "MoveToLeftHalf" }, { - "shortcut_key_binding": "ctrl+alt+c", - "shortcut_name": "MoveToCenter" + "shortcut_key_binding" : null, + "shortcut_name" : "MoveToCenter" }, { - "shortcut_key_binding": "ctrl+alt+right", - "shortcut_name": "MoveToRightHalf" + "shortcut_key_binding" : "alt+3", + "shortcut_name" : "MoveToRightHalf" }, { - "shortcut_key_binding": "ctrl+alt+u", - "shortcut_name": "MoveToUpperLeft" + "shortcut_key_binding" : null, + "shortcut_name" : "MoveToLowerRight" }, { - "shortcut_key_binding": null, - "shortcut_name": "MoveToPreviousThird" + "shortcut_key_binding" : null, + "shortcut_name" : "MoveToUpperLeft" } -] +] \ No newline at end of file From b8b96bf77b0c81c28580e4824165a7f9ec3ace63 Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Tue, 15 Jan 2019 16:04:03 -0500 Subject: [PATCH 49/61] Add Sublime Text settings. --- script/install.sh | 26 ++++++++++++++++++- sublime-text/User/.gitignore | 8 ++++++ .../User/Default (OSX).sublime-keymap | 4 +++ .../User/Package Control.sublime-settings | 16 ++++++++++++ .../User/Preferences.sublime-settings | 21 +++++++++++++++ sublime-text/User/bindingpry.sublime-snippet | 10 +++++++ 6 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 sublime-text/User/.gitignore create mode 100644 sublime-text/User/Default (OSX).sublime-keymap create mode 100644 sublime-text/User/Package Control.sublime-settings create mode 100644 sublime-text/User/Preferences.sublime-settings create mode 100644 sublime-text/User/bindingpry.sublime-snippet diff --git a/script/install.sh b/script/install.sh index e5da350..c6a1d99 100644 --- a/script/install.sh +++ b/script/install.sh @@ -52,6 +52,7 @@ IS_OH_MY_ZSH_INSTALLED=false IS_NODE_INSTALLED=false IS_VSCODE_INSTALLED=false IS_ITERM_INSTALLED=false +IS_SUBLIME_TEXT_INSTALLED=false clear @@ -311,6 +312,29 @@ fi # fi # fi +#---------------------------- +# Sublime Text +#---------------------------- + +if [ -d /Applications/Sublime\ Text.app/ ]; then + IS_SUBLIME_TEXT_INSTALLED=true +fi + +if $IS_SUBLIME_TEXT_INSTALLED; then + read -p "${ARROW_YELLOW} Install Sublime Text settings? [y/n]: " + + if [ "$REPLY" == "y" ]; then + if [ -d ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User ]; then + echo "${ARROW} Installing Sublime Text settings..." + rm -rf ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User + ln -s $PWD/sublime-text/User ~/Library/Application\ Support/Sublime\ Text\ 3/Packages + else + echo "${RED}${BOLD}Note:$DEFAULT You need to open Sublime Text at least once before installing the settings." + echo "While you are there, install the Package Control for better results. Then, re-apply this script!" + fi + fi +fi + #---------------------------- # Spectacle shortcuts #---------------------------- @@ -323,7 +347,7 @@ if $IS_SPECTACLE_INSTALLED; then read -p "${ARROW_YELLOW} Configure Spectacle shortcuts? [y/n]: " if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring Spectacle shotrcuts..." + echo "${ARROW} Configuring Spectacle shortcuts..." cp -r spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null fi fi diff --git a/sublime-text/User/.gitignore b/sublime-text/User/.gitignore new file mode 100644 index 0000000..7fc03a9 --- /dev/null +++ b/sublime-text/User/.gitignore @@ -0,0 +1,8 @@ +Package Control.cache/ +Package Control.merged-ca-bundle +Package Control.system-ca-bundle +Package Control.user-ca-bundle +Package Control.last-run +oscrypto-ca-bundle.crt +*.sublime-workspace +.SublimeREPLHistory diff --git a/sublime-text/User/Default (OSX).sublime-keymap b/sublime-text/User/Default (OSX).sublime-keymap new file mode 100644 index 0000000..d9cc947 --- /dev/null +++ b/sublime-text/User/Default (OSX).sublime-keymap @@ -0,0 +1,4 @@ +[ + { "keys": ["super+t"], "command": "goto_definition" }, + { "keys": ["super+g"], "command": "jump_back" }, +] diff --git a/sublime-text/User/Package Control.sublime-settings b/sublime-text/User/Package Control.sublime-settings new file mode 100644 index 0000000..c886961 --- /dev/null +++ b/sublime-text/User/Package Control.sublime-settings @@ -0,0 +1,16 @@ +{ + "bootstrapped": true, + "in_process_packages": + [ + ], + "installed_packages": + [ + "BracketHighlighter", + "Dracula Color Scheme", + "FileIcons", + "GitGutter", + "Package Control", + "SideBarEnhancements", + "SublimeLinter" + ] +} diff --git a/sublime-text/User/Preferences.sublime-settings b/sublime-text/User/Preferences.sublime-settings new file mode 100644 index 0000000..e4d4d93 --- /dev/null +++ b/sublime-text/User/Preferences.sublime-settings @@ -0,0 +1,21 @@ +{ + "bold_folder_labels": true, + "color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme", + "font_options": + [ + "gray_antialias" + ], + "font_size": 12, + "highlight_line": true, + "highlight_modified_tabs": true, + "ignored_packages": + [ + "Vintage" + ], + "overlay_scroll_bars": "enabled", + "show_full_path": true, + "spell_check": true, + "tab_size": 2, + "theme": "Adaptive.sublime-theme", + "translate_tabs_to_spaces": true +} diff --git a/sublime-text/User/bindingpry.sublime-snippet b/sublime-text/User/bindingpry.sublime-snippet new file mode 100644 index 0000000..0234249 --- /dev/null +++ b/sublime-text/User/bindingpry.sublime-snippet @@ -0,0 +1,10 @@ + + + + bpry + + + Add binding.pry. + From a812a6447eabf73d3dbb4df0a0b177d8871a71a1 Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Tue, 15 Jan 2019 16:09:42 -0500 Subject: [PATCH 50/61] Add new aliases and macOS default settings. --- oh-my-zsh/aliases.zsh | 4 ++++ script/defaults.sh | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/oh-my-zsh/aliases.zsh b/oh-my-zsh/aliases.zsh index 7e39e5f..d9865e0 100644 --- a/oh-my-zsh/aliases.zsh +++ b/oh-my-zsh/aliases.zsh @@ -8,3 +8,7 @@ alias gwip="git add -u && git commit -m 'WIP'" alias gundo="reset HEAD~1 --mixed" alias greb="git fetch && git rebase -i origin/master" +# Show/hide hidden files in Finder +alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" +alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" + diff --git a/script/defaults.sh b/script/defaults.sh index 6fc90fd..a196cd5 100755 --- a/script/defaults.sh +++ b/script/defaults.sh @@ -60,7 +60,6 @@ defaults write NSGlobalDomain com.apple.springing.delay -float 0 # Safari & WebKit # ############################################################################### - # Show the full URL in the address bar (note: this still hides the scheme) defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari ShowFullURLInSmartSearchField -bool true @@ -87,7 +86,6 @@ defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/co # Set Safari’s home page to `about:blank` for faster loading # defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari HomePage -string "about:blank" - ############################################################################### # Dock, Dashboard # ############################################################################### @@ -192,7 +190,6 @@ defaults write NSGlobalDomain AppleHighlightColor -string "0.847059 0.847059 0.8 # Possible values: `WhenScrolling`, `Automatic` and `Always` defaults write NSGlobalDomain AppleShowScrollBars -string "WhenScrolling" - ############################################################################### # Other stuff # ############################################################################### @@ -235,6 +232,9 @@ defaults write NSGlobalDomain NSCloseAlwaysConfirmsChanges -bool true # Set alert sound defaults write NSGlobalDomain com.apple.sound.beep.sound -string "/System/Library/Sounds/Funk.aiff" +# Play feedback when volume is changed +defaults write NSGlobalDomain com.apple.sound.beep.feedback -int 1 + # Set date format in menubar defaults write "com.apple.menuextra.clock" DateFormat -string "EEE MMM d h:mm a" From 53911adf49faee719a9d464585816054b05b7944 Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Wed, 14 Apr 2021 09:46:16 -0400 Subject: [PATCH 51/61] Add git aliases and update settings. --- .gitconfig | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.gitconfig b/.gitconfig index 5ff1442..67b982a 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,10 +1,10 @@ [user] - name = First Last - email = email@email.com + name = First Last + email = email@email.com [core] - editor = editor + editor = editor [credential] - helper = osxkeychain + helper = osxkeychain [color] ui = true diff = auto @@ -20,3 +20,31 @@ untracked = cyan [pager] branch = false +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true +[alias] + tree = log --graph --pretty=oneline + lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit + l = log --pretty=colored + s = status + d = diff + aa = add -A + co = checkout + cob = checkout -b + del = branch -d + delete = branch -D + reb = !git fetch && git rebase -i origin/master + ren = "!f() { git branch -m ${2} ${1}; }; f" + up = !git fetch origin && git pull --rebase --prune + cm = !git add -A && git commit + save = !git add -A && git commit -m "SAVEPOINT" + wip = !git add -u && git commit -m "WIP" + undo = reset HEAD~1 --mixed + amend = commit -a --amend --reuse-message=HEAD + wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard + bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f" + bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f" + contributors = "shortlog --summary --numbered" \ No newline at end of file From 16ec83e8ba91b797ce9b0d93d696f52e5104e700 Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Wed, 14 Apr 2021 09:46:28 -0400 Subject: [PATCH 52/61] Update aliases. --- oh-my-zsh/aliases.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oh-my-zsh/aliases.zsh b/oh-my-zsh/aliases.zsh index d9865e0..7d30756 100644 --- a/oh-my-zsh/aliases.zsh +++ b/oh-my-zsh/aliases.zsh @@ -1,6 +1,6 @@ # zsh / oh-my-zsh -alias zshconfig="subl ~/.zshrc" -alias ohmyzsh="subl ~/.oh-my-zsh" +alias zshconfig="code ~/.zshrc" +alias ohmyzsh="code ~/.oh-my-zsh" alias reload!="source ~/.zshrc" alias gamd="git commit -a --amend --reuse-message=HEAD" @@ -12,3 +12,4 @@ alias greb="git fetch && git rebase -i origin/master" alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" +alias cop="bundle exec rubocop" From 7405793ddfffbe8f2074e7c90d44fb25c7e65e07 Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Wed, 14 Apr 2021 09:47:09 -0400 Subject: [PATCH 53/61] Add Mac Startup Chime option to the installation script. --- script/install.sh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/script/install.sh b/script/install.sh index c6a1d99..f560cad 100644 --- a/script/install.sh +++ b/script/install.sh @@ -124,7 +124,7 @@ if [ "$REPLY" == "y" ]; then read -p "${ARROW_YELLOW} Please enter Git e-mail: " email read -p "${ARROW_YELLOW} Please enter Git editor: " editor echo "${ARROW} Creating ~/.gitconfig file..." - + cp ~/.gitconfig ~/.gitconfig.mac_setup_backup 2> /dev/null cp .gitconfig ~ sed -i -e "s/First Last/$username/g" ~/.gitconfig @@ -171,7 +171,7 @@ if $IS_HOMEBREW_INSTALLED; then if [ "$REPLY" == "y" ]; then SELECTED_CASK_APPLICATIONS+=("$item") fi - done + done if [ ${#SELECTED_CASK_APPLICATIONS[@]} -gt 0 ]; then echo "${ARROW} Installing applications via Homebrew Cask..." @@ -231,7 +231,7 @@ if $IS_ITERM_INSTALLED; then fi fi -# TEMPORARILY DISABLED +# TEMPORARILY DISABLED #---------------------------- # Node Version Manager #---------------------------- @@ -254,7 +254,7 @@ fi # fi # fi -# TEMPORARILY DISABLED +# TEMPORARILY DISABLED #---------------------------- # VS Code extensions #---------------------------- @@ -272,7 +272,7 @@ fi # if [ "$REPLY" == "y" ]; then # SELECTED_VSCODE_EXTENSIONS+=("$item") # fi -# done +# done # if [ ${#SELECTED_VSCODE_EXTENSIONS[@]} -gt 0 ]; then # echo "${ARROW} Installing Visual Studio Code extensions..." @@ -284,7 +284,7 @@ fi # fi # fi -# TEMPORARILY DISABLED +# TEMPORARILY DISABLED #---------------------------- # VS Code settings #---------------------------- @@ -298,7 +298,7 @@ fi # fi # fi -# TEMPORARILY DISABLED +# TEMPORARILY DISABLED #---------------------------- # VS Code snippets #---------------------------- @@ -358,7 +358,7 @@ fi if [[ $(sudo firmwarepasswd -check) =~ "Password Enabled: Yes" ]]; then echo "${ARROW_GREEN} Firmware password is already set up!" -else +else read -p "${ARROW_YELLOW} Set up firmware password? [y/n]: " if [ "$REPLY" == "y" ]; then @@ -380,6 +380,18 @@ if [ "$REPLY" == "y" ]; then sudo scutil --set LocalHostName $uservar fi +#---------------------------- +# Enable Mac Startup Chime +#---------------------------- + +read -p "${ARROW_YELLOW} Enable Mac Startup Chime? [y/n]: " + +if [ "$REPLY" == "y" ]; then + echo "${ARROW} Enabling Mac Startup Chime..." + + sudo nvram StartupMute=%00 +fi + #---------------------------- # macOS Defaults #---------------------------- From 1455b7accaa9861bfa9eb15306037c14a5fa6637 Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Wed, 13 Apr 2022 15:20:21 -0400 Subject: [PATCH 54/61] Update and clean up ZSH configuration file. --- .zshrc | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.zshrc b/.zshrc index bc4630d..d8613f3 100644 --- a/.zshrc +++ b/.zshrc @@ -2,17 +2,17 @@ # export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. -export ZSH="$HOME/.oh-my-zsh" +export ZSH=$HOME/.oh-my-zsh # Set name of the theme to load --- if set to "random", it will # load a random theme each time oh-my-zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME -# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes ZSH_THEME="tranquility" # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load -# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ +# a theme from this variable instead of looking in $ZSH/themes/ # If set to an empty array, this variable will have no effect. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) @@ -26,9 +26,15 @@ ZSH_THEME="tranquility" # Uncomment the following line to disable bi-weekly auto-update checks. # DISABLE_AUTO_UPDATE="true" +# Uncomment the following line to automatically update without prompting. +# DISABLE_UPDATE_PROMPT="true" + # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + # Uncomment the following line to disable colors in ls. # DISABLE_LS_COLORS="true" @@ -39,6 +45,8 @@ ZSH_THEME="tranquility" # ENABLE_CORRECTION="true" # Uncomment the following line to display red dots whilst waiting for completion. +# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work) +# See https://github.com/ohmyzsh/ohmyzsh/issues/5765 # COMPLETION_WAITING_DOTS="true" # Uncomment the following line if you want to disable marking untracked files @@ -57,22 +65,14 @@ ZSH_THEME="tranquility" # Would you like to use another custom folder than $ZSH/custom? ZSH_CUSTOM=custom_path -# bundler plugin settings -BUNDLED_COMMANDS=(rubocop) - # Which plugins would you like to load? -# Standard plugins can be found in ~/.oh-my-zsh/plugins/* -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=( - bundler git rails - tig - urltools - zsh-syntax-highlighting - zsh-autosuggestions ) source $ZSH/oh-my-zsh.sh @@ -80,12 +80,9 @@ source $ZSH/oh-my-zsh.sh # User configuration if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi +if which asdf > /dev/null; then echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc; fi if which direnv > /dev/null; then eval "$(direnv hook zsh)"; fi -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion - # export MANPATH="/usr/local/man:$MANPATH" # You may need to manually set your language environment @@ -101,9 +98,6 @@ export NVM_DIR="$HOME/.nvm" # Compilation flags # export ARCHFLAGS="-arch x86_64" -# ssh -# export SSH_KEY_PATH="~/.ssh/rsa_id" - # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh # users are encouraged to define aliases within the ZSH_CUSTOM folder. From a9ea14f8801a6ef3d6b07db82486ae9a05ddd25a Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Wed, 13 Apr 2022 16:12:31 -0400 Subject: [PATCH 55/61] Add missing and remove unused casks from Brewfile. --- .gitignore | 1 + Brewfile | 54 ++++++++++++++++++++++++++++-------------------------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 2276a02..a0e470f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.DS_Store .vscode/ +Brewfile.lock.json diff --git a/Brewfile b/Brewfile index bd6ee77..0b19392 100755 --- a/Brewfile +++ b/Brewfile @@ -1,29 +1,31 @@ -brew 'git' -brew 'mas' +brew "mas" -cask 'appcleaner' -cask 'background-music' -cask 'cyberduck' -cask 'firefox' -cask 'flux' -cask 'fork' -cask 'google-chrome' -cask 'gpg-suite' -cask 'keepingyouawake' -cask 'keka' -cask 'mamp' -cask 'opera' -cask 'postman' -cask 'sequel-pro' -cask 'skype' -cask 'slack' -cask 'spectacle' -cask 'transmission' -cask 'tunnelblick' -cask 'visual-studio-code' -cask 'vlc' +cask "1password" +cask "alfred" +cask "android-file-transfer" +cask "appcleaner" +cask "calibre" +cask "firefox" +cask "github" +cask "google-chrome" +cask "imageoptim" +cask "insomnia" +cask "iterm2" +cask "licecap" +cask "logitech-options" +cask "postico" +cask "rectangle" +cask "sequel-pro" +cask "slack" +cask "transmission" +cask "visual-studio-code" +cask "vlc" +cask "whatsapp" +cask "xbar" -mas "iMovie", id: 408981434 -mas "Numbers", id: 409203825 -mas "Pages", id: 409201541 +mas "Bumpr", id: 1166066070 +mas "GIPHY", id: 668208984 +mas "Things", id: 904280696 +mas "Wipr", id: 1320666476 +mas "Vinegar", id: 1591303229 mas "Xcode", id: 497799835 From d30d51818ad85ba355b8f62753c0ba00a6daca43 Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Wed, 13 Apr 2022 16:12:56 -0400 Subject: [PATCH 56/61] Remove unused oh-my-zsh plugins. --- oh-my-zsh/plugins/zsh-autosuggestions | 1 - oh-my-zsh/plugins/zsh-syntax-highlighting | 1 - 2 files changed, 2 deletions(-) delete mode 160000 oh-my-zsh/plugins/zsh-autosuggestions delete mode 160000 oh-my-zsh/plugins/zsh-syntax-highlighting diff --git a/oh-my-zsh/plugins/zsh-autosuggestions b/oh-my-zsh/plugins/zsh-autosuggestions deleted file mode 160000 index ebaf409..0000000 --- a/oh-my-zsh/plugins/zsh-autosuggestions +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ebaf409002be498a681267a75f5efcaf45cd0ccc diff --git a/oh-my-zsh/plugins/zsh-syntax-highlighting b/oh-my-zsh/plugins/zsh-syntax-highlighting deleted file mode 160000 index 4ce56a8..0000000 --- a/oh-my-zsh/plugins/zsh-syntax-highlighting +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4ce56a821e9988c1a24fa1b1d62ed57f72893217 From c8b95f2635a1586400e55c75b8e42b3aff960354 Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Wed, 13 Apr 2022 16:13:12 -0400 Subject: [PATCH 57/61] Add Rectangle app settings. --- rectangle.plist | Bin 0 -> 234 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 rectangle.plist diff --git a/rectangle.plist b/rectangle.plist new file mode 100644 index 0000000000000000000000000000000000000000..044e46ad4eb8f330d911e61c7018dcdf46ed6799 GIT binary patch literal 234 zcmYc)$jK}&F)+B!$i&RT%Er#Y$;rvX%Nd=MSX>g8T2!2wpBFD6nV3_OT9lVqlIoJ0 zmROoo5}c7=RFYg;QXHF;Selod;h*P|pPmU+DI6T?kyz{l7EDcXN=?fzN{tub4-WMK zn&+I6nw%YynF|yVFD^|gPAx1=%`0)ONClb%w8u9;1tb$3>YA6Bl#}XMT9TieSdy6x z)>a&3Y5;VavEyOMRf}I+z7}BQ Date: Wed, 13 Apr 2022 16:13:42 -0400 Subject: [PATCH 58/61] Update macOS defaults. --- script/defaults.sh | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/script/defaults.sh b/script/defaults.sh index a196cd5..726ed45 100755 --- a/script/defaults.sh +++ b/script/defaults.sh @@ -7,6 +7,10 @@ # # Run ./defaults.sh and you'll be good to go. +# Close any open System Preferences panes, to prevent them from overriding +# settings we’re about to change +osascript -e 'tell application "System Preferences" to quit' + ############################################################################### # Finder # ############################################################################### @@ -60,31 +64,24 @@ defaults write NSGlobalDomain com.apple.springing.delay -float 0 # Safari & WebKit # ############################################################################### -# Show the full URL in the address bar (note: this still hides the scheme) -defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari ShowFullURLInSmartSearchField -bool true +# Show favorites bar in Safari by default +defaults write com.apple.Safari ShowFavoritesBar -bool true -# Show website icons in tabs -defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari ShowIconsInTabs -bool true +# Show the full URL in the address bar (note: this still hides the scheme) +defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true # Hide Safari’s sidebar in Top Sites -defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari ShowSidebarInTopSites -bool false +defaults write com.apple.Safari ShowSidebarInTopSites -bool false # Enable Safari’s debug menu -defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari IncludeInternalDebugMenu -bool true +defaults write com.apple.Safari IncludeInternalDebugMenu -bool true # Shoe Safari’s status bar -defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari ShowOverlayStatusBar -bool true +defaults write com.apple.Safari ShowOverlayStatusBar -bool true # Enable the Develop menu and the Web Inspector in Safari -defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari IncludeDevelopMenu -bool true -defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true -defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true - -# Ask websites not to track -defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari SendDoNotTrackHTTPHeader -bool true - -# Set Safari’s home page to `about:blank` for faster loading -# defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari HomePage -string "about:blank" +defaults write com.apple.Safari IncludeDevelopMenu -bool true +defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true ############################################################################### # Dock, Dashboard # @@ -205,13 +202,13 @@ defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true -# File save, save to disk by default rather than to iCloud +# File save, save to disk by default rather than to iCloud defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false # Disable opening and closing window animation defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false -# Text, spell checker automatically identifies languages +# Text, spell checker automatically identifies languages defaults write NSGlobalDomain NSSpellCheckerAutomaticallyIdentifiesLanguages -bool true # Use plain text mode for new TextEdit documents @@ -221,12 +218,12 @@ defaults write com.apple.TextEdit RichText -int 0 defaults write com.apple.dock ResetLaunchPad -bool true # Show battery percentage in Menu Bar -defaults write com.apple.menuextra.battery ShowPercent YES +# defaults write com.apple.menuextra.battery ShowPercent YES # Close windows then quitting an app defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool true -# Ask to kepp change when closing documents +# Ask to keep change when closing documents defaults write NSGlobalDomain NSCloseAlwaysConfirmsChanges -bool true # Set alert sound From cc064e77c9a8a11f46197d1c8cdf469149834ea7 Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Wed, 13 Apr 2022 16:14:12 -0400 Subject: [PATCH 59/61] Change git reb alias to use the main branch. --- .gitconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitconfig b/.gitconfig index 67b982a..ff84a7c 100644 --- a/.gitconfig +++ b/.gitconfig @@ -36,7 +36,7 @@ cob = checkout -b del = branch -d delete = branch -D - reb = !git fetch && git rebase -i origin/master + reb = !git fetch && git rebase -i origin/main ren = "!f() { git branch -m ${2} ${1}; }; f" up = !git fetch origin && git pull --rebase --prune cm = !git add -A && git commit @@ -47,4 +47,4 @@ wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f" bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f" - contributors = "shortlog --summary --numbered" \ No newline at end of file + contributors = "shortlog --summary --numbered" From 7274def4e319338f691784a274955787e48d751c Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Wed, 13 Apr 2022 16:14:47 -0400 Subject: [PATCH 60/61] Convert install script from bash to zsh. --- script/install.sh | 305 +++++++++++++++++++--------------------------- 1 file changed, 122 insertions(+), 183 deletions(-) mode change 100644 => 100755 script/install.sh diff --git a/script/install.sh b/script/install.sh old mode 100644 new mode 100755 index f560cad..71ea32b --- a/script/install.sh +++ b/script/install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/zsh # Logo LOGO=" __ __ _____ _ @@ -30,29 +30,10 @@ ARROW="$CYAN$BOLD==>$DEFAULT" ARROW_GREEN="$GREEN$BOLD==>$DEFAULT" ARROW_YELLOW="$YELLOW$BOLD==>$DEFAULT" -# Array of available applications that can be installed via Homebrew Cask -AVAILABLE_CASK_APPLICATIONS=(alfred amazon-music appcleaner bitbar dropbox firefox github google-chrome postman postico sequel-pro slack spectacle transmission iterm2 imageoptim 1password sublime-text visual-studio-code vlc spotify) - -# Array of available npm packages -AVAILABLE_NPM_PACKAGES=(gulp-cli jest live-server create-react-app) - -# Array of available VS Code extensions -AVAILABLE_VSCODE_EXTENSIONS=(CoenraadS.bracket-pair-colorizer PKief.material-icon-theme alefragnani.project-manager christian-kohler.path-intellisense dbaeumer.vscode-eslint formulahendry.auto-rename-tag mrmlnc.vscode-scss msjsdiag.debugger-for-chrome techer.open-in-browser aaron-bond.better-comments kamikillerto.vscode-colorize christian-kohler.npm-intellisense) - -# Arrays of applications/packages/extensions selected by user (empty by default) -SELECTED_CASK_APPLICATIONS=() -SELECTED_NPM_PACKAGES=() -SELECTED_VSCODE_EXTENTIONS=() - # Booleans to track if specific programs are already installed IS_HOMEBREW_INSTALLED=false -IS_MAS_INSTALLED=false -IS_NVM_INSTALLED=false IS_OH_MY_ZSH_INSTALLED=false -IS_NODE_INSTALLED=false -IS_VSCODE_INSTALLED=false IS_ITERM_INSTALLED=false -IS_SUBLIME_TEXT_INSTALLED=false clear @@ -85,14 +66,21 @@ fi if $IS_HOMEBREW_INSTALLED; then echo "${ARROW_GREEN} Homebrew already installed!" - echo "${ARROW} Updating Homebrew formulas..." - brew update - brew upgrade + echo -n "${ARROW_YELLOW} Update Homebrew formulas? [y/n]: " + read REPLY + + if [[ "$REPLY" == "y" ]]; then + echo "${ARROW} Updating Homebrew formulas..." + + brew update + brew upgrade + fi else - read -ep "${ARROW_YELLOW} Install Homebrew? [y/n]: " + echo -n "${ARROW_YELLOW} Install Homebrew? [y/n]: " + read REPLY - if [ "$REPLY" == "y" ]; then + if [[ "$REPLY" == "y" ]]; then echo "${ARROW} Installing Homebrew..." ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" @@ -100,14 +88,31 @@ else fi fi +#---------------------------- +# Basic Dependencies +#---------------------------- + +if $IS_HOMEBREW_INSTALLED; then + # read -p "${ARROW_YELLOW} Install dependencies (coreutils, curl, openssl and readline) via Homebrew? [y/n]: " + echo -n "${ARROW_YELLOW} Install dependencies (coreutils, curl, openssl and readline) via Homebrew? [y/n]: " + read REPLY + + if [[ "$REPLY" == "y" ]]; then + echo "${ARROW} Installing dependencies..." + brew install coreutils curl openssl readline + fi +fi + #---------------------------- # Git #---------------------------- if $IS_HOMEBREW_INSTALLED; then - read -p "${ARROW_YELLOW} Install latest Git version via Homebrew? [y/n]: " + # read -p "${ARROW_YELLOW} Install latest Git version via Homebrew? [y/n]: " + echo -n "${ARROW_YELLOW} Install latest Git version via Homebrew? [y/n]: " + read REPLY - if [ "$REPLY" == "y" ]; then + if [[ "$REPLY" == "y" ]]; then echo "${ARROW} Installing Git..." brew install git fi @@ -117,12 +122,16 @@ fi # .gitconfig #---------------------------- -read -p "${ARROW_YELLOW} Configure Git by creating ~/.gitconfig file? [y/n]: " +echo -n "${ARROW_YELLOW} Configure Git by creating ~/.gitconfig file? [y/n]: " +read REPLY -if [ "$REPLY" == "y" ]; then - read -p "${ARROW_YELLOW} Please enter full name: " username - read -p "${ARROW_YELLOW} Please enter Git e-mail: " email - read -p "${ARROW_YELLOW} Please enter Git editor: " editor +if [[ "$REPLY" == "y" ]]; then + echo -n "${ARROW_YELLOW} Please enter full name: " + read username + echo -n "${ARROW_YELLOW} Please enter Git e-mail: " + read email + echo -n "${ARROW_YELLOW} Please enter Git editor: " + read editor echo "${ARROW} Creating ~/.gitconfig file..." cp ~/.gitconfig ~/.gitconfig.mac_setup_backup 2> /dev/null @@ -137,64 +146,89 @@ fi #---------------------------- if $IS_HOMEBREW_INSTALLED; then - read -p "${ARROW_YELLOW} Install Tig: text-mode interface for Git via Homebrew? [y/n]: " + echo -n "${ARROW_YELLOW} Install Tig: text-mode interface for Git via Homebrew? [y/n]: " + read REPLY - if [ "$REPLY" == "y" ]; then + if [[ "$REPLY" == "y" ]]; then echo "${ARROW} Installing Tig..." brew install tig fi fi +#---------------------------- +# direnv +#---------------------------- + +if $IS_HOMEBREW_INSTALLED; then + echo -n "${ARROW_YELLOW} Install direnv via Homebrew? [y/n]: " + read REPLY + + if [[ "$REPLY" == "y" ]]; then + echo "${ARROW} Installing direnv..." + brew install direnv + fi +fi + #---------------------------- # rbenv & ruby-build #---------------------------- if $IS_HOMEBREW_INSTALLED; then - read -p "${ARROW_YELLOW} Install rbenv & ruby-build via Homebrew? [y/n]: " + echo -n "${ARROW_YELLOW} Install rbenv & ruby-build via Homebrew? [y/n]: " + read REPLY - if [ "$REPLY" == "y" ]; then + if [[ "$REPLY" == "y" ]]; then echo "${ARROW} Installing rbenv & ruby-build..." brew install rbenv ruby-build fi fi #---------------------------- -# Application bundle +# asdf & ruby-build #---------------------------- if $IS_HOMEBREW_INSTALLED; then - read -p "${ARROW_YELLOW} Install applications via Homebrew Cask? [y/n]: " - - if [ "$REPLY" == "y" ]; then - for item in "${AVAILABLE_CASK_APPLICATIONS[@]}"; do - read -ep "${ARROW_YELLOW} Install \"$item\"? [y/n]: " - if [ "$REPLY" == "y" ]; then - SELECTED_CASK_APPLICATIONS+=("$item") - fi - done - - if [ ${#SELECTED_CASK_APPLICATIONS[@]} -gt 0 ]; then - echo "${ARROW} Installing applications via Homebrew Cask..." - for application in "${SELECTED_CASK_APPLICATIONS[@]}"; do - brew cask install ${application} - done - fi + echo -n "${ARROW_YELLOW} Install asdf & ruby-build via Homebrew? [y/n]: " + read REPLY + + if [[ "$REPLY" == "y" ]]; then + echo "${ARROW} Installing asdf & ruby-build..." + brew install asdf + asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git fi fi #---------------------------- -# oh-my-zsh +# Application bundle #---------------------------- -read -p "${ARROW_YELLOW} Install Oh My Zsh? [y/n]: " +if $IS_HOMEBREW_INSTALLED; then + echo -n "${ARROW_YELLOW} Install applications via Homebrew Cask and Mac App Store? [y/n]: " + read REPLY + # read -r + + if [[ "$REPLY" = "y" ]]; then + echo -e "${RED}${BOLD}Important: Sign into the Mac App Store GUI app manually. Hit any key to continue. " + read + echo "${ARROW} Installing applications..." + brew bundle + fi +fi + +# ---------------------------- +# oh-my-zsh +# ---------------------------- + +echo -n "${ARROW_YELLOW} Install Oh My Zsh? [y/n]: " +read REPLY -if [ "$REPLY" == "y" ]; then +if [[ "$REPLY" == "y" ]]; then echo -e "${NEW_LINE}${RED_DIVIDER}" echo -e "${RED}${BOLD}Important: After the Oh My Zs installation is done, you will have to 'exit' the new shell to continue this script." echo -e "${RED_DIVIDER}${NEW_LINE}" echo "${ARROW} Installing Oh My Zsh..." - sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" IS_OH_MY_ZSH_INSTALLED=true fi @@ -204,9 +238,10 @@ fi #---------------------------- if $IS_OH_MY_ZSH_INSTALLED; then - read -p "${ARROW_YELLOW} Configure Oh My Zsh by creating ~/.zshrc file? [y/n]: " + echo -n "${ARROW_YELLOW} Configure Oh My Zsh by creating ~/.zshrc file? [y/n]: " + read REPLY - if [ "$REPLY" == "y" ]; then + if [[ "$REPLY" == "y" ]]; then echo "${ARROW} Creating ~/.zshrc file..." cp ~/.zshrc ~/.zshrc.mac_setup_backup 2> /dev/null cp .zshrc ~ @@ -223,132 +258,31 @@ if [ -d /Applications/iTerm.app/ ]; then fi if $IS_ITERM_INSTALLED; then - read -p "${ARROW_YELLOW} Install Dracula iTerm2 profile? [y/n]: " + echo -n "${ARROW_YELLOW} Install Dracula iTerm2 profile? [y/n]: " + read REPLY - if [ "$REPLY" == "y" ]; then + if [[ "$REPLY" == "y" ]]; then echo "${ARROW_YELLOW} New iTerm2 window opened. Go to 'Preferences' > 'Profiles' > 'Colors' and choose 'Dracula' from the 'Color Presets' menu." open ./Dracula.itermcolors fi fi -# TEMPORARILY DISABLED -#---------------------------- -# Node Version Manager -#---------------------------- - -# if ! [ -x "$(command -v nvm)" ]; then -# IS_NVM_INSTALLED=true -# fi - -# if $IS_NVM_INSTALLED; then -# echo "${ARROW_GREEN} Node Version Manager already installed!" -# else -# read -p "${ARROW_YELLOW} Install nvm (Node Version Manager)? [y/n]: " - -# if [ "$REPLY" == "y" ]; then -# echo "${ARROW} Installing Node Version Manager..." -# curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash -# source ~/.bash_profile - -# IS_NVM_INSTALLED=true -# fi -# fi - -# TEMPORARILY DISABLED -#---------------------------- -# VS Code extensions -#---------------------------- - -# if hash code 2>/dev/null; then -# IS_VSCODE_INSTALLED=true -# fi - -# if $IS_VSCODE_INSTALLED; then -# read -p "${ARROW_YELLOW} Install Visual Studio Code extensions? [y/n]: " - -# if [ "$REPLY" == "y" ]; then -# for item in "${AVAILABLE_VSCODE_EXTENSIONS[@]}"; do -# read -ep "${ARROW_YELLOW} Install \"$item\"? [y/n]: " -# if [ "$REPLY" == "y" ]; then -# SELECTED_VSCODE_EXTENSIONS+=("$item") -# fi -# done - -# if [ ${#SELECTED_VSCODE_EXTENSIONS[@]} -gt 0 ]; then -# echo "${ARROW} Installing Visual Studio Code extensions..." -# for application in "${SELECTED_NPM_PACKAGES[@]}"; do -# code --install-extension ${application} -# done -# fi - -# fi -# fi - -# TEMPORARILY DISABLED -#---------------------------- -# VS Code settings -#---------------------------- - -# if $IS_VSCODE_INSTALLED; then -# read -p "${ARROW_YELLOW} Configure Visual Studio Code settings? [y/n]: " - -# if [ "$REPLY" == "y" ]; then -# echo "${ARROW} Configuring Visual Studio Code settings..." -# cp settings.json /Users/${USER}/Library/Application\ Support/Code/User -# fi -# fi - -# TEMPORARILY DISABLED -#---------------------------- -# VS Code snippets -#---------------------------- - -# if $IS_VSCODE_INSTALLED; then -# read -p "${ARROW_YELLOW} Configure Visual Studio Code snippets? [y/n]: " - -# if [ "$REPLY" == "y" ]; then -# echo "${ARROW} Configuring Visual Studio Code snippets..." -# cp snippets.code-snippets /Users/${USER}/Library/Application\ Support/Code/User/snippets -# fi -# fi - -#---------------------------- -# Sublime Text -#---------------------------- - -if [ -d /Applications/Sublime\ Text.app/ ]; then - IS_SUBLIME_TEXT_INSTALLED=true -fi - -if $IS_SUBLIME_TEXT_INSTALLED; then - read -p "${ARROW_YELLOW} Install Sublime Text settings? [y/n]: " - - if [ "$REPLY" == "y" ]; then - if [ -d ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User ]; then - echo "${ARROW} Installing Sublime Text settings..." - rm -rf ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User - ln -s $PWD/sublime-text/User ~/Library/Application\ Support/Sublime\ Text\ 3/Packages - else - echo "${RED}${BOLD}Note:$DEFAULT You need to open Sublime Text at least once before installing the settings." - echo "While you are there, install the Package Control for better results. Then, re-apply this script!" - fi - fi -fi - #---------------------------- -# Spectacle shortcuts +# Rectangle settings #---------------------------- -if [ -d /Applications/Spectacle.app/ ]; then - IS_SPECTACLE_INSTALLED=true +if [ -d /Applications/Rectangle.app/ ]; then + IS_RECTANGLE_INSTALLED=true fi -if $IS_SPECTACLE_INSTALLED; then - read -p "${ARROW_YELLOW} Configure Spectacle shortcuts? [y/n]: " +if $IS_RECTANGLE_INSTALLED; then + echo -n "${ARROW_YELLOW} Configure Rectangle settings? [y/n]: " + read REPLY - if [ "$REPLY" == "y" ]; then - echo "${ARROW} Configuring Spectacle shortcuts..." - cp -r spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null + if [[ "$REPLY" == "y" ]]; then + echo "${ARROW} Configuring Rectangle settings..." + cp ~/Library/Preferences/com.knollsoft.Rectangle.plist ~/Library/Preferences/com.knollsoft.Rectangle.plist.mac_setup_backup 2> /dev/null + cp -r rectangle.plist ~/Library/Preferences/com.knollsoft.Rectangle.plist 2> /dev/null fi fi @@ -359,9 +293,10 @@ fi if [[ $(sudo firmwarepasswd -check) =~ "Password Enabled: Yes" ]]; then echo "${ARROW_GREEN} Firmware password is already set up!" else - read -p "${ARROW_YELLOW} Set up firmware password? [y/n]: " + echo -n "${ARROW_YELLOW} Set up firmware password? [y/n]: " + read REPLY - if [ "$REPLY" == "y" ]; then + if [[ "$REPLY" == "y" ]]; then sudo firmwarepasswd -setpasswd -setmode command fi fi @@ -370,10 +305,12 @@ fi # Computer name #---------------------------- -read -p "${ARROW_YELLOW} Set computer name? [y/n]: " +echo -n "${ARROW_YELLOW} Set computer name? [y/n]: " +read REPLY -if [ "$REPLY" == "y" ]; then - read -p "${ARROW_YELLOW} Please enter computer name: " uservar +if [[ "$REPLY" == "y" ]]; then + echo -n "${ARROW_YELLOW} Please enter computer name: " uservar + read uservar sudo scutil --set ComputerName $uservar sudo scutil --set HostName $uservar @@ -384,9 +321,10 @@ fi # Enable Mac Startup Chime #---------------------------- -read -p "${ARROW_YELLOW} Enable Mac Startup Chime? [y/n]: " +echo -n "${ARROW_YELLOW} Enable Mac Startup Chime? [y/n]: " +read REPLY -if [ "$REPLY" == "y" ]; then +if [[ "$REPLY" == "y" ]]; then echo "${ARROW} Enabling Mac Startup Chime..." sudo nvram StartupMute=%00 @@ -396,9 +334,10 @@ fi # macOS Defaults #---------------------------- -read -p "${ARROW_YELLOW} Configure macOS Defaults? [y/n]: " +echo -n "${ARROW_YELLOW} Configure macOS Defaults? [y/n]: " +read REPLY -if [ "$REPLY" == "y" ]; then +if [[ "$REPLY" == "y" ]]; then echo "${ARROW} Configuring macOS Defaults..." echo -e "${NEW_LINE}${DIVIDER}" echo -e "${YELLOW}${BOLD}Note:$DEFAULT If you see errors like 'Could not write domain', temporarily give Full Disk Access (System Preferences > Security & Privacy)" @@ -410,4 +349,4 @@ fi echo -e "${NEW_LINE}${YELLOW}${BOLD}Note:$DEFAULT Some changes may need system restart to be applied!" echo -e "${NEW_LINE}${GREEN}${BOLD}Congratulations, installation complete!${DEFUALT}${NEW_LINE}" -exit 1 +exit 0 From 749b3ed6a0938373321f787c0489f32e1e74d31e Mon Sep 17 00:00:00 2001 From: Guillermo Guerini Date: Fri, 23 May 2025 12:35:28 -0400 Subject: [PATCH 61/61] Clean up mac-setup settings. --- Brewfile | 5 +- script/defaults.sh | 57 +------------- script/install.sh | 46 +++--------- spectacle.json | 74 ------------------- sublime-text/User/.gitignore | 8 -- .../User/Default (OSX).sublime-keymap | 4 - .../User/Package Control.sublime-settings | 16 ---- .../User/Preferences.sublime-settings | 21 ------ sublime-text/User/bindingpry.sublime-snippet | 10 --- 9 files changed, 16 insertions(+), 225 deletions(-) delete mode 100644 spectacle.json delete mode 100644 sublime-text/User/.gitignore delete mode 100644 sublime-text/User/Default (OSX).sublime-keymap delete mode 100644 sublime-text/User/Package Control.sublime-settings delete mode 100644 sublime-text/User/Preferences.sublime-settings delete mode 100644 sublime-text/User/bindingpry.sublime-snippet diff --git a/Brewfile b/Brewfile index 0b19392..cdfd361 100755 --- a/Brewfile +++ b/Brewfile @@ -5,6 +5,8 @@ cask "alfred" cask "android-file-transfer" cask "appcleaner" cask "calibre" +cask "chatgpt" +cask "cursor" cask "firefox" cask "github" cask "google-chrome" @@ -17,6 +19,7 @@ cask "postico" cask "rectangle" cask "sequel-pro" cask "slack" +cask "trainerroad" cask "transmission" cask "visual-studio-code" cask "vlc" @@ -26,6 +29,6 @@ cask "xbar" mas "Bumpr", id: 1166066070 mas "GIPHY", id: 668208984 mas "Things", id: 904280696 -mas "Wipr", id: 1320666476 +mas "Wipr 2", id: 1662217862 mas "Vinegar", id: 1591303229 mas "Xcode", id: 497799835 diff --git a/script/defaults.sh b/script/defaults.sh index 726ed45..dd11021 100755 --- a/script/defaults.sh +++ b/script/defaults.sh @@ -1,9 +1,5 @@ # Sets reasonable OS X defaults. -# -# Or, in other words, set shit how I like in OS X. -# -# The original idea (and a couple settings) were grabbed from: -# https://github.com/mathiasbynens/dotfiles/blob/master/.osx +# https://macos-defaults.com/ # # Run ./defaults.sh and you'll be good to go. @@ -21,15 +17,9 @@ defaults write com.apple.finder ShowStatusBar -bool true # Show path bar defaults write com.apple.finder ShowPathbar -bool true -# When performing a search, search the current folder by default -defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" - # Keep folders on top when sorting by name defaults write com.apple.finder _FXSortFoldersFirst -bool true -# Set 'home directory' as default, new window directory -defaults write com.apple.finder NewWindowTarget -string "PfHm" - # Disable showing tags defaults write com.apple.finder ShowRecentTags -int 0 @@ -48,9 +38,6 @@ defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true defaults write com.apple.finder ShowMountedServersOnDesktop -bool true defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true -# Finder: disable window animations and Get Info animations -defaults write com.apple.finder DisableAllAnimations -bool true - # Allow text selection in Quick Look defaults write com.apple.finder QLEnableTextSelection -bool true @@ -70,9 +57,6 @@ defaults write com.apple.Safari ShowFavoritesBar -bool true # Show the full URL in the address bar (note: this still hides the scheme) defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true -# Hide Safari’s sidebar in Top Sites -defaults write com.apple.Safari ShowSidebarInTopSites -bool false - # Enable Safari’s debug menu defaults write com.apple.Safari IncludeInternalDebugMenu -bool true @@ -105,9 +89,6 @@ defaults write com.apple.dock show-process-indicators -int 1 # Change minimize/maximize window effect defaults write com.apple.dock mineffect -string "scale" -# Disable double-click on window's title bar to minimize it -defaults write NSGlobalDomain AppleActionOnDoubleClick None - # Make Dock icons of hidden applications translucent defaults write com.apple.dock showhidden -bool true @@ -155,13 +136,6 @@ defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false # Disable smart quotes defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false -# Disable auto-correct -# defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false -# defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -int 0 - -# Disable automatic capitalization -# defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false - # Set a really fast key repeat defaults write NSGlobalDomain KeyRepeat -int 1 defaults write NSGlobalDomain InitialKeyRepeat -int 15 @@ -178,14 +152,7 @@ defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 defaults write NSGlobalDomain AppleInterfaceStyle Dark # Set appearance color to graphite -defaults write NSGlobalDomain AppleAquaColorVariant -int 6 - -# Set highlight color to graphite -defaults write NSGlobalDomain AppleHighlightColor -string "0.847059 0.847059 0.862745" - -# Only show scrollbars when scrolling -# Possible values: `WhenScrolling`, `Automatic` and `Always` -defaults write NSGlobalDomain AppleShowScrollBars -string "WhenScrolling" +defaults write -g AppleAccentColor -integer 4 ############################################################################### # Other stuff # @@ -202,39 +169,21 @@ defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true -# File save, save to disk by default rather than to iCloud -defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false - -# Disable opening and closing window animation -defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false - # Text, spell checker automatically identifies languages defaults write NSGlobalDomain NSSpellCheckerAutomaticallyIdentifiesLanguages -bool true # Use plain text mode for new TextEdit documents defaults write com.apple.TextEdit RichText -int 0 -# Reset icons order in Dashboard -defaults write com.apple.dock ResetLaunchPad -bool true - -# Show battery percentage in Menu Bar -# defaults write com.apple.menuextra.battery ShowPercent YES - -# Close windows then quitting an app -defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool true - # Ask to keep change when closing documents defaults write NSGlobalDomain NSCloseAlwaysConfirmsChanges -bool true # Set alert sound -defaults write NSGlobalDomain com.apple.sound.beep.sound -string "/System/Library/Sounds/Funk.aiff" +# defaults write NSGlobalDomain com.apple.sound.beep.sound -string "/System/Library/Sounds/Funk.aiff" # Play feedback when volume is changed defaults write NSGlobalDomain com.apple.sound.beep.feedback -int 1 -# Set date format in menubar -defaults write "com.apple.menuextra.clock" DateFormat -string "EEE MMM d h:mm a" - applications_to_kill=( "Activity Monitor" "Dock" diff --git a/script/install.sh b/script/install.sh index 71ea32b..3e3d04c 100755 --- a/script/install.sh +++ b/script/install.sh @@ -82,7 +82,7 @@ else if [[ "$REPLY" == "y" ]]; then echo "${ARROW} Installing Homebrew..." - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" IS_HOMEBREW_INSTALLED=true fi @@ -169,19 +169,6 @@ if $IS_HOMEBREW_INSTALLED; then fi fi -#---------------------------- -# rbenv & ruby-build -#---------------------------- - -if $IS_HOMEBREW_INSTALLED; then - echo -n "${ARROW_YELLOW} Install rbenv & ruby-build via Homebrew? [y/n]: " - read REPLY - - if [[ "$REPLY" == "y" ]]; then - echo "${ARROW} Installing rbenv & ruby-build..." - brew install rbenv ruby-build - fi -fi #---------------------------- # asdf & ruby-build @@ -286,21 +273,6 @@ if $IS_RECTANGLE_INSTALLED; then fi fi -#---------------------------- -# Firmware password -#---------------------------- - -if [[ $(sudo firmwarepasswd -check) =~ "Password Enabled: Yes" ]]; then - echo "${ARROW_GREEN} Firmware password is already set up!" -else - echo -n "${ARROW_YELLOW} Set up firmware password? [y/n]: " - read REPLY - - if [[ "$REPLY" == "y" ]]; then - sudo firmwarepasswd -setpasswd -setmode command - fi -fi - #---------------------------- # Computer name #---------------------------- @@ -309,25 +281,25 @@ echo -n "${ARROW_YELLOW} Set computer name? [y/n]: " read REPLY if [[ "$REPLY" == "y" ]]; then - echo -n "${ARROW_YELLOW} Please enter computer name: " uservar + echo -n "${ARROW_YELLOW} Please enter computer name: " read uservar - sudo scutil --set ComputerName $uservar - sudo scutil --set HostName $uservar - sudo scutil --set LocalHostName $uservar + sudo scutil --set ComputerName "$uservar" fi #---------------------------- -# Enable Mac Startup Chime +# Host name #---------------------------- -echo -n "${ARROW_YELLOW} Enable Mac Startup Chime? [y/n]: " +echo -n "${ARROW_YELLOW} Set host name? [y/n]: " read REPLY if [[ "$REPLY" == "y" ]]; then - echo "${ARROW} Enabling Mac Startup Chime..." + echo -n "${ARROW_YELLOW} Please enter host name (avoid special characters, space, etc.): " + read uservar - sudo nvram StartupMute=%00 + sudo scutil --set HostName "$uservar" + sudo scutil --set LocalHostName "$uservar" fi #---------------------------- diff --git a/spectacle.json b/spectacle.json deleted file mode 100644 index 0f9a24d..0000000 --- a/spectacle.json +++ /dev/null @@ -1,74 +0,0 @@ -[ - { - "shortcut_key_binding" : "ctrl+alt+left", - "shortcut_name" : "MoveToPreviousThird" - }, - { - "shortcut_key_binding" : null, - "shortcut_name" : "MakeSmaller" - }, - { - "shortcut_key_binding" : null, - "shortcut_name" : "RedoLastMove" - }, - { - "shortcut_key_binding" : null, - "shortcut_name" : "MoveToUpperRight" - }, - { - "shortcut_key_binding" : "alt+cmd+down", - "shortcut_name" : "MoveToBottomHalf" - }, - { - "shortcut_key_binding" : "ctrl+alt+cmd+right", - "shortcut_name" : "MoveToNextDisplay" - }, - { - "shortcut_key_binding" : "alt+cmd+up", - "shortcut_name" : "MoveToTopHalf" - }, - { - "shortcut_key_binding" : null, - "shortcut_name" : "MoveToLowerLeft" - }, - { - "shortcut_key_binding" : null, - "shortcut_name" : "MakeLarger" - }, - { - "shortcut_key_binding" : "ctrl+alt+cmd+left", - "shortcut_name" : "MoveToPreviousDisplay" - }, - { - "shortcut_key_binding" : null, - "shortcut_name" : "UndoLastMove" - }, - { - "shortcut_key_binding" : "alt+1", - "shortcut_name" : "MoveToFullscreen" - }, - { - "shortcut_key_binding" : "ctrl+alt+right", - "shortcut_name" : "MoveToNextThird" - }, - { - "shortcut_key_binding" : "alt+2", - "shortcut_name" : "MoveToLeftHalf" - }, - { - "shortcut_key_binding" : null, - "shortcut_name" : "MoveToCenter" - }, - { - "shortcut_key_binding" : "alt+3", - "shortcut_name" : "MoveToRightHalf" - }, - { - "shortcut_key_binding" : null, - "shortcut_name" : "MoveToLowerRight" - }, - { - "shortcut_key_binding" : null, - "shortcut_name" : "MoveToUpperLeft" - } -] \ No newline at end of file diff --git a/sublime-text/User/.gitignore b/sublime-text/User/.gitignore deleted file mode 100644 index 7fc03a9..0000000 --- a/sublime-text/User/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Package Control.cache/ -Package Control.merged-ca-bundle -Package Control.system-ca-bundle -Package Control.user-ca-bundle -Package Control.last-run -oscrypto-ca-bundle.crt -*.sublime-workspace -.SublimeREPLHistory diff --git a/sublime-text/User/Default (OSX).sublime-keymap b/sublime-text/User/Default (OSX).sublime-keymap deleted file mode 100644 index d9cc947..0000000 --- a/sublime-text/User/Default (OSX).sublime-keymap +++ /dev/null @@ -1,4 +0,0 @@ -[ - { "keys": ["super+t"], "command": "goto_definition" }, - { "keys": ["super+g"], "command": "jump_back" }, -] diff --git a/sublime-text/User/Package Control.sublime-settings b/sublime-text/User/Package Control.sublime-settings deleted file mode 100644 index c886961..0000000 --- a/sublime-text/User/Package Control.sublime-settings +++ /dev/null @@ -1,16 +0,0 @@ -{ - "bootstrapped": true, - "in_process_packages": - [ - ], - "installed_packages": - [ - "BracketHighlighter", - "Dracula Color Scheme", - "FileIcons", - "GitGutter", - "Package Control", - "SideBarEnhancements", - "SublimeLinter" - ] -} diff --git a/sublime-text/User/Preferences.sublime-settings b/sublime-text/User/Preferences.sublime-settings deleted file mode 100644 index e4d4d93..0000000 --- a/sublime-text/User/Preferences.sublime-settings +++ /dev/null @@ -1,21 +0,0 @@ -{ - "bold_folder_labels": true, - "color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme", - "font_options": - [ - "gray_antialias" - ], - "font_size": 12, - "highlight_line": true, - "highlight_modified_tabs": true, - "ignored_packages": - [ - "Vintage" - ], - "overlay_scroll_bars": "enabled", - "show_full_path": true, - "spell_check": true, - "tab_size": 2, - "theme": "Adaptive.sublime-theme", - "translate_tabs_to_spaces": true -} diff --git a/sublime-text/User/bindingpry.sublime-snippet b/sublime-text/User/bindingpry.sublime-snippet deleted file mode 100644 index 0234249..0000000 --- a/sublime-text/User/bindingpry.sublime-snippet +++ /dev/null @@ -1,10 +0,0 @@ - - - - bpry - - - Add binding.pry. -