Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
samueldosramos committed Apr 11, 2020
2 parents 905ef4a + 32344ed commit fcd73cd
Show file tree
Hide file tree
Showing 12 changed files with 186 additions and 109 deletions.
13 changes: 7 additions & 6 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Don't remove the quotation marks
# Git config file
# When edit, remove the < >

[user]
name = "Your name here"
email = Your e-mail here

name = <Your name here>
email = <Your e-mail here>
[github]
user = Your username here

user = <Your username here>
[credential]
helper = osxkeychain
[core]
editor = nano
excludesfile = ~/.gitignore_global
Expand Down
1 change: 1 addition & 0 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export PATH="/usr/local/opt/python/libexec/bin:$PATH"

# Ruby path
export PATH="/usr/local/opt/ruby/bin:$PATH"
export PATH="$(gem environment gemdir)/bin:$PATH"

# Support 256 colors path
export TERM="xterm-256color"
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Samuel Ramos
Copyright (c) 2020 Samuel Ramos

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
175 changes: 118 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,52 @@ This is a simple and flexible dotfiles and scripts to setup _macOS_.

## Table of Contents

1. [What are dotfiles](#what-are-dotfiles)
1. [Features](#features)
1. [Installation](#installation)
1. [Manual setup](#manual-setup)
1. [Screenshot](#screenshot)
1. [Resources](#resources)
1. [What are dotfiles][]
1. [Features][]
1. [Installation][]
1. [Manual setup][]
1. [Screenshot][]
1. [Resources][]

## What are dotfiles

Dotfiles are configuration files on Unix-based systems. At first they are just hidden configuration files of the system (that's why the reason for starting with `.`). However, we can use them to make it easier to configure our computers, with many advantages:

- Easy to format a new computer;
- Automation of tasks;
- Easy maintenance;
- Storage in remote locations (GitHub, Dropbox, etc);
- Versioning;
- Import to multiple computers;
- Customize the terminal.
- Easy to format a new computer
- Automation of tasks
- Easy maintenance
- Storage in remote locations (GitHub, Dropbox, etc)
- Versioning
- Import to multiple computers
- Customize the terminal

## Features

_Check linked files to more details._

### Installation files

- [apps.sh](install/apps.sh) - installs _Homebrew_, _Homebrew Cask Upgrade_ and some _apps_.
- [dock.sh](install/dock.sh) - macOS Dock items customization.
- [dotfiles.sh](install/dotfiles.sh) - _Oh My Zsh_ installer, _.zshrc_ and _git_ configs.
- [macos.sh](install/macos.sh) - macOS defaults configs.
- [npm.sh](install/npm.sh) - install _npm_ packages.
- [python.sh](install/python.sh) - install _Python_ packages.
- [setup.sh](install/setup.sh) - main installer.
- [util.sh](install/util.sh) - support functions for other installers.
- [apps.sh][] - installs _Homebrew_, _Homebrew Cask Upgrade_ and some _apps_.
- [dock.sh][] - macOS Dock items customization.
- [dotfiles.sh][] - _Oh My Zsh_ installer, _.zshrc_ and _git_ configs.
- [hostname.sh][] - change _hostname_ (MacBook name).
- [macos.sh][] - macOS defaults configs.
- [npm.sh][] - install _npm_ packages.
- [python.sh][] - install _Python_ packages.
- [setup.sh][] - main installer.
- [ssh.sh][] - generate _SSH_.
- [util.sh][] - support functions for other installers.

**Note:** _These files will be discarded later._

### Settings Files

- [.gitconfig](.gitconfig) - basic _git_ settings.
- [.gitignore_global](.gitignore_global) - global _gitignore_.
- [.zshrc](.zshrc) - terminal configs with aliases, paths, plugins and theme.
- [com.googlecode.iterm2.plist](com.googlecode.iterm2.plist) - [iTerm2](https://iterm2.com) settings.
- [.gitconfig][] - basic _git_ settings.
- [.gitignore_global][] - global _gitignore_.
- [.zshrc][] - terminal configs with aliases, paths, plugins and theme.
- [com.googlecode.iterm2.plist][] - [iTerm2][] settings.

**Note:** _These files are permanent._.
**Note:** _These files are permanent_.

## Installation

Expand All @@ -57,45 +59,46 @@ git clone https://github.com/samuelramox/dotfiles.git && cd dotfiles
./install/setup.sh
```

**Note:** You can also download a specific [release](https://github.com/samuelramox/dotfiles/releases).
**Note:** You can also download a specific [release][].

### Explaining the process

The [setup.sh](install/setup.sh) process will ask if you want to install the following scripts, in this order:
**Note:** I suggest you read these files and turn your preferences on/off before installation.
The [setup.sh][] process will ask if you want to install the following scripts, in this order:

- [apps.sh](install/apps.sh) - install _Homebrew_, _Homebrew Cask Upgrade_ and applications.
- [apps.sh][] - install _Homebrew_, _Homebrew Cask Upgrade_ and applications.
I suggest you comment apps that should not be installed and include those that are not listed. This script will install in the following order:

- Install [Homebrew](https://brew.sh/);
- Homebrew formulas: [Git](https://git-scm.com), [Nano](https://www.nano-editor.org), [Node](https://nodejs.org/), [nvm](https://github.com/nvm-sh/nvm), [Python](https://www.python.org), [Ruby](https://www.ruby-lang.org/), [Unrar](https://www.rarlab.com/), [Yarn](https://yarnpkg.com/), [Zsh](https://www.zsh.org);
- Homebrew taps: [homebrew/fonts](https://github.com/Homebrew/homebrew-cask-fonts), [homebrew/drivers](https://github.com/Homebrew/homebrew-cask-drivers), [homebrew/versions](https://github.com/Homebrew/homebrew-cask-versions), [homebrew/command-not-found](https://github.com/Homebrew/homebrew-command-not-found);
- Homebrew casks: [Google Chrome](https://www.google.com/chrome/), [IINA](https://iina.io/), [iTerm2](https://iterm2.com), [JetBrains Mono](https://jetbrains.com/mono), [Postman](https://www.postman.com), [qBittorrent](https://www.qbittorrent.org/) and [Visual Studio Code](https://code.visualstudio.com);
- Install [Homebrew Cask Upgrade](https://github.com/buo/homebrew-cask-upgrade);

- [dotfiles.sh](install/dotfiles.sh) - install [Oh My Zsh](https://ohmyz.sh), some Zsh plugins, [Spaceship ZSH](https://denysdovhan.com/spaceship-prompt/) theme and set _iTerm2_ preferences. This step also opens [gitconfig](.gitconfig) so that the user can put his data.
- [npm.sh](install/npm.sh) - install some npm packages.
- [python.sh](install/python.sh) - install some Python packages.
- [macos.sh](install/macos.sh) - set custom macOS preferences.
- [dock.sh](install/dock.sh) - install [dockutil](https://github.com/kcrawford/dockutil) and set custom permanent apps in Dock. _Finder_ and _Recycle Bin_ are already permanent (unless you change this).
- Install [Homebrew][].
- Homebrew formulas: [curl][], [Git][], [iTermocil][], [Nano][], [Node][], [nvm][], [postgresql][], [Python][], [Ruby][], [tree][], [Unrar][], [Yarn][], [Zsh][].
- Homebrew taps: [homebrew/fonts][], [homebrew/drivers][], [homebrew/versions][], [homebrew/command-not-found][].
- Homebrew casks: [Google Chrome][], [IINA][], [iTerm2][], [JetBrains Mono][], [Postman][], [qBittorrent][] and [Visual Studio Code][].
- Install [Homebrew Cask Upgrade][].

- [dotfiles.sh][] - install [Oh My Zsh][], some Zsh plugins, [Spaceship ZSH][] theme and set _iTerm2_ preferences (including [Dracula Theme][]). This step also opens [.gitconfig][] so that the user can put his data.
- [npm.sh][] - install some npm packages.
- [python.sh][] - install some Python packages.
- [macos.sh][] - set custom macOS preferences.
- [dock.sh][] - install [dockutil][] and set custom permanent apps in Dock. _Finder_ and _Recycle Bin_ are already permanent (unless you change this).
- Generate _SSH_.
- Update _hostname_ (MacBook name).
- Create a directory called _Developer_ in _Home_ directory for projects and development.
- Cleanup cached downloads and remove the installation zip and folder.

**Note:** I suggest you read these files and turn your preferences on/off before installation.

## Manual setup

[iTerm2](https://iterm2.com) settings are changed by [dotfiles.sh](install/dotfiles.sh) and it will look the same as [screenshot](#screenshot), but you can change them manually if you prefer. My [Visual Studio Code](https://code.visualstudio.com) settings are loaded by the [Settings Sync](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync) extension, so you will have to change manually or load your settings.
[iTerm2][] settings are changed by [dotfiles.sh][] and it will look the same as [screenshot][], but you can change them manually if you prefer. My [Visual Studio Code][] settings are loaded by the [Settings Sync][] extension, so you will have to change manually or load your settings.

### iTerm2 - Change the color theme

You can use the default theme or switch to your preferred theme. I use [Dracula](https://draculatheme.com) theme.
You can use the default theme or switch to your preferred theme. I use [Dracula Theme][].

`iTerm2 → Preferences → Profiles → Colors → Color presets`

### iTerm2 - Change font

You can use the default font or switch to your preferred font. I use [JetBrains Mono](https://jetbrains.com/mono) with 13px.
You can use the default font or switch to your preferred font. I use [JetBrains Mono][] with 13px.

`iTerm2 → Preferences → Profiles → Text → Change Font`

Expand All @@ -119,7 +122,7 @@ By default, word jumps (`option` + `→` or `←`) and word deletions (`option`

### Visual Studio Code - Configurable External Terminal

If you are using [iTerm2](https://iterm2.com) as a default terminal, you need to configure this in [Visual Studio Code](https://code.visualstudio.com).
If you are using [iTerm2][] as a default terminal, you need to configure this in [Visual Studio Code][].

`Code → Preference → Settings (or CMD + ,) and add or edit the following values:`

Expand All @@ -129,19 +132,77 @@ If you are using [iTerm2](https://iterm2.com) as a default terminal, you need to

## Screenshot

Default installation (can be configured):
Default install (can be configured):

![macOS print](./images/macOS.png)
![macOS screenshot][]

## Resources

- [Dotfiles Repositories](https://dotfiles.github.io/)
- [Awesome Dotfiles](https://github.com/webpro/awesome-dotfiles)
- [Homebrew](https://brew.sh/)
- [Homebrew Cask Upgrade](https://github.com/buo/homebrew-cask-upgrade)
- [Dockutil](https://github.com/kcrawford/dockutil)
- [Sensible macOS defaults](https://github.com/mathiasbynens/dotfiles/blob/master/.macos)
- [Awesome OSX Command Line](https://github.com/herrbischoff/awesome-osx-command-line)
- [Oh My Zsh](https://github.com/robbyrussell/oh-my-zsh)
- [Spaceship ZSH](https://denysdovhan.com/spaceship-prompt/)
- [Dracula Theme](https://draculatheme.com)
- [Dotfiles Repositories][]
- [Awesome Dotfiles][]
- [Homebrew][]
- [Homebrew Cask Upgrade][]
- [Dockutil][]
- [Sensible macOS defaults][]
- [Awesome OSX Command Line][]
- [Oh My Zsh][]
- [Spaceship ZSH][]
- [Dracula Theme][]

[.gitconfig]: .gitconfig
[.gitignore_global]: .gitignore_global
[.zshrc]: .zshrc
[apps.sh]: install/apps.sh
[awesome dotfiles]: https://github.com/webpro/awesome-dotfiles
[awesome osx command line]: https://github.com/herrbischoff/awesome-osx-command-line
[com.googlecode.iterm2.plist]: com.googlecode.iterm2.plist
[curl]: https://curl.haxx.se
[dock.sh]: install/dock.sh
[dockutil]: https://github.com/kcrawford/dockutil
[dotfiles.sh]: install/dotfiles.sh
[dotfiles repositories]: https://dotfiles.github.io/
[dracula theme]: https://draculatheme.com
[features]: #features
[git]: https://git-scm.com
[google chrome]: https://www.google.com/chrome/
[homebrew]: https://brew.sh/
[homebrew cask upgrade]: https://github.com/buo/homebrew-cask-upgrade
[homebrew/command-not-found]: https://github.com/Homebrew/homebrew-command-not-found
[homebrew/drivers]: https://github.com/Homebrew/homebrew-cask-drivers
[homebrew/fonts]: https://github.com/Homebrew/homebrew-cask-fonts
[homebrew/versions]: https://github.com/Homebrew/homebrew-cask-versions
[hostname.sh]: install/hostname.sh
[iina]: https://iina.io/
[installation]: #installation
[iterm2]: https://iterm2.com
[itermocil]: https://github.com/TomAnthony/itermocil
[jetbrains mono]: https://jetbrains.com/mono
[macos screenshot]: ./images/macOS.jpg 'macOS screenshot with default install'
[macos.sh]: install/macos.sh
[manual setup]: #manual-setup
[nano]: https://www.nano-editor.org
[node]: https://nodejs.org/
[npm.sh]: install/npm.sh
[nvm]: https://github.com/nvm-sh/nvm
[oh my zsh]: https://ohmyz.sh
[postgresql]: https://www.postgresql.org
[postman]: https://www.postman.com
[python.sh]: install/python.sh
[python]: https://www.python.org
[qbittorrent]: https://www.qbittorrent.org/
[release]: https://github.com/samuelramox/dotfiles/releases
[resources]: #resources
[ruby]: https://www.ruby-lang.org/
[screenshot]: #screenshot
[sensible macos defaults]: https://github.com/mathiasbynens/dotfiles/blob/master/.macos
[settings sync]: https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync
[setup.sh]: install/setup.sh
[spaceship zsh]: https://denysdovhan.com/spaceship-prompt/
[ssh.sh]: install/ssh.sh
[tree]: http://mama.indstate.edu/users/ice/tree/
[unrar]: https://www.rarlab.com/
[util.sh]: install/util.sh
[visual studio code]: https://code.visualstudio.com
[what are dotfiles]: #what-are-dotfiles
[yarn]: https://yarnpkg.com/
[zsh]: https://www.zsh.org
Binary file added images/macOS.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/macOS.png
Binary file not shown.
2 changes: 2 additions & 0 deletions install/apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ brew install nvm
brew install postgresql
brew install python
brew install ruby
brew install tree
brew install unrar
brew install yarn
brew install zsh
brew install TomAnthony/brews/itermocil

# Install Homebrew casks
brew cask install font-jetbrains-mono
Expand Down
14 changes: 14 additions & 0 deletions install/hostname.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
#
# Hostname settings

source ./install/utils.sh

ask "Please provide an hostname (MacBook name): " && printf "\n"
sudo scutil --set ComputerName "$REPLY"
sudo scutil --set LocalHostName "$REPLY"
sudo scutil --set HostName "$REPLY"
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$REPLY"

# Finish
e_success "Hostname is updated."
49 changes: 24 additions & 25 deletions install/macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ defaults write com.apple.screensaver askForPasswordDelay -int 0
# Save screenshots to the Pictures folder
defaults write com.apple.screencapture location ~/Pictures

# Change the default screenshots name to English
defaults write com.apple.screencapture name "Screenshot"

###############################################################################
# Finder
###############################################################################

# Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
defaults write com.apple.finder QuitMenuItem -bool true

# Finder: disable window animations and Get Info animations
defaults write com.apple.finder DisableAllAnimations -bool true

# Set default location for new Finder windows
# For other Desktop, use `PfDe` and `file://${HOME}/Desktop/`
# For other paths, use `PfLo` and `file:///full/path/here/`
Expand Down Expand Up @@ -155,48 +155,47 @@ defaults write com.apple.dock mru-spaces -bool false
# Safari & WebKit
###############################################################################

# Privacy: don’t send search queries to Apple
defaults write com.apple.Safari UniversalSearchEnabled -bool false
defaults write com.apple.Safari SuppressSearchSuggestions -bool true

# Press Tab to highlight each item on a web page
defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true
# Set home page to `about:blank` for faster loading
defaults write com.apple.Safari HomePage -string 'about:blank'

# Prevent Safari from opening ‘safe’ files automatically after downloading
defaults write com.apple.Safari AutoOpenSafeDownloads -bool false

# Hide Safari’s bookmarks bar by default
defaults write com.apple.Safari ShowFavoritesBar -bool false

# Hide Safari’s sidebar in Top Sites
defaults write com.apple.Safari ShowSidebarInTopSites -bool false
# Include search engine suggestions
defaults write com.apple.Safari SuppressSearchSuggestions -bool true

# Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Include Spotlight Suggestions
defaults write com.apple.Safari UniversalSearchEnabled -bool true

# Make Safari’s search banners default to Contains instead of Starts With
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
# Warn about fraudulent websites
defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true

# Remove useless icons from Safari’s bookmarks bar
defaults write com.apple.Safari ProxiesInBookmarksBar "()"
# Press Tab to highlight each item on a web page
defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true

# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true

# Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true

# Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

# Enable continuous spellchecking
defaults write com.apple.Safari WebContinuousSpellCheckingEnabled -bool true

# Warn about fraudulent websites
defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true
# Hide Safari’s sidebar in Top Sites
defaults write com.apple.Safari ShowSidebarInTopSites -bool false

# Make Safari’s search banners default to Contains instead of Starts With
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false

# Update extensions automatically
defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
# Remove useless icons from Safari’s bookmarks bar
defaults write com.apple.Safari ProxiesInBookmarksBar "()"

###############################################################################
# Terminal & iTerm 2
Expand Down
Loading

0 comments on commit fcd73cd

Please sign in to comment.