├── src ├── zsh │ ├── .hushlogin │ ├── .zlogout │ ├── starship.toml │ ├── .zshenv │ ├── .zlogin │ ├── .zprofile │ ├── .zpreztorc │ └── .zshrc ├── bin │ ├── +x │ ├── brew_init │ ├── mit │ └── backup ├── espanso │ ├── match │ │ ├── images.yml │ │ ├── ascii.yml │ │ ├── typos.yml │ │ ├── code.yml │ │ ├── base.yml │ │ ├── abbreviations.yml │ │ ├── symbols.yml │ │ └── misc.yml │ └── config │ │ └── default.yml ├── git │ ├── allowed_signers │ └── .gitconfig ├── configure │ ├── packer.nvim │ ├── prezto │ └── configure.yaml ├── borg │ ├── .backupignore │ └── local.backup.plist ├── install │ ├── homebrew.sh │ ├── xcode.sh │ ├── casks.sh │ ├── formulas.sh │ └── settings.sh ├── tig │ └── config ├── wget │ └── .wgetrc ├── ghostty │ └── config └── nvim │ └── init.lua ├── .gitignore ├── .gitmodules ├── install ├── .vscode └── settings.json ├── configure ├── LICENSE.md └── README.md /src/zsh/.hushlogin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /src/bin/+x: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exec chmod +x "$@" 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule ".dotbot"] 2 | ignore = dirty 3 | path = .dotbot 4 | url = https://github.com/anishathalye/dotbot 5 | -------------------------------------------------------------------------------- /src/zsh/.zlogout: -------------------------------------------------------------------------------- 1 | # 2 | # Executes commands at logout. 3 | # 4 | # Authors: 5 | # Sorin Ionescu 6 | # 7 | -------------------------------------------------------------------------------- /src/espanso/match/images.yml: -------------------------------------------------------------------------------- 1 | matches: 2 | - trigger: "'bleedingeyes" 3 | replace: "http://i.imgur.com/MlI5NtG.gifv" 4 | word: true 5 | -------------------------------------------------------------------------------- /src/git/allowed_signers: -------------------------------------------------------------------------------- 1 | 494699+HiDeoo@users.noreply.github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGVI/tlnHsyRkQ8/2zZAGk9zni7dTOS2VC3Xw1Pht9g3 2 | -------------------------------------------------------------------------------- /src/zsh/starship.toml: -------------------------------------------------------------------------------- 1 | "$schema" = 'https://starship.rs/config-schema.json' 2 | 3 | command_timeout=1000 4 | 5 | [battery] 6 | disabled=true 7 | 8 | [package] 9 | display_private=true 10 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | INSTALL_DIR="src/install" 6 | 7 | cd "${INSTALL_DIR}" 8 | 9 | sh xcode.sh 10 | sh homebrew.sh 11 | sh formulas.sh 12 | sh casks.sh 13 | sh settings.sh 14 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "**/src/ghostty/config": "properties", 4 | "**/src/wget/.wgetrc": "properties", 5 | "**/src/zsh/*": "shellscript" 6 | }, 7 | "files.exclude": { 8 | ".dotbot": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/espanso/match/ascii.yml: -------------------------------------------------------------------------------- 1 | matches: 2 | - trigger: "'shrug" 3 | replace: "¯\\_(ツ)_/¯" 4 | word: true 5 | - trigger: "'flip" 6 | replace: "(╯°□°)╯︵ ┻━┻" 7 | word: true 8 | - trigger: "'unflip" 9 | replace: "┬─┬ ノ( ゜-゜ノ)" 10 | word: true 11 | -------------------------------------------------------------------------------- /src/bin/brew_init: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if type /usr/local/bin/brew > /dev/null 2>&1; then 4 | eval $(/usr/local/bin/brew shellenv) 5 | fi 6 | 7 | if [ "`arch`" = "arm64" ] && type /opt/homebrew/bin/brew > /dev/null 2>&1; then 8 | eval $(/opt/homebrew/bin/brew shellenv) 9 | fi 10 | -------------------------------------------------------------------------------- /src/espanso/config/default.yml: -------------------------------------------------------------------------------- 1 | # Disable the toggle key. 2 | toggle_key: OFF 3 | 4 | # Disable the search bar. 5 | search_shortcut: off 6 | 7 | # Disable the menu bar icon. 8 | show_icon: false 9 | 10 | # Prevent backspace from undoing the last expansion. 11 | undo_backspace: false 12 | -------------------------------------------------------------------------------- /src/configure/packer.nvim: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | INSTALL_FILE="${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/packer/start/packer.nvim 6 | 7 | if [ -d $INSTALL_FILE ]; then 8 | exit 0 9 | fi 10 | 11 | git clone https://github.com/wbthomason/packer.nvim $INSTALL_FILE 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /src/espanso/match/typos.yml: -------------------------------------------------------------------------------- 1 | matches: 2 | - trigger: "explicitely" 3 | replace: "explicitly" 4 | propagate_case: true 5 | word: true 6 | - trigger: "ha" 7 | replace: "ah" 8 | propagate_case: true 9 | word: true 10 | - trigger: "ho" 11 | replace: "oh" 12 | propagate_case: true 13 | word: true 14 | -------------------------------------------------------------------------------- /src/zsh/.zshenv: -------------------------------------------------------------------------------- 1 | # 2 | # Defines environment variables. 3 | # 4 | # Authors: 5 | # Sorin Ionescu 6 | # 7 | 8 | # Ensure that a non-login, non-interactive shell has a defined environment. 9 | if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then 10 | source "${ZDOTDIR:-$HOME}/.zprofile" 11 | fi 12 | -------------------------------------------------------------------------------- /configure: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | CONFIG="src/configure/configure.yaml" 6 | DOTBOT_DIR=".dotbot" 7 | 8 | DOTBOT_BIN="bin/dotbot" 9 | BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 10 | 11 | cd "${BASEDIR}" 12 | git submodule update --init --recursive "${DOTBOT_DIR}" 13 | 14 | "${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}" 15 | -------------------------------------------------------------------------------- /src/borg/.backupignore: -------------------------------------------------------------------------------- 1 | # Borg backups exclude patterns using Fnmatch-style patterns. 2 | # See https://borgbackup.readthedocs.io/en/stable/usage/help.html?highlight=pattern#borg-help-patterns 3 | 4 | */.git 5 | */.gitmodules 6 | */.DS_Store 7 | */node_modules 8 | */.localized 9 | */Icon? 10 | 11 | */.dotbot 12 | 13 | /Users/hideo/.config/borg 14 | /Users/hideo/.config/yarn 15 | 16 | /Users/hideo/Movies/TV 17 | -------------------------------------------------------------------------------- /src/espanso/match/code.yml: -------------------------------------------------------------------------------- 1 | matches: 2 | - trigger: "'mref" 3 | replace: "[reference]({{clipboard}})" 4 | word: true 5 | vars: 6 | - name: "clipboard" 7 | type: "clipboard" 8 | - trigger: "'mlink" 9 | replace: "[$|$]({{clipboard}})" 10 | word: true 11 | vars: 12 | - name: "clipboard" 13 | type: "clipboard" 14 | - trigger: "'skipci" 15 | replace: "[skip ci]" 16 | word: true 17 | -------------------------------------------------------------------------------- /src/install/homebrew.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if test ! $(which brew) 4 | then 5 | if test "$(uname)" = "Darwin" 6 | then 7 | echo "Installing Homebrew." 8 | 9 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 10 | else 11 | echo "Invalid OS." 12 | exit 1 13 | fi 14 | else 15 | echo "Homebrew is already installed." 16 | fi 17 | 18 | source ../bin/brew_init 19 | 20 | exit 0 21 | -------------------------------------------------------------------------------- /src/install/xcode.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! xcode-select --print-path &> /dev/null; then 4 | echo "Installing XCode Command Line Tools." 5 | 6 | xcode-select --install &> /dev/null 7 | 8 | until xcode-select --print-path &> /dev/null; do 9 | sleep 5 10 | done 11 | 12 | [ $? -eq 0 ] || exit $?; 13 | 14 | sudo xcodebuild -license 15 | 16 | [ $? -eq 0 ] || exit $?; 17 | else 18 | echo "XCode Command Line Tools are already installed." 19 | fi 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/espanso/match/base.yml: -------------------------------------------------------------------------------- 1 | matches: 2 | - trigger: "'date" 3 | replace: "{{date}}" 4 | word: true 5 | vars: 6 | - name: date 7 | type: date 8 | params: 9 | format: "%m/%d/%Y" 10 | - trigger: "'ddate" 11 | replace: "{{day}} {{date}}" 12 | word: true 13 | vars: 14 | - name: day 15 | type: date 16 | params: 17 | format: "%a" 18 | - name: date 19 | type: match 20 | params: 21 | trigger: "'date" 22 | -------------------------------------------------------------------------------- /src/zsh/.zlogin: -------------------------------------------------------------------------------- 1 | # 2 | # Executes commands at login post-zshrc. 3 | # 4 | # Authors: 5 | # Sorin Ionescu 6 | # 7 | 8 | # Execute code that does not affect the current session in the background. 9 | { 10 | # Compile the completion dump to increase startup speed. 11 | zcompdump="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompdump" 12 | if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then 13 | zcompile "$zcompdump" 14 | fi 15 | } &! 16 | -------------------------------------------------------------------------------- /src/configure/prezto: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | set -e 4 | 5 | PREZTO_DIR=".zprezto" 6 | 7 | if [ -d "${ZDOTDIR:-$HOME}/${PREZTO_DIR}" ]; then 8 | exit 0 9 | fi 10 | 11 | git clone --recursive https://github.com/sorin-ionescu/prezto "${ZDOTDIR:-$HOME}/${PREZTO_DIR}" 12 | 13 | setopt EXTENDED_GLOB 14 | 15 | for rcfile in "${ZDOTDIR:-$HOME}"/${PREZTO_DIR}/runcoms/^README.md(.N); do 16 | ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" 17 | done 18 | 19 | sudo dscl . -create /Users/$USER UserShell $(brew --prefix)/bin/zsh 20 | -------------------------------------------------------------------------------- /src/tig/config: -------------------------------------------------------------------------------- 1 | set diff-highlight = true 2 | set ignore-case = smart-case 3 | set main-view = date:custom,format="%Y-%m-%d %H:%M" id:true date:relative author:full,width=20 commit-title:graph=v2,refs=true 4 | set tab-size = 2 5 | 6 | bind generic [1;5A previous 7 | bind generic [1;5B next 8 | bind main enter 9 | bind diff view-main 10 | bind diff scroll-line-up 11 | bind diff scroll-line-down 12 | 13 | color author cyan default 14 | color cursor green green 15 | color date blue default 16 | color id yellow default 17 | color title-blur green default 18 | color title-focus green default 19 | -------------------------------------------------------------------------------- /src/borg/local.backup.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | local.backup 7 | Program 8 | /usr/local/bin/backup 9 | StandardErrorPath 10 | /Users/hideo/Library/Logs/local.backup.log 11 | StartCalendarInterval 12 | 13 | Hour 14 | 4 15 | Minute 16 | 0 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/install/casks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | apps=( 4 | alt-tab 5 | calibre 6 | discord 7 | dropbox 8 | espanso 9 | fantastical 10 | figma 11 | firefox 12 | ghostty 13 | google-chrome 14 | gpg-suite-no-mail 15 | httpie 16 | iina 17 | imageoptim 18 | macupdater 19 | orbstack 20 | raycast 21 | sf-symbols 22 | shottr 23 | stats 24 | the-unarchiver 25 | visual-studio-code 26 | ) 27 | 28 | echo "Installing Casks." 29 | 30 | brew tap homebrew/cask-versions 31 | brew tap homebrew/cask-fonts 32 | 33 | brew install --cask "${apps[@]}" 34 | 35 | echo "Installing Quick Look plugins." 36 | 37 | brew install --cask syntax-highlight sbarex-qlmarkdown qlvideo 38 | 39 | xattr -r -d com.apple.quarantine "/Applications/Syntax Highlight.app" 40 | 41 | exit 0 42 | -------------------------------------------------------------------------------- /src/install/formulas.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "Installing Formulas" 4 | 5 | apps=( 6 | bat 7 | borgbackup 8 | bun 9 | cloudflared 10 | coreutils 11 | doggo 12 | eza 13 | fd 14 | fnm 15 | fzf 16 | gh 17 | git 18 | git-delta 19 | git-extras 20 | go 21 | grep 22 | htop 23 | hyperfine 24 | jq 25 | neovim 26 | prettyping 27 | ripgrep 28 | starship 29 | staticcheck 30 | trash 31 | wget 32 | zsh 33 | ) 34 | 35 | brew tap espanso/espanso 36 | brew tap oven-sh/bun 37 | 38 | brew install "${apps[@]}" 39 | 40 | brew cleanup 41 | 42 | echo "Installing fzf key bindings." 43 | 44 | $(brew --prefix)/opt/fzf/install 45 | 46 | echo "Installing GitHub CLI extensions." 47 | 48 | $(brew --prefix)/opt/gh/bin/gh extension install seachicken/gh-poi 49 | 50 | exit 0 51 | -------------------------------------------------------------------------------- /src/wget/.wgetrc: -------------------------------------------------------------------------------- 1 | # Use the server-provided last modification date, if available. 2 | timestamping = on 3 | 4 | # Do not go up in the directory structure when downloading recursively. 5 | no_parent = on 6 | 7 | # Retry a few times when a download fails, but don’t overdo it. (The default is 20!). 8 | tries = 3 9 | 10 | # Retry even when the connection was refused. 11 | retry_connrefused = on 12 | 13 | # Use the last component of a redirection URL for the local file name. 14 | trust_server_names = on 15 | 16 | # Follow FTP links from HTML documents by default. 17 | follow_ftp = on 18 | 19 | # Add a `.html` extension to `text/html` or `application/xhtml+xml` files that lack one, or a `.css` extension to 20 | # `text/css` files that lack one. 21 | adjust_extension = on 22 | 23 | # Ignore `robots.txt` and ``. 24 | robots = off 25 | 26 | # Print the HTTP and FTP server responses. 27 | server_response = on 28 | -------------------------------------------------------------------------------- /src/espanso/match/abbreviations.yml: -------------------------------------------------------------------------------- 1 | matches: 2 | - trigger: "'gh" 3 | replace: "GitHub" 4 | word: true 5 | - trigger: "'vsc" 6 | replace: "Visual Studio Code" 7 | word: true 8 | - trigger: "'i18n" 9 | replace: "internationalization" 10 | propagate_case: true 11 | word: true 12 | - trigger: "'a11y" 13 | replace: "accessibility" 14 | propagate_case: true 15 | word: true 16 | - trigger: "'dep" 17 | replace: "dependency" 18 | propagate_case: true 19 | word: true 20 | - trigger: "'deps" 21 | replace: "dependencies" 22 | propagate_case: true 23 | word: true 24 | - trigger: "'misc" 25 | replace: "miscellaneous" 26 | propagate_case: true 27 | word: true 28 | - trigger: "'repo" 29 | replace: "repository" 30 | propagate_case: true 31 | word: true 32 | - trigger: "'repos" 33 | replace: "repositories" 34 | propagate_case: true 35 | word: true 36 | -------------------------------------------------------------------------------- /src/espanso/match/symbols.yml: -------------------------------------------------------------------------------- 1 | matches: 2 | - trigger: "'em" 3 | replace: "—" 4 | word: true 5 | - trigger: "'t" 6 | replace: "↑" 7 | word: true 8 | - trigger: "'r" 9 | replace: "→" 10 | word: true 11 | - trigger: "'b" 12 | replace: "↓" 13 | word: true 14 | - trigger: "'l" 15 | replace: "←" 16 | word: true 17 | - trigger: "'tm" 18 | replace: "™" 19 | word: true 20 | - trigger: "'copy" 21 | replace: "©" 22 | word: true 23 | - trigger: "'command" 24 | replace: "⌘" 25 | word: true 26 | - trigger: "'option" 27 | replace: "⌥" 28 | word: true 29 | - trigger: "'ctrl" 30 | replace: "⌃" 31 | word: true 32 | - trigger: "'shift" 33 | replace: "⇧" 34 | word: true 35 | - trigger: "'12" 36 | replace: "½" 37 | word: true 38 | - trigger: "'14" 39 | replace: "¼" 40 | word: true 41 | - trigger: "'sq" 42 | replace: "²" 43 | word: true 44 | - trigger: "'deg" 45 | replace: "°" 46 | word: true 47 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017-present, HiDeoo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /src/ghostty/config: -------------------------------------------------------------------------------- 1 | confirm-close-surface = false 2 | font-family = "PragmataProMono Nerd Font" 3 | macos-titlebar-style = tabs 4 | minimum-contrast = 1.1 5 | quit-after-last-window-closed = true 6 | window-inherit-working-directory = false 7 | window-new-tab-position = end 8 | window-padding-x = 10 9 | window-padding-y = 2 10 | window-position-x = 486 11 | window-position-y = 108 12 | window-width = 238 13 | window-height = 75 14 | 15 | keybind = cmd+shift+left=previous_tab 16 | keybind = cmd+shift+right=next_tab 17 | keybind = cmd+shift+up=jump_to_prompt:-1 18 | keybind = cmd+shift+down=jump_to_prompt:1 19 | 20 | # Vitesse Dark theme (https://github.com/HiDeoo/iTerm2-theme-vitesse) 21 | palette = 0=#393a34 22 | palette = 1=#cb7676 23 | palette = 2=#4d9375 24 | palette = 3=#e6cc77 25 | palette = 4=#6394bf 26 | palette = 5=#d9739f 27 | palette = 6=#5eaab5 28 | palette = 7=#dbd7ca 29 | palette = 8=#777777 30 | palette = 9=#cb7676 31 | palette = 10=#4d9375 32 | palette = 11=#e6cc77 33 | palette = 12=#6394bf 34 | palette = 13=#d9739f 35 | palette = 14=#5eaab5 36 | palette = 15=#ffffff 37 | background = #121212 38 | foreground = #dbd7ca 39 | cursor-color = #dbd7ca 40 | selection-background = #4d9375 41 | selection-foreground = #121212 42 | unfocused-split-fill = #424242 43 | -------------------------------------------------------------------------------- /src/zsh/.zprofile: -------------------------------------------------------------------------------- 1 | # 2 | # Executes commands at login pre-zshrc. 3 | # 4 | # Authors: 5 | # Sorin Ionescu 6 | # 7 | 8 | # 9 | # Browser 10 | # 11 | 12 | if [[ "$OSTYPE" == darwin* ]]; then 13 | export BROWSER='open' 14 | fi 15 | 16 | # 17 | # Editors 18 | # 19 | 20 | export EDITOR='nvim' 21 | export VISUAL='code' 22 | export PAGER='less' 23 | 24 | # 25 | # Language 26 | # 27 | 28 | if [[ -z "$LANG" ]]; then 29 | export LANG='en_US.UTF-8' 30 | fi 31 | 32 | # 33 | # Paths 34 | # 35 | 36 | # Ensure path arrays do not contain duplicates. 37 | typeset -gU cdpath fpath mailpath path 38 | 39 | # Set the list of directories that Zsh searches for programs. 40 | path=( 41 | /usr/local/{bin,sbin} 42 | $path 43 | ) 44 | 45 | # 46 | # Less 47 | # 48 | 49 | # Set the default Less options. 50 | # Mouse-wheel scrolling has been disabled by -X (disable screen clearing). 51 | # Remove -X and -F (exit if the content fits on one screen) to enable it. 52 | export LESS='-F -g -i -M -R -S -w -X -z-4' 53 | 54 | # Set the Less input preprocessor. 55 | # Try both `lesspipe` and `lesspipe.sh` as either might exist on a system. 56 | if (( $#commands[(i)lesspipe(|.sh)] )); then 57 | export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" 58 | fi 59 | 60 | # Added by OrbStack: command-line tools and integration 61 | source ~/.orbstack/shell/init.zsh 2>/dev/null || : 62 | -------------------------------------------------------------------------------- /src/bin/mit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | NAME="HiDeoo" 4 | 5 | usage() { 6 | echo "usage: $(basename "$0")" 7 | exit 1 8 | } 9 | 10 | mit() { 11 | printf "MIT License 12 | 13 | Copyright (c) $(date +"%Y")-present, $NAME 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy 16 | of this software and associated documentation files (the \"Software\"), to deal 17 | in the Software without restriction, including without limitation the rights 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | copies of the Software, and to permit persons to whom the Software is 20 | furnished to do so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE." 32 | } 33 | 34 | write() { 35 | "$1" > LICENSE 36 | } 37 | 38 | if [ $# -ne 0 ]; then 39 | usage 40 | fi 41 | 42 | write mit 43 | -------------------------------------------------------------------------------- /src/espanso/match/misc.yml: -------------------------------------------------------------------------------- 1 | matches: 2 | - trigger: "'stfirst" 3 | replace: | 4 | :starlight: **FIRST-TIME CONTRIBUTOR ALERT** :starlight: 5 | Welcome to the Starlight contributors, USERNAME ! PUN :lunaria_party: 6 | - trigger: "'stpr" 7 | replace: | 8 | #### Description 9 | 10 | 11 | 12 | 13 | 14 | - Closes # 15 | 16 | - trigger: "'docspr" 17 | replace: | 18 | #### Description 19 | 20 | $|$ 21 | 22 | #### Related issues & labels 23 | 24 | - Closes # 25 | - Suggested label: 26 | 27 | - trigger: "'aspr" 28 | replace: | 29 | ## Changes 30 | 31 | $|$ 32 | 33 | ## Testing 34 | 35 | 36 | 37 | ## Docs 38 | 39 | 40 | 41 | 42 | 43 | - trigger: "'i18nok" 44 | replace: | 45 | Thanks for the translation :raised_hands: 46 | 47 | As a non-native speaker, I reviewed this PR using the [Docs Translation Review Checklist](https://contribute.docs.astro.build/reviewers/reviewing-translations/) and everything looks good to me 👍 48 | -------------------------------------------------------------------------------- /src/zsh/.zpreztorc: -------------------------------------------------------------------------------- 1 | # 2 | # Sets Prezto options. 3 | # 4 | # Authors: 5 | # Sorin Ionescu 6 | # 7 | 8 | # 9 | # General 10 | # 11 | 12 | # Color output (auto set to 'no' on dumb terminals). 13 | zstyle ':prezto:*:*' color 'yes' 14 | 15 | # Set the Prezto modules to load (browse modules). 16 | # The order matters. 17 | zstyle ':prezto:load' pmodule \ 18 | 'environment' \ 19 | 'terminal' \ 20 | 'editor' \ 21 | 'history' \ 22 | 'directory' \ 23 | 'spectrum' \ 24 | 'utility' \ 25 | 'completion' \ 26 | 'fasd' \ 27 | 'git' \ 28 | 'archive' \ 29 | 'osx' \ 30 | 'rsync' \ 31 | 'syntax-highlighting' \ 32 | 'history-substring-search' \ 33 | 'autosuggestions' \ 34 | 'prompt' 35 | 36 | # 37 | # Terminal 38 | # 39 | 40 | # Auto set the tab and window titles. 41 | zstyle ':prezto:module:terminal' auto-title 'yes' 42 | 43 | # Set the window title format. 44 | zstyle ':prezto:module:terminal:window-title' format '%s' 45 | 46 | # Set the tab title format. 47 | zstyle ':prezto:module:terminal:tab-title' format '%s' 48 | 49 | # 50 | # Editor 51 | # 52 | 53 | # Set the key mapping style to 'emacs' or 'vi'. 54 | zstyle ':prezto:module:editor' key-bindings 'emacs' 55 | 56 | # Auto convert .... to ../.. 57 | zstyle ':prezto:module:editor' dot-expansion 'yes' 58 | 59 | # 60 | # Syntax Highlighting 61 | # 62 | 63 | # Set syntax highlighters. 64 | zstyle ':prezto:module:syntax-highlighting' highlighters \ 65 | 'main' \ 66 | 'brackets' \ 67 | 'pattern' \ 68 | 'line' \ 69 | 'cursor' \ 70 | 'root' 71 | 72 | # 73 | # Prompt 74 | # 75 | 76 | # Disable return values 77 | zstyle ':prezto:module:prompt' show-return-val 'no' 78 | 79 | # Set the prompt theme to load. 80 | zstyle ':prezto:module:prompt' theme 'sorin' 81 | -------------------------------------------------------------------------------- /src/nvim/init.lua: -------------------------------------------------------------------------------- 1 | -- Alias various helper variables. 2 | local opt = vim.opt -- Options. 3 | local cmd = vim.cmd -- Vim commands. 4 | 5 | -- Enable relative line numbers. 6 | opt.number = true 7 | opt.relativenumber = true 8 | opt.scrolloff = 3 9 | 10 | -- Highlight current line. 11 | opt.cursorline = true 12 | 13 | -- Ignore case in searches. 14 | opt.ignorecase = true 15 | 16 | -- Show the filename in the window titlebar. 17 | opt.title = true 18 | 19 | -- Tabs configuration. 20 | opt.tabstop = 2 21 | opt.shiftwidth = 2 22 | opt.expandtab = true 23 | 24 | -- Use smart indentation. 25 | opt.smartindent = true 26 | 27 | -- Load packages. 28 | require('packer').startup(function() 29 | use 'wbthomason/packer.nvim' -- package manager 30 | use 'connorholyday/vim-snazzy' -- theme 31 | use 'lukas-reineke/indent-blankline.nvim' -- indentation guides 32 | use 'tpope/vim-fugitive' -- git 33 | use 'airblade/vim-gitgutter' -- git gutter 34 | use 'bling/vim-airline' -- status line 35 | use 'vim-airline/vim-airline-themes' -- status line themes 36 | end) 37 | 38 | -- Configure theme. 39 | cmd 'colorscheme snazzy' 40 | cmd([[ 41 | hi Normal ctermbg=16 guibg=#121212 42 | hi LineNr ctermbg=16 guibg=#121212 guifg=#383837 43 | ]]) 44 | 45 | -- Fix color scheme search highlight colors 46 | cmd 'autocmd ColorScheme * highlight Search guibg=#ff6ac1' 47 | cmd 'autocmd ColorScheme * highlight IncSearch guibg=#ff6ac1' 48 | 49 | -- Configure indentation guides. 50 | vim.g.indent_blankline_char = '│' 51 | 52 | -- Configure status line. 53 | opt.laststatus = 2 54 | cmd([[ 55 | let g:airline_theme='base16_snazzy' 56 | 57 | let g:airline_left_sep = '' 58 | let g:airline_right_sep = '' 59 | let g:airline_section_z = airline#section#create(['%3p%%', 'linenr', 'maxlinenr']) 60 | 61 | if !exists('g:airline_symbols') 62 | let g:airline_symbols = {} 63 | endif 64 | 65 | let g:airline_symbols.branch = '' 66 | let g:airline_symbols.readonly = '' 67 | let g:airline_symbols.linenr = ' Ξ ' 68 | let g:airline_symbols.notexists = '!' 69 | let g:airline_symbols.maxlinenr = ' ¶' 70 | ]]) 71 | -------------------------------------------------------------------------------- /src/configure/configure.yaml: -------------------------------------------------------------------------------- 1 | - defaults: 2 | link: 3 | create: true 4 | force: true 5 | relink: true 6 | 7 | - clean: ["~"] 8 | 9 | - shell: 10 | - command: zsh src/configure/prezto 11 | description: Installing Prezto. 12 | stdout: true 13 | stderr: true 14 | - command: sh src/configure/packer.nvim 15 | description: Installing packer.nvim. 16 | stdout: true 17 | stderr: true 18 | 19 | - link: 20 | # ~ 21 | ~/.backupignore: 22 | path: src/borg/.backupignore 23 | ~/.gitconfig: 24 | path: src/git/.gitconfig 25 | ~/.hushlogin: 26 | path: src/zsh/.hushlogin 27 | ~/.wgetrc: 28 | path: src/wget/.wgetrc 29 | ~/.zlogin: 30 | path: src/zsh/.zlogin 31 | ~/.zlogout: 32 | path: src/zsh/.zlogout 33 | ~/.zpreztorc: 34 | path: src/zsh/.zpreztorc 35 | ~/.zprofile: 36 | path: src/zsh/.zprofile 37 | ~/.zshenv: 38 | path: src/zsh/.zshenv 39 | ~/.zshrc: 40 | path: src/zsh/.zshrc 41 | # ~/.config 42 | ~/.config/ghostty/config: 43 | path: src/ghostty/config 44 | ~/.config/nvim/init.lua: 45 | path: src/nvim/init.lua 46 | ~/.config/starship.toml: 47 | path: src/zsh/starship.toml 48 | ~/.config/tig/config: 49 | path: src/tig/config 50 | # ~/.ssh 51 | ~/.ssh/allowed_signers: 52 | path: src/git/allowed_signers 53 | # ~/Library 54 | ~/Library/LaunchAgents/local.backup.plist: 55 | path: src/borg/local.backup.plist 56 | ~/Library/Application Support/espanso: 57 | path: src/espanso 58 | # /usr/local/bin 59 | /usr/local/bin/+x: 60 | path: src/bin/+x 61 | /usr/local/bin/backup: 62 | path: src/bin/backup 63 | /usr/local/bin/brew_init: 64 | path: src/bin/brew_init 65 | /usr/local/bin/mit: 66 | path: src/bin/mit 67 | 68 | - create: 69 | - ~/Temp 70 | - ~/Pictures/Screenshots 71 | 72 | - shell: 73 | - [chmod +x /usr/local/bin/backup, Setting permissions for backup binary.] 74 | - [chmod +x /usr/local/bin/+x, Setting permissions for +x binary.] 75 | - [chmod +x /usr/local/bin/mit, Setting permissions for mit binary.] 76 | - command: echo "To install Neovim plugins, use the ':PackerInstall' command." 77 | description: Setting up Neovim plugins. 78 | quiet: true 79 | stdout: true 80 | -------------------------------------------------------------------------------- /src/bin/backup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Note that we're explicitly using `/bin/bash` instead of `/usr/bin/env bash` to workaround a macOS permission issue 3 | # when starting this script using launchd. 4 | 5 | set -Eeuo pipefail 6 | trap 'catch $? $LINENO' EXIT 7 | 8 | # Path(s) to backup. 9 | SOURCE_PATH=( 10 | "/Users/hideo/Library/CloudStorage/Dropbox/Backups" 11 | "/Users/hideo/Projects/dotfiles" 12 | "/Users/hideo/.config" 13 | "/Users/hideo/.npmrc" 14 | "/Users/hideo/.zsh_history" 15 | "/Users/hideo/Documents" 16 | "/Users/hideo/Movies" 17 | "/Users/hideo/Music" 18 | "/Users/hideo/Pictures" 19 | ) 20 | 21 | # Path of the repository that will contain the backup archives. 22 | REPO_PATH="bullpen:~/.backups/iMac" 23 | 24 | # Initialize brew paths. 25 | source /usr/local/bin/brew_init 26 | 27 | # Use macOS Keychain to get the passphrase. 28 | export BORG_PASSCOMMAND="security find-generic-password -a $USER -s borg-passphrase -w" 29 | 30 | # Common borg create options. 31 | BORG_CREATE_OPTIONS='--files-cache ctime,size --exclude-caches --exclude-from /Users/hideo/.backupignore' 32 | 33 | # Catches exit (due to an error or not). 34 | catch() { 35 | # If there was no error, exit properly. 36 | if [ "$1" == 0 ]; then 37 | return 38 | fi 39 | 40 | # Handle errors. 41 | osascript -e "display alert \ 42 | \"Backup interrupted\" message \ 43 | \"Something went wrong during a backup.\n\ 44 | \nCode: $1 - Line: $2\n\ 45 | \nCheck /Users/hideo/Library/Logs/local.backup.log for more details.\" \ 46 | as critical" &> /dev/null 47 | } 48 | 49 | # Displays command usage. 50 | usage() { 51 | echo "Usage:" 52 | echo " backup Backup files." 53 | echo " backup help Display this help message." 54 | echo " backup list List files to backup." 55 | } 56 | 57 | # Lists files to backup (no backup are actually started). 58 | list() { 59 | borg create ${BORG_CREATE_OPTIONS} -n --list ${REPO_PATH}::list "${SOURCE_PATH[@]}" 60 | } 61 | 62 | # Backups files. 63 | backup() { 64 | # Create a new backup archive. 65 | borg create ${BORG_CREATE_OPTIONS} ${REPO_PATH}::'{now:%Y-%m-%d} {now:%H:%M:%S}' "${SOURCE_PATH[@]}" 66 | 67 | # Purge existing archives except the last two backups and at least 2 weekly archives. 68 | borg prune --keep-last 2 -w 2 ${REPO_PATH} 69 | } 70 | 71 | # Handle various usages. 72 | if [ $# -eq 0 ]; then 73 | # Without any option, start a backup. 74 | backup 75 | elif [ $# -eq 1 ]; then 76 | # Handle 1 option. 77 | action=$1 78 | 79 | case "${action}" in 80 | help) 81 | usage 82 | ;; 83 | list) 84 | list 85 | ;; 86 | *) 87 | usage 88 | exit 1 89 | esac 90 | else 91 | # Invalid number of options. 92 | usage 93 | exit 1 94 | fi 95 | -------------------------------------------------------------------------------- /src/git/.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | email = 494699+HiDeoo@users.noreply.github.com 3 | name = HiDeoo 4 | signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGVI/tlnHsyRkQ8/2zZAGk9zni7dTOS2VC3Xw1Pht9g3 5 | [github] 6 | user = HiDeoo 7 | [filter "lfs"] 8 | clean = git-lfs clean %f 9 | required = true 10 | smudge = git-lfs smudge %f 11 | [init] 12 | defaultBranch = main 13 | [commit] 14 | gpgSign = true 15 | verbose = true 16 | [tag] 17 | gpgSign = true 18 | [gpg] 19 | format = ssh 20 | [gpg "ssh"] 21 | allowedSignersFile = "~/.ssh/allowed_signers" 22 | program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign" 23 | [grep] 24 | lineNumber = true 25 | [core] 26 | editor = code --wait 27 | pager = delta 28 | [interactive] 29 | diffFilter = delta --color-only 30 | [color] 31 | ui = true 32 | [color "diff"] 33 | commit = "yellow bold" 34 | frag = "magenta bold" 35 | meta = "yellow" 36 | new = "green bold" 37 | old = "red bold" 38 | whitespace = "red reverse" 39 | [color "diff-highlight"] 40 | newHighlight= "green bold 22" 41 | newNormal= "green bold" 42 | oldHighlight= "red bold 52" 43 | oldNormal= "red bold" 44 | [pull] 45 | ff = only 46 | [diff] 47 | tool = vscode 48 | [difftool] 49 | prompt = false 50 | [difftool "vscode"] 51 | cmd = code --wait --diff $LOCAL $REMOTE 52 | [merge] 53 | log = true 54 | tool = vscode 55 | [mergetool "vscode"] 56 | cmd = code --wait --merge $REMOTE $LOCAL $BASE $MERGED 57 | [stash] 58 | showPatch = true 59 | showIncludeUntracked = true 60 | [status] 61 | showUntrackedFiles = all 62 | submoduleSummary = true 63 | [alias] 64 | a = add 65 | ap = add -p 66 | b = branch 67 | branches = for-each-ref --sort=-committerdate --format=\"%(color:blue)%(authordate:relative)\t%(color:red)%(authorname)\t%(color:white)%(color:bold)%(refname:short)\" refs/remotes 68 | c = clone --recursive 69 | cancel = reset --hard 70 | co = checkout 71 | d = diff 72 | dt = difftool 73 | last-msg = !git --no-pager log --format=format:%B -1 74 | last-sha = !git --no-pager log --format=format:%H -1 75 | ls = "!git log --graph --pretty=format:\"%C(yellow)%h %C(green)[%ad]%C(red)%d %C(reset)%s %C(blue)(%cr) %C(#606580)<%cn>%C(reset)\" --date=short --color | sed -Ee 's/(^[^<]*) ago\\)/\\1)/' | less" 76 | main = switch main 77 | pp = pull --prune 78 | r = reflog -20 79 | ra = rebase --abort 80 | rc = rebase --continue 81 | rma = rebase main 82 | rmi = rebase main -i 83 | rv = remote -v 84 | s = status -sb 85 | sub = submodule update --init --recursive 86 | sw = switch 87 | undo = reset --soft HEAD^ 88 | wip = "!git add -A && git commit -m WIP" 89 | [delta] 90 | features = vitesse-dark 91 | line-numbers = true 92 | side-by-side = true 93 | [delta "vitesse-dark"] 94 | dark = true 95 | syntax-theme = TwoDark 96 | line-numbers-minus-style = "#cb7676" 97 | line-numbers-plus-style = "#4d9375" 98 | minus-emph-style = syntax "#612424" 99 | minus-style = syntax "#3b1616" 100 | plus-emph-style = syntax "#294c3e" 101 | plus-style = syntax "#172b23" 102 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

dotfiles ⚙️

3 |

Dotfiles collection to install & configure HiDeoo's macOS setup

4 |
5 | 6 |
7 | 8 | License 9 | 10 |
11 |
12 | 13 | > **Note** 14 | > 15 | > This repository should be forked and customized to fit your needs in order to include your own dotfiles. Make sure to add your existing dotfiles to your forked repository before using the `configure` script as it will erase the current ones. 16 | 17 | ## Features 18 | 19 | ### Installation 20 | 21 | A script meant to be used after a fresh install of macOS that will automatically install all applications from Visual Studio Code to `jq` and configure the environment settings. 22 | 23 | ```shell 24 | $ ./install 25 | ``` 26 | 27 | The installation process will: 28 | 29 | - Install the [XCode Command Line Tools](https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-WHAT_IS_THE_COMMAND_LINE_TOOLS_PACKAGE_). 30 | - Install [Homebrew](https://brew.sh/). 31 | - Install various [Homebrew Formulas](src/install/formulas.sh). 32 | - Install various [Homebrew Casks](src/install/casks.sh). 33 | - Configure all the [environment settings](src/install/settings.sh). 34 | 35 | ### Configuration 36 | 37 | A script will use [Dotbot](https://github.com/anishathalye/dotbot) to install [Prezto](https://github.com/sorin-ionescu/prezto) if necessary, automatically symlink all dotfiles included in this repository to their assumed locations and install some useful scripts on the system. 38 | 39 | ```shell 40 | $ ./configure 41 | ``` 42 | 43 | Dotfiles: 44 | 45 | - [Borg](https://borgbackup.readthedocs.io/) 46 | - [Espanso](https://github.com/espanso/espanso) 47 | - [Git](https://git-scm.com/docs/git-config) 48 | - [Ghostty](https://ghostty.org/) 49 | - [Neovim](https://neovim.io/doc/user/starting.html#init.lua) 50 | - [Packer](https://github.com/wbthomason/packer.nvim) 51 | - [Prezto](https://github.com/sorin-ionescu/prezto) 52 | - [Wget](https://www.gnu.org/software/wget/manual/html_node/Wgetrc-Commands.html) 53 | - [Zsh](http://zsh.sourceforge.net/Intro/intro_3.html#SEC3) 54 | 55 | Scripts: 56 | 57 | - `+x`: Script to quickly add the execution permission to a file. 58 | - `backup`: Script using [Borg](https://borgbackup.readthedocs.io/) to create deduplicating backups every night. 59 | - `brew_init`: Script to initialize [Homebrew](https://brew.sh/) with Apple Silicon support. 60 | - `mit`: Script to generate an MIT license file in the current directory. 61 | 62 | ## Resources 63 | 64 | - [alrra/dotfiles](https://github.com/alrra/dotfiles) 65 | - [anishathalye/dotfiles](https://github.com/anishathalye/dotfiles) 66 | - [jacobwgillespie/dotfiles](https://github.com/jacobwgillespie/dotfiles) 67 | - [mathiasbynens/dotfiles](https://github.com/mathiasbynens/dotfiles) 68 | - [necolas/dotfiles](https://github.com/necolas/dotfiles) 69 | - [nicksp/dotfiles](https://github.com/nicksp/dotfiles) 70 | - [paulirish/dotfiles](https://github.com/paulirish/dotfiles) 71 | 72 | ## License 73 | 74 | Licensed under the MIT License, Copyright © HiDeoo. 75 | 76 | See [LICENSE](https://github.com/HiDeoo/dotfiles/blob/main/LICENSE) for more information. 77 | -------------------------------------------------------------------------------- /src/zsh/.zshrc: -------------------------------------------------------------------------------- 1 | # 2 | # Main 3 | # 4 | 5 | # Initialize brew. 6 | source /usr/local/bin/brew_init 7 | 8 | # Add brew completion definitions before sourcing Prezto. 9 | if type brew &>/dev/null; then 10 | FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH 11 | fi 12 | 13 | # Source Prezto. 14 | if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then 15 | source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" 16 | fi 17 | 18 | # Initialize completions. 19 | if type brew &>/dev/null; then 20 | autoload -Uz compinit 21 | compinit 22 | fi 23 | 24 | # Load extra tab-completions. 25 | [ -f ~/.config/tabtab/zsh/__tabtab.zsh ] && source ~/.config/tabtab/zsh/__tabtab.zsh 26 | 27 | # 28 | # ZSH 29 | # 30 | 31 | # Increase history size. 32 | export HISTSIZE=1000000 33 | export SAVEHIST=${HISTSIZE} 34 | 35 | # Add a key binding (Ctrl + Space) to accept suggestions. 36 | bindkey '^ ' autosuggest-accept 37 | 38 | # Expand aliases after sudo instead of only checking the first word of a command for an alias. 39 | alias sudo='sudo ' 40 | 41 | # Reload Zsh. 42 | alias rr='exec zsh' 43 | 44 | # Edit zshrc in VS Code. 45 | alias al='c ~/.zshrc' 46 | 47 | # Load Starship prompt. 48 | eval "$(starship init zsh)" 49 | 50 | # Prevent some commands from being saved in the history. 51 | zshaddhistory() { 52 | if [[ "$1" == "strepro"* ]]; then 53 | fc -p 54 | fi 55 | } 56 | 57 | # 58 | # Navigation 59 | # 60 | 61 | # Changes the current working directory using fasd. 62 | alias d='fasd_cd' 63 | 64 | # Navigate to the previous directory. 65 | alias -- -='cd -' 66 | 67 | # Navigate to various common directories. 68 | alias db='cd ~/Library/CloudStorage/Dropbox' 69 | alias dl='cd ~/Downloads' 70 | alias dt='cd ~/Desktop' 71 | alias wk='cd ~/Projects' 72 | alias tmp='cd ~/Temp' 73 | alias ss='cd ~/Pictures/Screenshots' 74 | 75 | # Navigate to the dotfiles repository. 76 | alias dotfiles='wk && cd dotfiles' 77 | 78 | # 79 | # Editors 80 | # 81 | 82 | # Alias common editors. 83 | alias vim='nvim' 84 | alias c='code' 85 | alias n='nvim' 86 | alias v='nvim' 87 | 88 | # Compare two files using VS Code. 89 | alias cdiff='c -n -d' 90 | 91 | # 92 | # Miscellaneous 93 | # 94 | 95 | # Use GNU grep instead of BSD grep. 96 | alias grep='ggrep' 97 | 98 | # Alias ps. 99 | alias psa='ps aux' 100 | alias psg='ps aux | grep -i' 101 | 102 | # Alias ls. 103 | alias l='ll' 104 | alias lsg='ll | grep -i' 105 | 106 | # Override ls commands to use eza. 107 | alias ls='eza -a -l --git --no-user' 108 | alias l='ls' 109 | alias ll='eza -a -l --git -g' 110 | alias lst='ls -T -L 2' 111 | alias lsgit='ls --git-ignore' 112 | 113 | # Use the verbose mode for cp & mv. 114 | alias cp='cp -v' 115 | alias mv='mv -v' 116 | 117 | # Override some default commands. 118 | alias cat='bat -p --theme ansi' 119 | alias ping='prettyping' 120 | alias rm='trash' 121 | 122 | # Alias ls to tree. 123 | alias tree='ls -T -L 2' 124 | 125 | # Add a native rm fallback. 126 | alias rmi='command rm -i' 127 | 128 | # Clear & list the current directory. 129 | alias cls='clear; ls' 130 | 131 | # Make pbcopy shorter. 132 | alias copy='pbcopy <' 133 | 134 | # Remove the last added file in the ~/Downloads directory if it matches a set of extensions. 135 | dlrm() { 136 | validExtensions=("avi" "mkv") 137 | 138 | dl 139 | file=($(ls -tU | head -n1)) 140 | extension="${file##*.}" 141 | 142 | for ext in "${validExtensions[@]}" 143 | do 144 | if [ "$ext" = "$extension" ] ; then 145 | rm "$file" 146 | 147 | echo "Deleted ${file}" 148 | 149 | break 150 | fi 151 | done 152 | 153 | cd - > /dev/null 154 | } 155 | 156 | # Open a specific file or the current directory. 157 | unalias o 158 | o() { 159 | if [ -z "$1" ]; then 160 | open . 161 | else 162 | open "$1" 163 | fi 164 | } 165 | 166 | # 167 | # macOS 168 | # 169 | 170 | # Configure the Homebrew Cask application directory. 171 | export HOMEBREW_CASK_OPTS='--appdir=/Applications' 172 | 173 | # Update various parts of the system. 174 | alias update_brew='brew -v update; brew upgrade; brew cleanup --prune=30; brew doctor' 175 | alias update_prezto='zprezto-update' 176 | alias update_all='update_brew; update_prezto' 177 | 178 | # Empty trashes on all mounted volumes, the trash of the main disk & Apple's System Logs. 179 | alias empty='sudo \rm -rfv /Volumes/*/.Trashes; sudo \rm -rfv ~/.Trash; sudo \rm -rfv /private/var/log/asl/*.asl' 180 | 181 | # Remove quarantine on a specific element. 182 | alias unquarantine='xattr -r -d com.apple.quarantine' 183 | 184 | # Approve a specific element from an unidentified developer via the system-wide assessment rule database. 185 | alias approve='spctl --add --label "Approved"' 186 | 187 | # 188 | # Internet 189 | # 190 | 191 | # Get external IPv4. 192 | alias ip='\dig +short -4 myip.opendns.com @resolver1.opendns.com' 193 | 194 | # Start a Proxy Socks v5. 195 | alias proxy='ssh -C2qTnN -D 8282' 196 | 197 | # Alias dig to doggo. 198 | alias dig='doggo' 199 | 200 | # Edit the hosts file. 201 | alias hosts='sudo $EDITOR /etc/hosts' 202 | 203 | # Setup a tunnel using Cloudflare Tunnel. 204 | alias tunnel='cloudflared tunnel --url' 205 | 206 | # 207 | # Dev 208 | # 209 | 210 | # Ssh to Zoidberg. 211 | alias zoid='ssh zoidberg' 212 | 213 | # Alias ripgrep. 214 | alias rg='rg --smart-case --colors "path:fg:green" --colors "path:style:bold" --colors "line:fg:yellow" --colors "line:style:bold" --colors "match:fg:magenta"' 215 | alias rgc='rg --context 2' 216 | 217 | # Extract an asar archive to a specific fodler. 218 | alias unasar='npx asar extract' 219 | 220 | # Configure Go. 221 | export GOPATH="$HOME/.go" 222 | 223 | # 224 | # Fzf 225 | # 226 | 227 | # Add fzf default key bindings. 228 | [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh 229 | 230 | # Add custom key bindings. 231 | bindkey '^[OP' fzf-cd-widget 232 | 233 | export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'" 234 | export FZF_CTRL_T_OPTS="--preview '(highlight -O ansi -l {} 2> /dev/null || cat {} || tree -C {}) 2> /dev/null | head -200'" 235 | export FZF_DEFAULT_OPTS="--color=hl:13,hl+:13,fg:#7f7e80,fg+:15,pointer:9,info:11,bg+:#3a3e50" 236 | 237 | # Add custom Ctrl-R widget that can executes commands when pressing Ctrl-X. 238 | fzf-history-widget() { 239 | local selected num 240 | setopt localoptions noglobsubst noposixbuiltins pipefail 2> /dev/null 241 | selected=( $(fc -rl 1 | 242 | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort --expect=ctrl-x $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) ) 243 | local ret=$? 244 | if [ -n "$selected" ]; then 245 | local accept=0 246 | if [[ $selected[1] = ctrl-x ]]; then 247 | accept=1 248 | shift selected 249 | fi 250 | num=$selected[1] 251 | if [ -n "$num" ]; then 252 | zle vi-fetch-history -n $num 253 | [[ $accept = 1 ]] && zle accept-line 254 | fi 255 | fi 256 | zle redisplay 257 | typeset -f zle-line-init >/dev/null && zle zle-line-init 258 | return 0 259 | } 260 | 261 | # 262 | # Git 263 | # 264 | 265 | # Navigate automatically to a git cloned directory. 266 | git() { 267 | if [ "$1" = clone ] && [ "$#" -eq 2 ]; then 268 | command git clone $2 269 | cd $(basename $2 | sed 's/.git$//') 270 | else 271 | command git "$@" 272 | fi 273 | } 274 | 275 | # Delete git local branches which have already been merged into the current HEAD. 276 | alias gitcleanup='gh poi' 277 | 278 | # Switch to the main branch, pull-prune the latest changes and delete the previous branch. 279 | gitdone() { 280 | branch=($(git rev-parse --abbrev-ref HEAD)) 281 | 282 | command git main && git pp && git branch -D ${branch} 283 | } 284 | 285 | # Create a new PR. 286 | alias npr='gh pr create --body ""' 287 | 288 | # Checkout a PR. 289 | alias pr='gh pr checkout' 290 | 291 | # 292 | # Node 293 | # 294 | 295 | # Configure the Node REPL. 296 | export NODE_REPL_HISTORY_SIZE='10000'; 297 | 298 | # Lazy-load fnm. 299 | eval "$(fnm env --use-on-cd)" 300 | 301 | # Configure pnpm. 302 | export PNPM_HOME="$HOME/Library/pnpm" 303 | 304 | path=( 305 | $PNPM_HOME 306 | $path 307 | ) 308 | 309 | # Returns the latest version of a package matching a given semver range. 310 | latest() { 311 | pnpm view $1 version | tail -n 1 | cut -d "'" -f 2 312 | } 313 | 314 | # Bump version numbers without Conventional Commits. 315 | # https://github.com/antfu/bumpp 316 | # https://github.com/JS-DevTools/version-bump-prompt 317 | alias bump='pnpx bumpp --commit "v"' 318 | 319 | # Update various packages to their latest versions. 320 | alias pnpmup='pnpm up --latest' 321 | 322 | # Lint a package.json file. 323 | alias pkglint='pnpx publint --strict; pnpx @arethetypeswrong/cli $(npm pack)' 324 | 325 | # Run locally installed changeset shell script and open the changeset file. 326 | alias changeset='pnpm exec changeset --open' 327 | 328 | # Setup a fresh environment to reproduce a Starlight issue. 329 | # 330 | # By default, the script will: 331 | # - Create a new directory in the ~/Temp folder named st-repro-YYYY-MM-DD-HH-MM-SS. 332 | # - Clone the Starlight repository. 333 | # - Install the dependencies. 334 | # - Open the project in Visual Studio Code. 335 | # - Go to the docs folder. 336 | # - Start the development server. 337 | # 338 | # The `-m` or `--minimal` flag can be used to create a new project using the `basics` Starlight template instead of 339 | # cloning the Starlight repository. 340 | # 341 | # It is also possible to specify a custom name for the repro using the `-n` or `--name` flag which will replace the 342 | # date-based suffix. 343 | strepro() { 344 | tmp 345 | 346 | while [[ "$#" -gt 0 ]]; do 347 | case $1 in 348 | -n|--name) local suffix="$2"; shift;; 349 | -m|--minimal) local minimal=1;; 350 | *) echo "Unknown option: $1"; return;; 351 | esac 352 | shift 353 | done 354 | 355 | if [ -z "$suffix" ]; then 356 | local suffix=$(date '+%Y-%m-%d-%H-%M-%S') 357 | fi 358 | 359 | local name="st-repro-${suffix}" 360 | 361 | if [ -d "${name}" ]; then 362 | echo "A repro with the name '${suffix}' already exists." 363 | return 364 | fi 365 | 366 | mkdcd "${name}" 367 | 368 | if [ -z "$minimal" ]; then 369 | git clone https://github.com/withastro/starlight 370 | pnpm i 371 | c . 372 | cd docs 373 | else 374 | pnpm create astro@latest --template starlight --install --no-git --skip-houston . 375 | c . 376 | fi 377 | 378 | pnpm dev 379 | } 380 | 381 | # Start a dev npm script using pnpm in the docs folder if it exists or in the current directory. 382 | dev() { 383 | if [[ -d docs ]] 384 | then 385 | cd docs 386 | fi 387 | 388 | pnpm dev 389 | } 390 | -------------------------------------------------------------------------------- /src/install/settings.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Close System Preferences during execution. 4 | osascript -e 'tell application "System Preferences" to quit' 5 | 6 | # Ask for the administrator password upfront. 7 | sudo -v 8 | 9 | # Keep-alive. 10 | while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & 11 | 12 | echo "Setting preferences." 13 | 14 | # 15 | # General 16 | # 17 | 18 | # Use a dark appearance. 19 | defaults write NSGlobalDomain AppleInterfaceStyle Dark 20 | 21 | # Show scroll bars when scrolling. 22 | defaults write NSGlobalDomain AppleShowScrollBars -string "WhenScrolling" 23 | 24 | # Jump to the scroll bar spot on click. 25 | defaults write NSGlobalDomain AppleScrollerPagingBehavior -bool true 26 | 27 | # Prefer tabs when opening documents. 28 | defaults write NSGlobalDomain AppleWindowTabbingMode -string "always" 29 | 30 | # Close windows when quitting an app. 31 | defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false 32 | 33 | # Expand Save Panel by default. 34 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true 35 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true 36 | 37 | # Expand Print Panel by default. 38 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true 39 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true 40 | 41 | # Save to disk (not to iCloud) by default. 42 | defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false 43 | 44 | # Automatically quit the printer app once the print jobs complete. 45 | defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true 46 | 47 | # Disable press-and-hold for keys in favor of key repeat. 48 | defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false 49 | 50 | # Languages. 51 | defaults write NSGlobalDomain AppleLanguages -array "en" "fr" 52 | defaults write NSGlobalDomain AppleLocale -string "en_FR@currency=EUR" 53 | defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters" 54 | defaults write NSGlobalDomain AppleMetricUnits -bool true 55 | 56 | # Timezone. 57 | sudo systemsetup -settimezone "Europe/Paris" > /dev/null 58 | 59 | # Require password immediately after sleep or screen saver begins. 60 | defaults write com.apple.screensaver askForPassword -int 1 61 | defaults write com.apple.screensaver askForPasswordDelay -int 0 62 | 63 | # Disable the “reopen windows when logging back in” option. 64 | defaults write com.apple.loginwindow TALLogoutSavesState -bool false 65 | defaults write com.apple.loginwindow LoginwindowLaunchesRelaunchApps -bool false 66 | 67 | # Update the time and date format for the menubar digital clock. 68 | defaults write com.apple.menuextra.clock "DateFormat" -string "\"EEE HH:mm:ss\"" 69 | 70 | # 71 | # UI 72 | # 73 | 74 | # Disable the Menu Bar Items for Bluetooth, Time Machine & Airport. 75 | defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist Bluetooth -int 18 76 | for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do 77 | defaults write "${domain}" dontAutoLoad -array \ 78 | "/System/Library/CoreServices/Menu Extras/TimeMachine.menu" \ 79 | "/System/Library/CoreServices/Menu Extras/AirPort.menu" 80 | done 81 | 82 | # Set sidebar icon size to small. 83 | defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 1 84 | 85 | # Enable snap-to-grid for desktop icons. 86 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist 87 | 88 | # Set the Drift screensaver. 89 | defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName -string "Drift" path -string "/System/Library/Screen Savers/Drift.saver" type -int 0 90 | 91 | # Show screensaver after 10 minutes. 92 | defaults -currentHost write com.apple.screensaver idleTime 600 93 | 94 | # 95 | # Screenshots 96 | # 97 | 98 | # Do not display a thumbnail after taking a screenshot. 99 | defaults write com.apple.screencapture show-thumbnail -bool false 100 | 101 | # Remove screenshot delays. 102 | defaults delete com.apple.screencapture captureDelay &> /dev/null 103 | 104 | # Do not save screenshots to the desktop. 105 | defaults write com.apple.screencapture location -string "~/Pictures/Screenshots" 106 | 107 | # 108 | # Spotlight 109 | # 110 | 111 | # Configure Spotlight search result categories. 112 | defaults write com.apple.spotlight orderedItems -array \ 113 | '{"enabled" = 1;"name" = "APPLICATIONS";}' \ 114 | '{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}' \ 115 | '{"enabled" = 1;"name" = "MENU_CONVERSION";}' \ 116 | '{"enabled" = 1;"name" = "MENU_EXPRESSION";}' \ 117 | '{"enabled" = 1;"name" = "MENU_DEFINITION";}' \ 118 | '{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \ 119 | '{"enabled" = 0;"name" = "DOCUMENTS";}' \ 120 | '{"enabled" = 0;"name" = "DIRECTORIES";}' \ 121 | '{"enabled" = 0;"name" = "PRESENTATIONS";}' \ 122 | '{"enabled" = 0;"name" = "SPREADSHEETS";}' \ 123 | '{"enabled" = 0;"name" = "PDF";}' \ 124 | '{"enabled" = 0;"name" = "MESSAGES";}' \ 125 | '{"enabled" = 1;"name" = "CONTACT";}' \ 126 | '{"enabled" = 1;"name" = "EVENT_TODO";}' \ 127 | '{"enabled" = 0;"name" = "IMAGES";}' \ 128 | '{"enabled" = 1;"name" = "BOOKMARKS";}' \ 129 | '{"enabled" = 0;"name" = "MUSIC";}' \ 130 | '{"enabled" = 0;"name" = "MOVIES";}' \ 131 | '{"enabled" = 0;"name" = "FONTS";}' \ 132 | '{"enabled" = 0;"name" = "MENU_OTHER";}' \ 133 | '{"enabled" = 1;"name" = "SOURCE";}' 134 | 135 | # 136 | # Finder 137 | # 138 | 139 | # Show all filename extensions. 140 | defaults write NSGlobalDomain AppleShowAllExtensions -bool true 141 | 142 | # Show status bar. 143 | defaults write com.apple.finder ShowStatusBar -bool true 144 | 145 | # Show path bar. 146 | defaults write com.apple.finder ShowPathbar -bool true 147 | 148 | # Keep folders on top when sorting by name. 149 | defaults write com.apple.finder _FXSortFoldersFirst -bool true 150 | 151 | # When performing a search, search the current folder by default. 152 | defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" 153 | 154 | # Disable the warning when changing a file extension. 155 | defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false 156 | 157 | # Enable spring loading for directories. 158 | defaults write NSGlobalDomain com.apple.springing.enabled -bool true 159 | 160 | # Remove the spring loading delay for directories. 161 | defaults write NSGlobalDomain com.apple.springing.delay -float 0 162 | 163 | # Avoid creating .DS_Store files on network or USB volumes. 164 | defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true 165 | defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true 166 | 167 | # Disable disk image verification. 168 | defaults write com.apple.frameworks.diskimages skip-verify -bool true 169 | defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true 170 | defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true 171 | 172 | # Use list view in all Finder windows by default. 173 | # Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`. 174 | defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" 175 | 176 | # Disable the warning before emptying the Trash. 177 | defaults write com.apple.finder WarnOnEmptyTrash -bool false 178 | 179 | # Show the ~/Library folder. 180 | chflags nohidden ~/Library 181 | 182 | # Remove the delay when hovering the toolbar title. 183 | defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0 184 | 185 | # 186 | # Dock 187 | # 188 | 189 | # Set the Dock orientation to the right. 190 | defaults write com.apple.dock orientation -string "right" 191 | 192 | # Disable Dock magnification. 193 | defaults write com.apple.dock magnification -bool false 194 | 195 | # Set the icon size of Dock items. 196 | defaults write com.apple.dock tilesize -int 40 197 | 198 | # Disable size modification. 199 | defaults write com.apple.dock size-immutable -bool true 200 | 201 | # Autohides the Dock. 202 | defaults write com.apple.dock autohide -bool true 203 | 204 | # Do not show recently used apps in a separate section of the Dock. 205 | defaults write com.apple.dock show-recents -bool false 206 | 207 | # Change the Dock minimize animation. 208 | defaults write com.apple.dock mineffect -string "scale" 209 | 210 | # Show open applications indicator. 211 | defaults write com.apple.dock show-process-indicators -bool true 212 | 213 | # Minimize window on title bar double click. 214 | defaults write NSGlobalDomain AppleActionOnDoubleClick -string "Minimize" 215 | 216 | # 217 | # Dashboard 218 | # 219 | 220 | # Disable the Dashboard. 221 | defaults write com.apple.dashboard mcx-disabled -bool true 222 | 223 | # Don’t show Dashboard as a Space. 224 | defaults write com.apple.dock dashboard-in-overlay -bool true 225 | 226 | # 227 | # Hot corners 228 | # 229 | 230 | # Bottom left screen corner → Start screen saver. 231 | defaults write com.apple.dock wvous-bl-corner -int 5 232 | defaults write com.apple.dock wvous-bl-modifier -int 0 233 | 234 | # 235 | # Safari 236 | # 237 | 238 | # Show the full URL in the address bar. 239 | defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true 240 | 241 | # Set Safari’s home page to an empty page. 242 | defaults write com.apple.Safari HomePage -string "" 243 | 244 | # Prevent Safari from opening ‘safe’ files automatically after downloading. 245 | defaults write com.apple.Safari AutoOpenSafeDownloads -bool false 246 | 247 | # Hide Safari’s bookmarks bar by default. 248 | defaults write com.apple.Safari ShowFavorites -bool false 249 | 250 | # Enable the Develop menu and the Web Inspector in Safari. 251 | defaults write com.apple.Safari IncludeDevelopMenu -bool true 252 | defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true 253 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true 254 | 255 | # Add a context menu item for showing the Web Inspector in web views. 256 | defaults write NSGlobalDomain WebKitDeveloperExtras -bool true 257 | 258 | # Disable AutoFill. 259 | defaults write com.apple.Safari AutoFillFromAddressBook -bool false 260 | defaults write com.apple.Safari AutoFillPasswords -bool false 261 | defaults write com.apple.Safari AutoFillCreditCardData -bool false 262 | defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false 263 | 264 | # Block pop-up windows. 265 | defaults write com.apple.Safari WebKitPreferences.javaScriptCanOpenWindowsAutomatically -bool false 266 | 267 | # Enable “Do Not Track”. 268 | defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true 269 | 270 | # 271 | # Activity Monitor 272 | # 273 | 274 | # Show the main window when launching Activity Monitor. 275 | defaults write com.apple.ActivityMonitor OpenMainWindow -bool true 276 | 277 | # Show all processes in Activity Monitor. 278 | defaults write com.apple.ActivityMonitor ShowCategory -int 100 279 | 280 | # Set columns for each tab in Activity Monitor. 281 | defaults write com.apple.ActivityMonitor "UserColumnsPerTab v6.0" -dict \ 282 | '0' '( Command, CPUUsage, CPUTime, Threads, IdleWakeUps, GPUUsage, PID, UID, Architecture )' \ 283 | '1' '( Command, anonymousMemory, compressedMemory, ResidentSize, Threads, Ports, PID, UID, Architecture )' \ 284 | '2' '( Command, PowerScore, 12HRPower, AppSleep, graphicCard, powerAssertion, UID, Architecture )' \ 285 | '3' '( Command, bytesWritten, bytesRead, PID, UID, Architecture )' \ 286 | '4' '( Command, txBytes, rxBytes, txPackets, rxPackets, PID, UID, Architecture )' \ 287 | '5' '( Name, LastHour, LastDay, LastWeek, LastMonth )' \ 288 | '6' '( Command, GPUUsage, GPUTime, PID, UID )' 289 | 290 | # Sort columns for each tab in Activity Monitor. 291 | defaults write com.apple.ActivityMonitor UserColumnSortPerTab -dict \ 292 | '0' '{ direction = 0; sort = CPUUsage; }' \ 293 | '1' '{ direction = 0; sort = anonymousMemory; }' \ 294 | '2' '{ direction = 0; sort = 12HRPower; }' \ 295 | '3' '{ direction = 0; sort = bytesWritten; }' \ 296 | '4' '{ direction = 0; sort = txBytes; }' 297 | 298 | # Show data graph for the Disk tab in Activity Monitor. 299 | defaults write com.apple.ActivityMonitor DiskGraphType -int 1 300 | 301 | # Show data graph for the Network tab in Activity Monitor. 302 | defaults write com.apple.ActivityMonitor NetworkGraphType -int 1 303 | 304 | # 305 | # Mac App Store 306 | # 307 | 308 | # Enable the automatic update check. 309 | defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true 310 | 311 | # Check for software updates daily, not just once per week. 312 | defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 313 | 314 | # Download newly available updates in background. 315 | defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1 316 | 317 | # 318 | # Misc 319 | # 320 | 321 | # Disable smart quotes in Messages as it’s annoying for messages that contain code. 322 | defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false 323 | 324 | # Prevent Photos from opening automatically when devices are plugged in. 325 | defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true 326 | 327 | # Don’t automatically rearrange Spaces based on most recent use. 328 | defaults write com.apple.dock mru-spaces -bool false 329 | 330 | # Disable smart quotes as they’re annoying when typing code. 331 | defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false 332 | 333 | # Disable smart dashes as they’re annoying when typing code. 334 | defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false 335 | 336 | # Enable zoom using Ctrl + scroll. 337 | defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true 338 | 339 | # Disable bigger mouse pointer when shaking it. 340 | defaults write NSGlobalDomain CGDisableCursorLocationMagnification -bool YES 341 | 342 | # 343 | # END 344 | # 345 | 346 | echo "Done settings preferences. Note that some of these changes require a logout/restart to take effect." 347 | 348 | exit 0 349 | --------------------------------------------------------------------------------