From 9d7859f021b99dc3cfe1fff62c7bdb548a2ede8e Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Sat, 14 Jun 2025 07:43:35 -0300 Subject: [PATCH 01/23] refactor: improvement to git settings --- git/.gitconfig | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/git/.gitconfig b/git/.gitconfig index c0e34c6..53126c1 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -1,21 +1,18 @@ -# This is Git's per-user configuration file. - [user] - name = "" - email = "" + name = "" + email = "" [mergetool] keepBackup = true [core] - editor = vim + editor = $EDITOR excludesfile = ~/.gitignore attributesfile = ~/.gitattributes [init] defaultBranch = main - [alias] ci = commit br = branch @@ -33,10 +30,10 @@ fu = fetch origin pum = pull origin master pumn = pull origin main - pud = pull origin dev + pud = pull origin develop fupum = !git co master && git fu && git pum fupumn = !git co main && git fu && git pumn - fupud = !git co dev && git fu && git pud + fupud = !git co develop && git fu && git pud rb = "!f() { \ branch=\"$(git branch 2>/dev/null | grep \\* | awk '{ print $2 }')\" && \ if git rev-parse --verify master >/dev/null 2>&1; then \ From 5ee469f57f67b8f3d9d6e3465050de4e3c6add8e Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Sat, 14 Jun 2025 07:44:06 -0300 Subject: [PATCH 02/23] chore: remove comments --- zsh/aliases.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index de74613..990f489 100755 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -1,8 +1,8 @@ # oh-my-zsh alias zshconfig="$EDITOR ~/.zshrc" alias ohmyzsh="$EDITOR ~/.oh-my-zsh" -alias reload="omz reload" # reload oh-my-zsh -alias zsh-alias="$EDITOR ~/.oh-my-zsh/custom/aliases.zsh" +alias reload="omz reload" +alias custom-alias="$EDITOR ~/.oh-my-zsh/custom/aliases.zsh" # local development alias server="python -m SimpleHTTPServer" From a478407800254b0fec2a7b9eb212e7d500781293 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Sat, 14 Jun 2025 07:44:37 -0300 Subject: [PATCH 03/23] feat: create fn to open folders project or work --- zsh/custom-functions/custom-functions.plugin.zsh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/zsh/custom-functions/custom-functions.plugin.zsh b/zsh/custom-functions/custom-functions.plugin.zsh index 6e719f2..dcdc9d1 100755 --- a/zsh/custom-functions/custom-functions.plugin.zsh +++ b/zsh/custom-functions/custom-functions.plugin.zsh @@ -67,3 +67,18 @@ function logprocess() { journalctl -f -u "$1" 2>/dev/null || tail -f /var/log/syslog | grep "$1" fi } + +# open work folder +function open_work_folder() { + if [ -d ~/Projects ]; then + cd ~/Projects + elif [ -d ~/projects ]; then + cd ~/projects + elif [ -d ~/work ]; then + cd ~/work + elif [ -d ~/Work ]; then + cd ~/Work + else + echo "Folder ~/Projects, ~/projects, ~/work or ~/Work does not exist" + fi +} From e85dd079d44a4e938ced6bce80a41dbf06ad84a4 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Sat, 14 Jun 2025 07:44:55 -0300 Subject: [PATCH 04/23] feat: set configurations to linux --- install_linux | 320 ++++++++++++++++++++++++++++++++++++++++++ linux/Brewfile | 36 +++++ linux/zsh/.zshrc | 46 ++++++ linux/zsh/aliases.zsh | 64 +++++++++ 4 files changed, 466 insertions(+) create mode 100644 install_linux create mode 100644 linux/Brewfile create mode 100644 linux/zsh/.zshrc create mode 100755 linux/zsh/aliases.zsh diff --git a/install_linux b/install_linux new file mode 100644 index 0000000..9ac6d38 --- /dev/null +++ b/install_linux @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +NC='\033[0m' + +# Get current location +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) + +# Array to store completed steps +declare -a completed_steps=() + +# Register a completed step +# @param $1 Step name +register_completed_step() { + local step="$1" + completed_steps+=("$step") +} + +# Print info messages +# @param $1 Message +log() { + echo -e "${GREEN}[INFO]${NC} $1" +} + +# Print error messages in red and exit +# @param $1 Message +error() { + echo -e "${RED}[ERROR]${NC} $1" + exit 1 +} + +# Create a symbolic link +# @param $1 Source file path +# @param $2 Destination link path +safe_link() { + local src="$1" + local dest="$2" + + if [ -e "$dest" ] || [ -L "$dest" ]; then + log "Found $dest - removing..." + rm -f "$dest" + fi + + if [ ! -e "$src" ]; then + error "Source file $src does not exist!" + fi + + log "Linking $dest to $src" + ln -s "$src" "$dest" +} + +# Copy a directory +# @param $1 Source directory path +# @param $2 Destination directory path +copy_dir() { + local src="$1" + local dest="$2" + + if [ ! -d "$src" ]; then + error "Source directory $src does not exist!" + fi + + if [ -d "$dest" ]; then + log "Found $dest - renaming..." + mv "$dest" "$dest.old" + fi + + log "Copying directory $src to $dest" + if ! cp -R "$src" "$dest"; then + error "Failed to copy directory $src to $dest" + fi +} + +# Copy a file +# @param $1 Source file path +# @param $2 Destination file path +copy_file() { + local src="$1" + local dest="$2" + + if [ ! -f "$src" ]; then + error "Source file $src does not exist!" + fi + + if [ -f "$dest" ]; then + log "Found $dest - renaming..." + mv "$dest" "$dest.old" + fi + + log "Copying file $src to $dest" + if ! cp "$src" "$dest"; then + error "Failed to copy file $src to $dest" + fi +} + +# Install Homebrew +install_brew() { + if ! command -v brew >/dev/null 2>&1; then + log "Installing Homebrew..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + else + log "Homebrew is already installed." + fi +} + +# Install Oh My Zsh +install_oh_my_zsh() { + if [ -d "$HOME/.oh-my-zsh" ]; then + log "Oh My Zsh is already installed." + register_completed_step "Oh My Zsh (already installed)" + return 0 + fi + + log "Installing Oh My Zsh..." + if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; then + error "Failed to install Oh My Zsh" + return 1 + fi + + register_completed_step "Oh My Zsh" + log "Oh My Zsh installed successfully!" +} + +# Install Node.js +install_node_using_n() { + if [ -d "$HOME/local/n/versions/node" ]; then + log "Node.js is already installed." + register_completed_step "Node.js (already installed)" + return 0 + else + log "Installing Node.js..." + if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s 22)"; then + error "Failed to install Node.js" + fi + register_completed_step "Node.js" + log "Node.js installed successfully!" + fi +} + +# Install Deno runtime +install_deno() { + if [ -d "$HOME/.deno/bin/deno" ]; then + log "Deno is already installed.." + register_completed_step "Deno (already installed)" + return 0 + else + log "Installing Deno" + if ! sh -c "$(curl -fsSL https://deno.land/install.sh)"; then + error "Failed to install Deno" + fi + register_completed_step "Deno" + log "Deno installed successfully!" + fi +} + +# Configure Git settings +setup_git() { + copy_file "$DIR/git/.gitconfig" "$HOME/.gitconfig" + copy_file "$DIR/git/.gitignore" "$HOME/.gitignore" + copy_file "$DIR/git/.gitattributes" "$HOME/.gitattributes" + register_completed_step "Git" + log "Git configured successfully!" +} + +# Configure Zsh settings +setup_zsh() { + copy_file "$DIR/linux/zsh/.zshrc" "$HOME/.zshrc" + copy_dir "$DIR/zsh/themes" "$HOME/.oh-my-zsh/themes" + copy_file "$DIR/linux/zsh/aliases.zsh" "$HOME/.oh-my-zsh/custom/aliases.zsh" # TODO: use aliases.zsh on macos too + copy_dir "$DIR/zsh/custom-functions" "$HOME/.oh-my-zsh/plugins/custom-functions" + register_completed_step "Zsh" + log "Zsh configured successfully!" +} + +# Configure Homebrew and install packages from Brewfile +setup_brew() { + copy_file "$DIR/linux/Brewfile" "$HOME/Brewfile" + log "Executing brew bundle install..." + if ! brew bundle install; then + error "Brew bundle install failed" + fi + register_completed_step "Homebrew" + log "Homebrew configured successfully!" +} + +# Install global NPM packages +install_pkg_global() { + log "Installing global npm packages..." + npm install -g git-cz n fastify-cli npm-check-updates + register_completed_step "NPM packages" + log "NPM packages installed successfully!" +} + +# Configure NPM settings and install global packages +setup_npm() { + copy_file "$DIR/.npmrc" "$HOME/.npmrc" + register_completed_step "NPM" + log "NPM configured successfully!" + + # Install npm globally without sudo. Based on https://github.com/sindresorhus/guides/blob/main/npm-global-without-sudo.md + if [ -d "$HOME/.npm-packages" ]; then + log ".npm-packages folder exists" + else + mkdir -p "$HOME/.npm-packages" + fi +} + +# Custom fonts +setup_fonts() { + local font_dir="$HOME/.local/share/fonts" + if [ ! -d "$font_dir" ]; then + mkdir -p "$font_dir" + fi + log "Installing fonts for Linux..." + cp "$DIR/extras/fonts/"* "$font_dir/" + fc-cache -f -v + register_completed_step "Fonts" + log "Fonts installed successfully!" + else + error "Error installing fonts" + fi +} + +ask_continue() { + local message="$1" + local step="$2" + echo -e "\n${GREEN}[INFO]${NC} Step $step: $message" + echo -e "${GREEN}[INFO]${NC} Options:" + echo -e " ${GREEN}[s]${NC} - Yes, continue" + echo -e " ${GREEN}[n]${NC} - No, skip this step" + echo -e " ${GREEN}[q]${NC} - Exit installation" + read -p "Your choice (s/n/q): " response + + case "$response" in + [Ss]*) + return 0 + ;; + [Nn]*) + log "Step $step skipped." + return 1 + ;; + [Qq]*) + log "Installation interrupted by user." + exit 0 + ;; + *) + log "Invalid option. Please try again." + ask_continue "$message" "$step" + ;; + esac +} + +main() { + log "Starting installation from $DIR..." + log "This script will configure your environment with the following steps:" + echo -e "\n1. Install Oh My Zsh" + echo "2. Install Homebrew" + echo "3. Install Node.js" + echo "4. Install Deno" + echo "5. Configure Zsh" + echo "6. Configure Homebrew and install packages" + echo "7. Configure Git" + echo "8. Configure NPM" + echo "9. Install global NPM packages" + echo "10. Configure the fonts" + + ask_continue "Do you want to start the installation?" "0" || exit 0 + + if ask_continue "Install Oh My Zsh" "1"; then + install_oh_my_zsh + fi + + if ask_continue "Install Homebrew" "2"; then + install_brew + fi + + if ask_continue "Install Node.js" "3"; then + install_node_using_n + fi + + if ask_continue "Install Deno" "4"; then + install_deno + fi + + if ask_continue "Configure Zsh" "5"; then + setup_zsh + fi + + if ask_continue "Configure Homebrew and install packages" "6"; then + setup_brew + fi + + if ask_continue "Configure Git" "7"; then + setup_git + fi + + if ask_continue "Configure NPM" "8"; then + setup_npm + fi + + if ask_continue "Install global NPM packages (git-cz, n, fastify-cli, npm-check-updates)" "9"; then + install_pkg_global + fi + + if ask_continue "Configure the fonts" "10"; then + setup_fonts + fi + + log "Configurations completed successfully! 🎉" + log "Steps executed:" + for step in "${completed_steps[@]}"; do + echo "- $step" + done +} + +main "$@" diff --git a/linux/Brewfile b/linux/Brewfile new file mode 100644 index 0000000..83695bf --- /dev/null +++ b/linux/Brewfile @@ -0,0 +1,36 @@ +tap "espanso/espanso" +tap "homebrew/bundle" +tap "localsend/localsend" +brew "xz" +brew "zstd" +brew "libtiff" +brew "jpeg-xl" +brew "c-ares" +brew "icu4c@76" +brew "libuv" +brew "openssl@3" +brew "gettext" +brew "glib" +brew "sqlite" +brew "gh" +brew "git" +brew "unbound" +brew "gnutls" +brew "netpbm" +brew "harfbuzz" +brew "python@3.13" +brew "graphviz" +brew "httpie" +brew "libssh" +brew "pipx" +brew "pyenv" +brew "python-argcomplete" +brew "qemu" +brew "yarn" +cask "balenaetcher" +cask "espanso" +cask "ghostty" +cask "latest" +cask "localsend" +cask "mark-text" +cask "yaak" diff --git a/linux/zsh/.zshrc b/linux/zsh/.zshrc new file mode 100644 index 0000000..6f453c6 --- /dev/null +++ b/linux/zsh/.zshrc @@ -0,0 +1,46 @@ +export ZSH=$HOME/.oh-my-zsh + +ZSH_THEME="dracula" + +plugins=(brew copypath copyfile custom-functions deno docker docker-compose extract git history npm python vscode web-search yarn) + +# global +export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" +export PATH=$HOME/local/bin:$PATH +export NPM_PACKAGES="${HOME}/.npm-packages" +export PATH="$NPM_PACKAGES/bin:$PATH" +export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" +#export JAVA_HOME="$(/usr/libexec/java_home -v 1.$JAVA_VERSION)" # enable this if you are using java +#export PATH=/usr/share/maven/bin:$PATH # enable this if you are using maven +#export PATH=$HOME/mongodb/bin:$PATH # enable this if you are using mongodb +#export PATH=$PATH:~/.composer/vendor/bin # enable this if you are using composer + +# github +export GH_TOKEN="" # create token at https://github.com/settings/apps select "Personal access tokens" + +# ssh +export SSH_KEY_PATH="~/.ssh/id_ed25519" + +# node and npm +export NODE_ENV="development" +export NPM_TOKEN="" +export NPM_SCOPE="" # e.g. tcelestino + +# local +export USER_NAME="" +export USER_EMAIL="" + +# preferred editor for local and remote sessions +if [[ -n $SSH_CONNECTION ]]; then + export EDITOR='vim' +else + export EDITOR='code' +fi + +# web search custom search engines +ZSH_WEB_SEARCH_ENGINES=( + reddit "https://www.reddit.com/search/?q=" + linkedin "https://www.linkedin.com/search/results/all/?keywords=" +) + +source $ZSH/oh-my-zsh.sh diff --git a/linux/zsh/aliases.zsh b/linux/zsh/aliases.zsh new file mode 100755 index 0000000..ed933ba --- /dev/null +++ b/linux/zsh/aliases.zsh @@ -0,0 +1,64 @@ +# oh-my-zsh +alias zshconfig="$EDITOR ~/.zshrc" +alias ohmyzsh="$EDITOR ~/.oh-my-zsh" +alias reload="omz reload" +alias custom-alias="$EDITOR ~/.oh-my-zsh/custom/aliases.zsh" + +# local development +alias server="python -m SimpleHTTPServer" +alias serveo="ssh -R 80:localhost:3000 serveo.net" + +# https://paulbrowne.xyz/https-localhost +alias https-server='http-server --ssl --cert ~/.ssl/localhost.crt --key ~/.ssl/localhost.key -a localhost -o' + +# npm +alias npm-i='npm install' +alias npm-is='npm install --save' +alias npm-id='npm install --save-dev' +alias npm-ig='npm install --global' +alias npm-start='npm start' +alias npm-test='npm test' +alias npm-it='npm install && npm test' +alias npm-lk='npm link' +alias npm-run='npm run' +alias npm-ri='rm -rf node_modules && npm i' +alias npm-reset='rm -rf node_modules && rm -f package-lock.json && npm install && npx node-notifier-cli -t "Done" -m "npm modules reinstalled" -s Glass -i https://cdn.rawgit.com/npm/logos/31945b5c/npm%20square/n-64.png' + +# git-cz +alias commit="git-cz --disable-emoji" +alias commitall="git add . && git-cz --disable-emoji" + +# directory +alias downloads='cd ~/Downloads/' +alias work=open_work_folder + +# mv, rm, cp +alias mv='mv -v' +alias rm='rm -i -v' +alias cp='cp -v' +alias rd="rmdir" +alias del="rm -i" + +# docker +alias docker-rmi='docker rmi $(docker images -q)' # delete all images +alias docker-rmiu='docker rmi $(docker images -q -f dangling=true)' # delete all untagged images +alias docker-rmus='docker rm $(docker ps -a -q)' # delete all stopped images +alias docker-stop='docker stop $(docker ps -aq)' # stop all container +alias docker-ch='export DOCKER_HOST=' + +# docker-compose +alias dcu='docker-compose up' #start with docker-composer +alias dcd='docker-compose down' #stop with docker-composer +alias dcr='docker-compose restart' #restart with docker-composer +alias dcb='docker-compose build' #build with docker-composer +alias dcl='docker-compose logs' #logs with docker-composer +alias dcp='docker-compose -f docker-compose.dependencies.yaml up -d' #start dependencies with docker-composer + +# utils +alias fs="stat -f \"%z bytes\"" +alias chmox='chmod -x' +alias where=which +alias killnode="killall -9 node" +alias what_shell=ps -p $$ -o pid,comm= # show current shell +alias checkport=checkPort +alias killport=killPort From 7fb9016965875b1cf2e0e0977b312ba499cc99ba Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Thu, 19 Jun 2025 05:37:44 -0300 Subject: [PATCH 05/23] fix: adjust to gemini bot review --- install_linux | 28 +++++++++++----------------- linux/zsh/aliases.zsh | 4 ++-- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/install_linux b/install_linux index 9ac6d38..3b78b45 100644 --- a/install_linux +++ b/install_linux @@ -112,13 +112,11 @@ install_oh_my_zsh() { if [ -d "$HOME/.oh-my-zsh" ]; then log "Oh My Zsh is already installed." register_completed_step "Oh My Zsh (already installed)" - return 0 fi log "Installing Oh My Zsh..." if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; then error "Failed to install Oh My Zsh" - return 1 fi register_completed_step "Oh My Zsh" @@ -130,7 +128,6 @@ install_node_using_n() { if [ -d "$HOME/local/n/versions/node" ]; then log "Node.js is already installed." register_completed_step "Node.js (already installed)" - return 0 else log "Installing Node.js..." if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s 22)"; then @@ -143,10 +140,9 @@ install_node_using_n() { # Install Deno runtime install_deno() { - if [ -d "$HOME/.deno/bin/deno" ]; then + if [ -f "$HOME/.deno/bin/deno" ] || command -v deno >/dev/null 2>&1; then log "Deno is already installed.." register_completed_step "Deno (already installed)" - return 0 else log "Installing Deno" if ! sh -c "$(curl -fsSL https://deno.land/install.sh)"; then @@ -190,7 +186,7 @@ setup_brew() { # Install global NPM packages install_pkg_global() { log "Installing global npm packages..." - npm install -g git-cz n fastify-cli npm-check-updates + npm install -g git-cz fastify-cli npm-check-updates node-notifier-cli register_completed_step "NPM packages" log "NPM packages installed successfully!" } @@ -211,18 +207,16 @@ setup_npm() { # Custom fonts setup_fonts() { - local font_dir="$HOME/.local/share/fonts" - if [ ! -d "$font_dir" ]; then - mkdir -p "$font_dir" - fi - log "Installing fonts for Linux..." - cp "$DIR/extras/fonts/"* "$font_dir/" - fc-cache -f -v - register_completed_step "Fonts" - log "Fonts installed successfully!" - else - error "Error installing fonts" + local font_dir="$HOME/.local/share/fonts" + if [ ! -d "$font_dir" ]; then + mkdir -p "$font_dir" fi + copy_dir "$DIR/extras/fonts" "$font_dir" + log "Installing fonts for Linux..." + fc-cache -f -v + + register_completed_step "Fonts" + log "Fonts installed successfully!" } ask_continue() { diff --git a/linux/zsh/aliases.zsh b/linux/zsh/aliases.zsh index ed933ba..560d5ae 100755 --- a/linux/zsh/aliases.zsh +++ b/linux/zsh/aliases.zsh @@ -5,7 +5,7 @@ alias reload="omz reload" alias custom-alias="$EDITOR ~/.oh-my-zsh/custom/aliases.zsh" # local development -alias server="python -m SimpleHTTPServer" +alias server="python3 -m http.server" alias serveo="ssh -R 80:localhost:3000 serveo.net" # https://paulbrowne.xyz/https-localhost @@ -55,7 +55,7 @@ alias dcl='docker-compose logs' #logs with docker-composer alias dcp='docker-compose -f docker-compose.dependencies.yaml up -d' #start dependencies with docker-composer # utils -alias fs="stat -f \"%z bytes\"" +alias fs='stat -c "%s bytes"' alias chmox='chmod -x' alias where=which alias killnode="killall -9 node" From 9fba2cafa554e17d1458a21d6d032e681842d059 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Thu, 19 Jun 2025 05:46:00 -0300 Subject: [PATCH 06/23] refactor: change to install homebrew --- install_linux | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/install_linux b/install_linux index 3b78b45..d780f1e 100644 --- a/install_linux +++ b/install_linux @@ -99,12 +99,19 @@ copy_file() { # Install Homebrew install_brew() { - if ! command -v brew >/dev/null 2>&1; then - log "Installing Homebrew..." - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - else + if command -v brew >/dev/null 2>&1; then log "Homebrew is already installed." + register_completed_step "Homebrew (already installed)" + return + fi + + log "Installing Homebrew..." + if ! /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; then + error "Failed to install Homebrew" fi + + register_completed_step "Homebrew" + log "Homebrew installed successfully!" } # Install Oh My Zsh From 1a6ae50ca42b79344ca819637e17e30b62239fbe Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Thu, 19 Jun 2025 06:02:07 -0300 Subject: [PATCH 07/23] feat: set git commit template and autoSetupRemote --- git/.git-commit-template | 17 +++++++++++++++++ git/.gitconfig | 6 ++++++ install_linux | 1 + 3 files changed, 24 insertions(+) create mode 100644 git/.git-commit-template diff --git a/git/.git-commit-template b/git/.git-commit-template new file mode 100644 index 0000000..02d0a4c --- /dev/null +++ b/git/.git-commit-template @@ -0,0 +1,17 @@ +# Title (maximum 50 characters) +# +# Briefly and imperatively describe the change made + +# Blank line + +# Message body (maximum 72 characters per line) +# +# Explain what and why, not just how. If necessary, provide context, +# motivations, and the impact of the change. Use as many lines as needed. + +# Blank line + +# Footer (optional) +# +# Reference issues, pull requests, or breaking changes, if applicable. +# Example: Closes #123, Related to #456 diff --git a/git/.gitconfig b/git/.gitconfig index 53126c1..6af10af 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -13,6 +13,12 @@ [init] defaultBranch = main +[push] + autoSetupRemote = true + +[commit] + template = ~/.git-commit-template + [alias] ci = commit br = branch diff --git a/install_linux b/install_linux index d780f1e..3cedd59 100644 --- a/install_linux +++ b/install_linux @@ -165,6 +165,7 @@ setup_git() { copy_file "$DIR/git/.gitconfig" "$HOME/.gitconfig" copy_file "$DIR/git/.gitignore" "$HOME/.gitignore" copy_file "$DIR/git/.gitattributes" "$HOME/.gitattributes" + copy_file "$DIR/git/.git-commit-template" "$HOME/.git-commit-template" register_completed_step "Git" log "Git configured successfully!" } From 12f5654db190ab3a9713a0db8edec788e272ab5a Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Thu, 19 Jun 2025 06:26:32 -0300 Subject: [PATCH 08/23] refactor: remove cask --- linux/Brewfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/linux/Brewfile b/linux/Brewfile index 83695bf..38f4dd7 100644 --- a/linux/Brewfile +++ b/linux/Brewfile @@ -1,6 +1,4 @@ -tap "espanso/espanso" tap "homebrew/bundle" -tap "localsend/localsend" brew "xz" brew "zstd" brew "libtiff" @@ -27,10 +25,3 @@ brew "pyenv" brew "python-argcomplete" brew "qemu" brew "yarn" -cask "balenaetcher" -cask "espanso" -cask "ghostty" -cask "latest" -cask "localsend" -cask "mark-text" -cask "yaak" From 3a25657bafc3fbe5eaa3b63ec2c0fbc6ebc7a9bc Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Thu, 19 Jun 2025 06:26:59 -0300 Subject: [PATCH 09/23] feat: download and install yaak http client --- install_linux | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/install_linux b/install_linux index 3cedd59..bdf0744 100644 --- a/install_linux +++ b/install_linux @@ -227,6 +227,37 @@ setup_fonts() { log "Fonts installed successfully!" } +# Install Yaak via deb package +install_yaak() { + local yaak_url="https://github.com/mountain-loop/yaak/releases/download/v2025.4.0/yaak_2025.4.0_amd64.deb" #latest version at 2025.06.19 + + if [ ! -d "/tmp" ]; then + mkdir -p "/tmp" + fi + + local tmp_folder="/tmp" + local tmp_file="$tmp_folder/yaak-x86_64.deb" + + log "Downloading Yaak..." + if ! curl -L "$yaak_url" -o "$tmp_folder"; then + error "Failed to download Yaak." + fi + + log "Installing Yaak..." + if ! sudo dpkg -i "$tmp_file"; then + error "Failed to install Yaak." + fi + + + log "Removing temporary files..." + rm -rf "$tmp_folder" + log "Temporary files removed." + + register_completed_step "Yaak" + log "Yaak installed successfully! Execute 'yaak' to open." + +} + ask_continue() { local message="$1" local step="$2" @@ -269,6 +300,7 @@ main() { echo "8. Configure NPM" echo "9. Install global NPM packages" echo "10. Configure the fonts" + echo "11. Install Yaak (optional)" ask_continue "Do you want to start the installation?" "0" || exit 0 @@ -304,7 +336,7 @@ main() { setup_npm fi - if ask_continue "Install global NPM packages (git-cz, n, fastify-cli, npm-check-updates)" "9"; then + if ask_continue "Install global some NPM packages" "9"; then install_pkg_global fi @@ -312,6 +344,10 @@ main() { setup_fonts fi + if ask_continue "Install Yaak (HTTP Client GUI)?" "11"; then + install_yaak + fi + log "Configurations completed successfully! 🎉" log "Steps executed:" for step in "${completed_steps[@]}"; do From fb224fd4af7b5f8ac6eb6cf17fdd07b072b86c19 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Thu, 19 Jun 2025 06:48:06 -0300 Subject: [PATCH 10/23] refactor: adjust to gemini review --- git/.gitconfig | 4 +- install_linux | 84 ++++++++++--------- linux/zsh/.zshrc | 10 +-- linux/zsh/aliases.zsh | 64 -------------- zsh/aliases.zsh | 63 +++++++------- .../custom-functions.plugin.zsh | 2 +- 6 files changed, 80 insertions(+), 147 deletions(-) delete mode 100755 linux/zsh/aliases.zsh diff --git a/git/.gitconfig b/git/.gitconfig index 6af10af..532d94f 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -1,6 +1,6 @@ [user] - name = "" - email = "" + name = "" # e.g. Tiago Celestino + email = "" # e.g. your.email@provider.com [mergetool] keepBackup = true diff --git a/install_linux b/install_linux index bdf0744..fe53712 100644 --- a/install_linux +++ b/install_linux @@ -119,6 +119,7 @@ install_oh_my_zsh() { if [ -d "$HOME/.oh-my-zsh" ]; then log "Oh My Zsh is already installed." register_completed_step "Oh My Zsh (already installed)" + return fi log "Installing Oh My Zsh..." @@ -135,6 +136,7 @@ install_node_using_n() { if [ -d "$HOME/local/n/versions/node" ]; then log "Node.js is already installed." register_completed_step "Node.js (already installed)" + return else log "Installing Node.js..." if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s 22)"; then @@ -150,6 +152,7 @@ install_deno() { if [ -f "$HOME/.deno/bin/deno" ] || command -v deno >/dev/null 2>&1; then log "Deno is already installed.." register_completed_step "Deno (already installed)" + return else log "Installing Deno" if ! sh -c "$(curl -fsSL https://deno.land/install.sh)"; then @@ -160,6 +163,44 @@ install_deno() { fi } +# Install global NPM packages +install_pkg_global() { + log "Installing global npm packages..." + npm install -g git-cz fastify-cli npm-check-updates node-notifier-cli + register_completed_step "NPM packages" + log "NPM packages installed successfully!" +} + +# Install Yaak via deb package +install_yaak() { + local yaak_url="https://github.com/mountain-loop/yaak/releases/download/v2025.4.0/yaak_2025.4.0_amd64.deb" #latest version at 2025.06.19 + + if [ ! -d "/tmp" ]; then + mkdir -p "/tmp" + fi + + local tmp_folder="/tmp" + local tmp_file="$tmp_folder/yaak-x86_64.deb" + + log "Downloading Yaak..." + if ! curl -L "$yaak_url" -o "$tmp_file"; then + error "Failed to download Yaak." + fi + + log "Installing Yaak..." + if ! sudo dpkg -i "$tmp_file"; then + error "Failed to install Yaak." + fi + + + log "Removing temporary files..." + rm -f "$tmp_file" + log "Temporary files removed." + + register_completed_step "Yaak" + log "Yaak installed successfully!" +} + # Configure Git settings setup_git() { copy_file "$DIR/git/.gitconfig" "$HOME/.gitconfig" @@ -174,8 +215,9 @@ setup_git() { setup_zsh() { copy_file "$DIR/linux/zsh/.zshrc" "$HOME/.zshrc" copy_dir "$DIR/zsh/themes" "$HOME/.oh-my-zsh/themes" - copy_file "$DIR/linux/zsh/aliases.zsh" "$HOME/.oh-my-zsh/custom/aliases.zsh" # TODO: use aliases.zsh on macos too + copy_file "$DIR/zsh/aliases.zsh" "$HOME/.oh-my-zsh/custom/aliases.zsh" copy_dir "$DIR/zsh/custom-functions" "$HOME/.oh-my-zsh/plugins/custom-functions" + register_completed_step "Zsh" log "Zsh configured successfully!" } @@ -191,14 +233,6 @@ setup_brew() { log "Homebrew configured successfully!" } -# Install global NPM packages -install_pkg_global() { - log "Installing global npm packages..." - npm install -g git-cz fastify-cli npm-check-updates node-notifier-cli - register_completed_step "NPM packages" - log "NPM packages installed successfully!" -} - # Configure NPM settings and install global packages setup_npm() { copy_file "$DIR/.npmrc" "$HOME/.npmrc" @@ -208,6 +242,7 @@ setup_npm() { # Install npm globally without sudo. Based on https://github.com/sindresorhus/guides/blob/main/npm-global-without-sudo.md if [ -d "$HOME/.npm-packages" ]; then log ".npm-packages folder exists" + return else mkdir -p "$HOME/.npm-packages" fi @@ -227,37 +262,6 @@ setup_fonts() { log "Fonts installed successfully!" } -# Install Yaak via deb package -install_yaak() { - local yaak_url="https://github.com/mountain-loop/yaak/releases/download/v2025.4.0/yaak_2025.4.0_amd64.deb" #latest version at 2025.06.19 - - if [ ! -d "/tmp" ]; then - mkdir -p "/tmp" - fi - - local tmp_folder="/tmp" - local tmp_file="$tmp_folder/yaak-x86_64.deb" - - log "Downloading Yaak..." - if ! curl -L "$yaak_url" -o "$tmp_folder"; then - error "Failed to download Yaak." - fi - - log "Installing Yaak..." - if ! sudo dpkg -i "$tmp_file"; then - error "Failed to install Yaak." - fi - - - log "Removing temporary files..." - rm -rf "$tmp_folder" - log "Temporary files removed." - - register_completed_step "Yaak" - log "Yaak installed successfully! Execute 'yaak' to open." - -} - ask_continue() { local message="$1" local step="$2" diff --git a/linux/zsh/.zshrc b/linux/zsh/.zshrc index 6f453c6..9d9c00f 100644 --- a/linux/zsh/.zshrc +++ b/linux/zsh/.zshrc @@ -16,19 +16,19 @@ export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" #export PATH=$PATH:~/.composer/vendor/bin # enable this if you are using composer # github -export GH_TOKEN="" # create token at https://github.com/settings/apps select "Personal access tokens" +export GH_TOKEN="" # create token at https://github.com/settings/apps select "Personal access tokens" # ssh export SSH_KEY_PATH="~/.ssh/id_ed25519" # node and npm export NODE_ENV="development" -export NPM_TOKEN="" -export NPM_SCOPE="" # e.g. tcelestino +export NPM_TOKEN="" # create token at https://www.npmjs.com/settings/tokens +export NPM_SCOPE="" # e.g. tcelestino # local -export USER_NAME="" -export USER_EMAIL="" +export USER_NAME="" # e.g. tcelestino +export USER_EMAIL="" # e.g. your.email@provider.com # preferred editor for local and remote sessions if [[ -n $SSH_CONNECTION ]]; then diff --git a/linux/zsh/aliases.zsh b/linux/zsh/aliases.zsh deleted file mode 100755 index 560d5ae..0000000 --- a/linux/zsh/aliases.zsh +++ /dev/null @@ -1,64 +0,0 @@ -# oh-my-zsh -alias zshconfig="$EDITOR ~/.zshrc" -alias ohmyzsh="$EDITOR ~/.oh-my-zsh" -alias reload="omz reload" -alias custom-alias="$EDITOR ~/.oh-my-zsh/custom/aliases.zsh" - -# local development -alias server="python3 -m http.server" -alias serveo="ssh -R 80:localhost:3000 serveo.net" - -# https://paulbrowne.xyz/https-localhost -alias https-server='http-server --ssl --cert ~/.ssl/localhost.crt --key ~/.ssl/localhost.key -a localhost -o' - -# npm -alias npm-i='npm install' -alias npm-is='npm install --save' -alias npm-id='npm install --save-dev' -alias npm-ig='npm install --global' -alias npm-start='npm start' -alias npm-test='npm test' -alias npm-it='npm install && npm test' -alias npm-lk='npm link' -alias npm-run='npm run' -alias npm-ri='rm -rf node_modules && npm i' -alias npm-reset='rm -rf node_modules && rm -f package-lock.json && npm install && npx node-notifier-cli -t "Done" -m "npm modules reinstalled" -s Glass -i https://cdn.rawgit.com/npm/logos/31945b5c/npm%20square/n-64.png' - -# git-cz -alias commit="git-cz --disable-emoji" -alias commitall="git add . && git-cz --disable-emoji" - -# directory -alias downloads='cd ~/Downloads/' -alias work=open_work_folder - -# mv, rm, cp -alias mv='mv -v' -alias rm='rm -i -v' -alias cp='cp -v' -alias rd="rmdir" -alias del="rm -i" - -# docker -alias docker-rmi='docker rmi $(docker images -q)' # delete all images -alias docker-rmiu='docker rmi $(docker images -q -f dangling=true)' # delete all untagged images -alias docker-rmus='docker rm $(docker ps -a -q)' # delete all stopped images -alias docker-stop='docker stop $(docker ps -aq)' # stop all container -alias docker-ch='export DOCKER_HOST=' - -# docker-compose -alias dcu='docker-compose up' #start with docker-composer -alias dcd='docker-compose down' #stop with docker-composer -alias dcr='docker-compose restart' #restart with docker-composer -alias dcb='docker-compose build' #build with docker-composer -alias dcl='docker-compose logs' #logs with docker-composer -alias dcp='docker-compose -f docker-compose.dependencies.yaml up -d' #start dependencies with docker-composer - -# utils -alias fs='stat -c "%s bytes"' -alias chmox='chmod -x' -alias where=which -alias killnode="killall -9 node" -alias what_shell=ps -p $$ -o pid,comm= # show current shell -alias checkport=checkPort -alias killport=killPort diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 990f489..40e359c 100755 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -5,12 +5,11 @@ alias reload="omz reload" alias custom-alias="$EDITOR ~/.oh-my-zsh/custom/aliases.zsh" # local development -alias server="python -m SimpleHTTPServer" +alias server="python3 -m http.server" alias serveo="ssh -R 80:localhost:3000 serveo.net" -alias redis-start="/opt/homebrew/opt/redis/bin/redis-server /opt/homebrew/etc/redis.conf" #start redis # https://paulbrowne.xyz/https-localhost -alias https-server='http-server --ssl --cert ~/.ssl/localhost.crt --key ~/.ssl/localhost.key -a localhost -o' +alias https-server="http-server --ssl --cert ~/.ssl/localhost.crt --key ~/.ssl/localhost.key -a localhost -o" # npm alias npm-i='npm install' @@ -22,51 +21,45 @@ alias npm-test='npm test' alias npm-it='npm install && npm test' alias npm-lk='npm link' alias npm-run='npm run' -alias npm-reset='rm -rf node_modules && rm -f package-lock.json && npm install && npx node-notifier-cli -t "Done" -m "npm modules reinstalled" -s Glass -i https://cdn.rawgit.com/npm/logos/31945b5c/npm%20square/n-64.png' alias npm-ri='rm -rf node_modules && npm i' +alias npm-reset='rm -rf node_modules && rm -f package-lock.json && npm install && npx node-notifier-cli -t "Done" -m "npm modules reinstalled" -s Glass -i https://cdn.rawgit.com/npm/logos/31945b5c/npm%20square/n-64.png' -# git +# git-cz alias commit="git-cz --disable-emoji" alias commitall="git add . && git-cz --disable-emoji" -# mac -alias shutdown="sudo shutdown -h now" -alias hosts="sudo $EDITOR /etc/hosts" -alias dns_clear="dscacheutil -flushcache" - # directory -alias downloads='cd ~/Downloads/' -alias projects='cd ~/Projects/' -alias work='cd ~/work' +alias downloads="cd ~/Downloads" +alias work=workFolder # mv, rm, cp -alias mv='mv -v' -alias rm='rm -i -v' -alias cp='cp -v' +alias mv="mv -v" +alias rm="rm -i -v" +alias cp="cp -v" alias rd="rmdir" alias del="rm -i" -alias cl="clear" -alias -- -="cd -" - # docker -alias dockercleand='docker rmi $(docker images -q)' # delete all images -alias dockercleanu='docker rmi $(docker images -q -f dangling=true)' # delete all untagged images -alias dockercleans='docker rm $(docker ps -a -q)' # delete all stopped images -alias dockerstop='docker stop $(docker ps -aq)' # stop all container -alias dcu='docker-compose up' #start with docker-composer -alias dcd='docker-compose down' #stop with docker-composer -alias dcr='docker-compose restart' #restart with docker-composer -alias dcb='docker-compose build' #build with docker-composer -alias dcl='docker-compose logs' #logs with docker-composer -alias dcp='docker-compose -f docker-compose.dependencies.yaml up -d' #start dependencies with docker-composer -alias docker_hostclean='export DOCKER_HOST=' # clean DOCKER_HOST +alias docker-rmi="docker rmi $(docker images -q)" # delete all images +alias docker-rmiu="docker rmi $(docker images -q -f dangling=true)" # delete all untagged images +alias docker-rmus="docker rm $(docker ps -a -q)" # delete all stopped images +alias docker-stop="docker stop $(docker ps -aq)" # stop all container +alias docker-ch="export DOCKER_HOST=" + +# docker-compose +alias dcu="docker-compose up" #start with docker-compose +alias dcd="docker-compose down" #stop with docker-compose +alias dcdv="docker-compose down -v" #stop with docker-compose and remove volumes +alias dcr="docker-compose restart" #restart with docker-compose +alias dcb="docker-compose build" #build with docker-compose +alias dcl="docker-compose logs" #logs with docker-compose +alias dcp="docker-compose -f docker-compose.dependencies.yaml up -d" #start dependencies with docker-compose -alias fs="stat -f \"%z bytes\"" -alias chmox='chmod -x' +# utils +alias fs="stat -c "%s bytes"" +alias chmox="chmod -x" alias where=which alias killnode="killall -9 node" - -alias checkport=checkPort # use my zsh custom plugin -alias killport=killPort # use my zsh custom plugin alias what_shell=ps -p $$ -o pid,comm= # show current shell +alias checkport=checkPort +alias killport=killPort diff --git a/zsh/custom-functions/custom-functions.plugin.zsh b/zsh/custom-functions/custom-functions.plugin.zsh index dcdc9d1..0c82182 100755 --- a/zsh/custom-functions/custom-functions.plugin.zsh +++ b/zsh/custom-functions/custom-functions.plugin.zsh @@ -69,7 +69,7 @@ function logprocess() { } # open work folder -function open_work_folder() { +function workFolder() { if [ -d ~/Projects ]; then cd ~/Projects elif [ -d ~/projects ]; then From 95fac37386ba6afa5fbbade9fe676c6b79029d54 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Sat, 12 Jul 2025 07:48:27 -0300 Subject: [PATCH 11/23] feat: add deno and homebrew settings --- linux/zsh/.zshrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux/zsh/.zshrc b/linux/zsh/.zshrc index 9d9c00f..dd29518 100644 --- a/linux/zsh/.zshrc +++ b/linux/zsh/.zshrc @@ -43,4 +43,10 @@ ZSH_WEB_SEARCH_ENGINES=( linkedin "https://www.linkedin.com/search/results/all/?keywords=" ) +# deno settings +. "$HOME/.deno/env" + +# homebrew +eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + source $ZSH/oh-my-zsh.sh From da6d258387a4dafdef981b321a90a53986885ae3 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Sat, 12 Jul 2025 07:48:50 -0300 Subject: [PATCH 12/23] refactor: changes to install zsh --- install_linux | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/install_linux b/install_linux index fe53712..cff7e66 100644 --- a/install_linux +++ b/install_linux @@ -114,8 +114,27 @@ install_brew() { log "Homebrew installed successfully!" } +# Install Zsh +install_zsh() { + if command -v zsh >/dev/null 2>&1; then + log "Zsh is already installed." + register_completed_step "Zsh (already installed)" + return + fi + log "Installing Zsh..." + if ! sudo apt update && sudo apt install zsh; then + error "Failed to install Zsh" + fi + register_completed_step "Zsh" + log "Zsh installed successfully!" +} + # Install Oh My Zsh install_oh_my_zsh() { + if ! command -v zsh >/dev/null 2>&1; then + install_zsh + fi + if [ -d "$HOME/.oh-my-zsh" ]; then log "Oh My Zsh is already installed." register_completed_step "Oh My Zsh (already installed)" @@ -267,13 +286,13 @@ ask_continue() { local step="$2" echo -e "\n${GREEN}[INFO]${NC} Step $step: $message" echo -e "${GREEN}[INFO]${NC} Options:" - echo -e " ${GREEN}[s]${NC} - Yes, continue" + echo -e " ${GREEN}[y]${NC} - Yes, continue" echo -e " ${GREEN}[n]${NC} - No, skip this step" echo -e " ${GREEN}[q]${NC} - Exit installation" - read -p "Your choice (s/n/q): " response + read -p "Your choice (y/n/q): " response case "$response" in - [Ss]*) + [Yy]*) return 0 ;; [Nn]*) From 165d6f360126c286ab0919221e86db9b616613f7 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Sat, 12 Jul 2025 07:50:09 -0300 Subject: [PATCH 13/23] feat: switch to execute file --- install_linux | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 install_linux diff --git a/install_linux b/install_linux old mode 100644 new mode 100755 From ad6ee44101994fdf82c6658fd5660e171777beed Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Sun, 13 Jul 2025 12:58:35 -0300 Subject: [PATCH 14/23] chore: remove installation step --- install_linux | 2 -- 1 file changed, 2 deletions(-) diff --git a/install_linux b/install_linux index cff7e66..be6c649 100755 --- a/install_linux +++ b/install_linux @@ -325,8 +325,6 @@ main() { echo "10. Configure the fonts" echo "11. Install Yaak (optional)" - ask_continue "Do you want to start the installation?" "0" || exit 0 - if ask_continue "Install Oh My Zsh" "1"; then install_oh_my_zsh fi From 634afa37bf9a3bddd9aaade90dc8d352d0b3324a Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Sun, 13 Jul 2025 13:06:12 -0300 Subject: [PATCH 15/23] refactor: install zsh before oh-my-zsh --- install_linux | 89 ++++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/install_linux b/install_linux index be6c649..34f53b2 100755 --- a/install_linux +++ b/install_linux @@ -114,40 +114,36 @@ install_brew() { log "Homebrew installed successfully!" } -# Install Zsh +# Install zsh install_zsh() { if command -v zsh >/dev/null 2>&1; then - log "Zsh is already installed." - register_completed_step "Zsh (already installed)" + log "zsh is already installed." + register_completed_step "zsh (already installed)" return fi - log "Installing Zsh..." + log "Installing zsh..." if ! sudo apt update && sudo apt install zsh; then - error "Failed to install Zsh" + error "Failed to install zsh" fi - register_completed_step "Zsh" - log "Zsh installed successfully!" + register_completed_step "zsh" + log "zsh installed successfully!" } -# Install Oh My Zsh +# Install oh-my-zsh install_oh_my_zsh() { - if ! command -v zsh >/dev/null 2>&1; then - install_zsh - fi - if [ -d "$HOME/.oh-my-zsh" ]; then - log "Oh My Zsh is already installed." - register_completed_step "Oh My Zsh (already installed)" + log "oh-my-zsh is already installed." + register_completed_step "oh-my-zsh (already installed)" return fi - log "Installing Oh My Zsh..." + log "Installing oh-my-zsh..." if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; then - error "Failed to install Oh My Zsh" + error "Failed to install oh-my-zsh" fi - register_completed_step "Oh My Zsh" - log "Oh My Zsh installed successfully!" + register_completed_step "oh-my-zsh" + log "oh-my-zsh installed successfully!" } # Install Node.js @@ -313,62 +309,67 @@ ask_continue() { main() { log "Starting installation from $DIR..." log "This script will configure your environment with the following steps:" - echo -e "\n1. Install Oh My Zsh" - echo "2. Install Homebrew" - echo "3. Install Node.js" - echo "4. Install Deno" - echo "5. Configure Zsh" - echo "6. Configure Homebrew and install packages" - echo "7. Configure Git" - echo "8. Configure NPM" - echo "9. Install global NPM packages" - echo "10. Configure the fonts" - echo "11. Install Yaak (optional)" - - if ask_continue "Install Oh My Zsh" "1"; then + echo "1. Install zsh" + echo "2. Install oh-my-zsh" + echo "3. Install Homebrew" + echo "4. Install Node.js" + echo "5. Install Deno" + echo "6. Install Yaak (HTTP Client GUI)" + echo "7. Configure Zsh" + echo "8. Configure Homebrew and install packages" + echo "9. Configure Git" + echo "10. Configure NPM" + echo "11. Install global NPM packages" + echo "12. Configure the fonts" + + if ask_continue "Install zsh" "1"; then + install_zsh + fi + + if ask_continue "Install oh-my-zsh" "2"; then install_oh_my_zsh fi - if ask_continue "Install Homebrew" "2"; then + if ask_continue "Install Homebrew" "3"; then install_brew fi - if ask_continue "Install Node.js" "3"; then + if ask_continue "Install Node.js" "4"; then install_node_using_n fi - if ask_continue "Install Deno" "4"; then + if ask_continue "Install Deno" "5"; then install_deno fi - if ask_continue "Configure Zsh" "5"; then + if ask_continue "Install Yaak (HTTP Client GUI)" "6"; then + install_yaak + fi + + if ask_continue "Configure Zsh" "7"; then setup_zsh fi - if ask_continue "Configure Homebrew and install packages" "6"; then + if ask_continue "Configure Homebrew and install packages" "8"; then setup_brew fi - if ask_continue "Configure Git" "7"; then + if ask_continue "Configure Git" "9"; then setup_git fi - if ask_continue "Configure NPM" "8"; then + if ask_continue "Configure NPM" "10"; then setup_npm fi - if ask_continue "Install global some NPM packages" "9"; then + if ask_continue "Install global some NPM packages" "11"; then install_pkg_global fi - if ask_continue "Configure the fonts" "10"; then + if ask_continue "Configure the fonts" "12"; then setup_fonts fi - if ask_continue "Install Yaak (HTTP Client GUI)?" "11"; then - install_yaak - fi - log "Configurations completed successfully! 🎉" log "Steps executed:" for step in "${completed_steps[@]}"; do From 2b3bca9200f4724dbd2675f01534c9b09dd7325b Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Sun, 13 Jul 2025 13:10:25 -0300 Subject: [PATCH 16/23] fix(install): run apt update and apt install zsh separately, abort on failure --- install_linux | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install_linux b/install_linux index 34f53b2..d6caa19 100755 --- a/install_linux +++ b/install_linux @@ -121,8 +121,12 @@ install_zsh() { register_completed_step "zsh (already installed)" return fi + log "Updating package list..." + if ! sudo apt update; then + error "Failed to update package list (apt update)" + fi log "Installing zsh..." - if ! sudo apt update && sudo apt install zsh; then + if ! sudo apt install -y zsh; then error "Failed to install zsh" fi register_completed_step "zsh" From b2f7a87a3cd555b489449b6256dab3a8b18e594d Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Fri, 18 Jul 2025 18:25:07 -0300 Subject: [PATCH 17/23] chore: remove iterm settings --- iterm2/Dracula.itermcolors | 225 ------------------------------------- 1 file changed, 225 deletions(-) delete mode 100644 iterm2/Dracula.itermcolors diff --git a/iterm2/Dracula.itermcolors b/iterm2/Dracula.itermcolors deleted file mode 100644 index 619da48..0000000 --- a/iterm2/Dracula.itermcolors +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - 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 - - - From 258d503c494f700f174663e0753d49d6b046471d Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Fri, 18 Jul 2025 18:26:05 -0300 Subject: [PATCH 18/23] chore: rename file --- install | 316 +++++++++++++++++++++++++++++++---------- install_linux | 384 -------------------------------------------------- 2 files changed, 238 insertions(+), 462 deletions(-) mode change 100644 => 100755 install delete mode 100755 install_linux diff --git a/install b/install old mode 100644 new mode 100755 index 0b7a3ac..d6caa19 --- a/install +++ b/install @@ -10,23 +10,29 @@ NC='\033[0m' # Get current location DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -# Helper function to print info messages +# Array to store completed steps +declare -a completed_steps=() + +# Register a completed step +# @param $1 Step name +register_completed_step() { + local step="$1" + completed_steps+=("$step") +} + +# Print info messages +# @param $1 Message log() { echo -e "${GREEN}[INFO]${NC} $1" } -# Helper function to print error messages in red and exit +# Print error messages in red and exit +# @param $1 Message error() { echo -e "${RED}[ERROR]${NC} $1" exit 1 } -# Verify if required dependencies (Node.js, Homebrew, Git) are installed -# check_dependencies() { -# command -v node >/dev/null 2>&1 || error "Node.js is required but not installed. https://nodejs.org/" -# command -v git >/dev/null 2>&1 || error "Git is required but not installed. https://git-scm.com/downloads" -# } - # Create a symbolic link # @param $1 Source file path # @param $2 Destination link path @@ -91,134 +97,288 @@ copy_file() { fi } -# Install Homebrew if not already installed +# Install Homebrew install_brew() { - if ! command -v brew >/dev/null 2>&1; then - log "Installing Homebrew..." - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - else + if command -v brew >/dev/null 2>&1; then log "Homebrew is already installed." + register_completed_step "Homebrew (already installed)" + return + fi + + log "Installing Homebrew..." + if ! /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; then + error "Failed to install Homebrew" + fi + + register_completed_step "Homebrew" + log "Homebrew installed successfully!" +} + +# Install zsh +install_zsh() { + if command -v zsh >/dev/null 2>&1; then + log "zsh is already installed." + register_completed_step "zsh (already installed)" + return fi + log "Updating package list..." + if ! sudo apt update; then + error "Failed to update package list (apt update)" + fi + log "Installing zsh..." + if ! sudo apt install -y zsh; then + error "Failed to install zsh" + fi + register_completed_step "zsh" + log "zsh installed successfully!" } -# Install Oh My Zsh if not already installed +# Install oh-my-zsh install_oh_my_zsh() { if [ -d "$HOME/.oh-my-zsh" ]; then - log "oh-my-zsh is already installed." + log "oh-my-zsh is already installed." + register_completed_step "oh-my-zsh (already installed)" + return + fi + + log "Installing oh-my-zsh..." + if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; then + error "Failed to install oh-my-zsh" + fi + + register_completed_step "oh-my-zsh" + log "oh-my-zsh installed successfully!" +} + +# Install Node.js +install_node_using_n() { + if [ -d "$HOME/local/n/versions/node" ]; then + log "Node.js is already installed." + register_completed_step "Node.js (already installed)" + return else - log "Installing oh-my-zsh..." - if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; then - error "Failed to install oh-my-zsh" - fi + log "Installing Node.js..." + if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s 22)"; then + error "Failed to install Node.js" + fi + register_completed_step "Node.js" + log "Node.js installed successfully!" fi } -# Install Deno runtime if not already installed +# Install Deno runtime install_deno() { - if [ -d "$HOME/.deno/bin/deno" ]; then + if [ -f "$HOME/.deno/bin/deno" ] || command -v deno >/dev/null 2>&1; then log "Deno is already installed.." + register_completed_step "Deno (already installed)" + return else log "Installing Deno" if ! sh -c "$(curl -fsSL https://deno.land/install.sh)"; then error "Failed to install Deno" fi + register_completed_step "Deno" + log "Deno installed successfully!" fi } -# Configure Git settings by linking gitconfig file +# Install global NPM packages +install_pkg_global() { + log "Installing global npm packages..." + npm install -g git-cz fastify-cli npm-check-updates node-notifier-cli + register_completed_step "NPM packages" + log "NPM packages installed successfully!" +} + +# Install Yaak via deb package +install_yaak() { + local yaak_url="https://github.com/mountain-loop/yaak/releases/download/v2025.4.0/yaak_2025.4.0_amd64.deb" #latest version at 2025.06.19 + + if [ ! -d "/tmp" ]; then + mkdir -p "/tmp" + fi + + local tmp_folder="/tmp" + local tmp_file="$tmp_folder/yaak-x86_64.deb" + + log "Downloading Yaak..." + if ! curl -L "$yaak_url" -o "$tmp_file"; then + error "Failed to download Yaak." + fi + + log "Installing Yaak..." + if ! sudo dpkg -i "$tmp_file"; then + error "Failed to install Yaak." + fi + + + log "Removing temporary files..." + rm -f "$tmp_file" + log "Temporary files removed." + + register_completed_step "Yaak" + log "Yaak installed successfully!" +} + +# Configure Git settings setup_git() { copy_file "$DIR/git/.gitconfig" "$HOME/.gitconfig" copy_file "$DIR/git/.gitignore" "$HOME/.gitignore" copy_file "$DIR/git/.gitattributes" "$HOME/.gitattributes" + copy_file "$DIR/git/.git-commit-template" "$HOME/.git-commit-template" + register_completed_step "Git" + log "Git configured successfully!" } -# Configure Zsh settings by linking various configuration files +# Configure Zsh settings setup_zsh() { - copy_file "$DIR/zsh/.zshrc" "$HOME/.zshrc" + copy_file "$DIR/linux/zsh/.zshrc" "$HOME/.zshrc" copy_dir "$DIR/zsh/themes" "$HOME/.oh-my-zsh/themes" copy_file "$DIR/zsh/aliases.zsh" "$HOME/.oh-my-zsh/custom/aliases.zsh" copy_dir "$DIR/zsh/custom-functions" "$HOME/.oh-my-zsh/plugins/custom-functions" + + register_completed_step "Zsh" + log "Zsh configured successfully!" } -# Install global NPM packages required for development -install_global_npm_pkg() { - log "Installing global npm packages..." - npm install -g git-cz # https://github.com/streamich/git-cz - npm install -g n # https://github.com/tj/n - npm install -g fastify-cli #https://fastify.dev/ +# Configure Homebrew and install packages from Brewfile +setup_brew() { + copy_file "$DIR/linux/Brewfile" "$HOME/Brewfile" + log "Executing brew bundle install..." + if ! brew bundle install; then + error "Brew bundle install failed" + fi + register_completed_step "Homebrew" + log "Homebrew configured successfully!" } # Configure NPM settings and install global packages setup_npm() { copy_file "$DIR/.npmrc" "$HOME/.npmrc" + register_completed_step "NPM" + log "NPM configured successfully!" # Install npm globally without sudo. Based on https://github.com/sindresorhus/guides/blob/main/npm-global-without-sudo.md if [ -d "$HOME/.npm-packages" ]; then log ".npm-packages folder exists" + return else mkdir -p "$HOME/.npm-packages" fi - - install_global_npm_pkg } -# Configure Homebrew and install packages from Brewfile -setup_brew() { - copy_file "$DIR/Brewfile" "$HOME/Brewfile" - log "Executing brew bundle install..." - if ! brew bundle install; then - error "Brew bundle install failed" - fi -} - -# Install custom fonts based on the operating system +# Custom fonts setup_fonts() { - if [[ "$OSTYPE" == "darwin"* ]]; then - # macOS - local font_dir="$HOME/Library/Fonts" - if [ ! -d "$font_dir" ]; then - mkdir -p "$font_dir" - fi - log "Installing fonts for macOS..." - cp "$DIR/extras/fonts/"* "$font_dir/" - elif [[ "$OSTYPE" == "linux-gnu"* ]]; then - # Ubuntu/Linux - local font_dir="$HOME/.local/share/fonts" - if [ ! -d "$font_dir" ]; then - mkdir -p "$font_dir" - fi - log "Installing fonts for Linux..." - cp "$DIR/extras/fonts/"* "$font_dir/" - fc-cache -f -v - else - error "Unsupported operating system" + local font_dir="$HOME/.local/share/fonts" + if [ ! -d "$font_dir" ]; then + mkdir -p "$font_dir" fi + copy_dir "$DIR/extras/fonts" "$font_dir" + log "Installing fonts for Linux..." + fc-cache -f -v + + register_completed_step "Fonts" + log "Fonts installed successfully!" } -# Configure macOS system settings if running on macOS -setup_macos() { - if [[ "$OSTYPE" == "darwin"* ]]; then - log "Setting up macOS..." - sh .macos - copy_file "$DIR/extras/duti_picview.config" "$HOME/duti_picview.config" # Configure duti (macOS default application manager) settings - fi +ask_continue() { + local message="$1" + local step="$2" + echo -e "\n${GREEN}[INFO]${NC} Step $step: $message" + echo -e "${GREEN}[INFO]${NC} Options:" + echo -e " ${GREEN}[y]${NC} - Yes, continue" + echo -e " ${GREEN}[n]${NC} - No, skip this step" + echo -e " ${GREEN}[q]${NC} - Exit installation" + read -p "Your choice (y/n/q): " response + + case "$response" in + [Yy]*) + return 0 + ;; + [Nn]*) + log "Step $step skipped." + return 1 + ;; + [Qq]*) + log "Installation interrupted by user." + exit 0 + ;; + *) + log "Invalid option. Please try again." + ask_continue "$message" "$step" + ;; + esac } main() { log "Starting installation from $DIR..." + log "This script will configure your environment with the following steps:" + echo "1. Install zsh" + echo "2. Install oh-my-zsh" + echo "3. Install Homebrew" + echo "4. Install Node.js" + echo "5. Install Deno" + echo "6. Install Yaak (HTTP Client GUI)" + echo "7. Configure Zsh" + echo "8. Configure Homebrew and install packages" + echo "9. Configure Git" + echo "10. Configure NPM" + echo "11. Install global NPM packages" + echo "12. Configure the fonts" + + if ask_continue "Install zsh" "1"; then + install_zsh + fi + + if ask_continue "Install oh-my-zsh" "2"; then + install_oh_my_zsh + fi + + if ask_continue "Install Homebrew" "3"; then + install_brew + fi + + if ask_continue "Install Node.js" "4"; then + install_node_using_n + fi - install_oh_my_zsh - install_brew - install_deno + if ask_continue "Install Deno" "5"; then + install_deno + fi + + if ask_continue "Install Yaak (HTTP Client GUI)" "6"; then + install_yaak + fi + + if ask_continue "Configure Zsh" "7"; then + setup_zsh + fi - setup_zsh - setup_brew - setup_git - setup_npm - setup_macos - setup_fonts + if ask_continue "Configure Homebrew and install packages" "8"; then + setup_brew + fi + + if ask_continue "Configure Git" "9"; then + setup_git + fi + + if ask_continue "Configure NPM" "10"; then + setup_npm + fi + + if ask_continue "Install global some NPM packages" "11"; then + install_pkg_global + fi + + if ask_continue "Configure the fonts" "12"; then + setup_fonts + fi - log "Settings completed successfully! 🎉" + log "Configurations completed successfully! 🎉" + log "Steps executed:" + for step in "${completed_steps[@]}"; do + echo "- $step" + done } main "$@" diff --git a/install_linux b/install_linux deleted file mode 100755 index d6caa19..0000000 --- a/install_linux +++ /dev/null @@ -1,384 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# Colors for output -RED='\033[0;31m' -GREEN='\033[0;32m' -NC='\033[0m' - -# Get current location -DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) - -# Array to store completed steps -declare -a completed_steps=() - -# Register a completed step -# @param $1 Step name -register_completed_step() { - local step="$1" - completed_steps+=("$step") -} - -# Print info messages -# @param $1 Message -log() { - echo -e "${GREEN}[INFO]${NC} $1" -} - -# Print error messages in red and exit -# @param $1 Message -error() { - echo -e "${RED}[ERROR]${NC} $1" - exit 1 -} - -# Create a symbolic link -# @param $1 Source file path -# @param $2 Destination link path -safe_link() { - local src="$1" - local dest="$2" - - if [ -e "$dest" ] || [ -L "$dest" ]; then - log "Found $dest - removing..." - rm -f "$dest" - fi - - if [ ! -e "$src" ]; then - error "Source file $src does not exist!" - fi - - log "Linking $dest to $src" - ln -s "$src" "$dest" -} - -# Copy a directory -# @param $1 Source directory path -# @param $2 Destination directory path -copy_dir() { - local src="$1" - local dest="$2" - - if [ ! -d "$src" ]; then - error "Source directory $src does not exist!" - fi - - if [ -d "$dest" ]; then - log "Found $dest - renaming..." - mv "$dest" "$dest.old" - fi - - log "Copying directory $src to $dest" - if ! cp -R "$src" "$dest"; then - error "Failed to copy directory $src to $dest" - fi -} - -# Copy a file -# @param $1 Source file path -# @param $2 Destination file path -copy_file() { - local src="$1" - local dest="$2" - - if [ ! -f "$src" ]; then - error "Source file $src does not exist!" - fi - - if [ -f "$dest" ]; then - log "Found $dest - renaming..." - mv "$dest" "$dest.old" - fi - - log "Copying file $src to $dest" - if ! cp "$src" "$dest"; then - error "Failed to copy file $src to $dest" - fi -} - -# Install Homebrew -install_brew() { - if command -v brew >/dev/null 2>&1; then - log "Homebrew is already installed." - register_completed_step "Homebrew (already installed)" - return - fi - - log "Installing Homebrew..." - if ! /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; then - error "Failed to install Homebrew" - fi - - register_completed_step "Homebrew" - log "Homebrew installed successfully!" -} - -# Install zsh -install_zsh() { - if command -v zsh >/dev/null 2>&1; then - log "zsh is already installed." - register_completed_step "zsh (already installed)" - return - fi - log "Updating package list..." - if ! sudo apt update; then - error "Failed to update package list (apt update)" - fi - log "Installing zsh..." - if ! sudo apt install -y zsh; then - error "Failed to install zsh" - fi - register_completed_step "zsh" - log "zsh installed successfully!" -} - -# Install oh-my-zsh -install_oh_my_zsh() { - if [ -d "$HOME/.oh-my-zsh" ]; then - log "oh-my-zsh is already installed." - register_completed_step "oh-my-zsh (already installed)" - return - fi - - log "Installing oh-my-zsh..." - if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; then - error "Failed to install oh-my-zsh" - fi - - register_completed_step "oh-my-zsh" - log "oh-my-zsh installed successfully!" -} - -# Install Node.js -install_node_using_n() { - if [ -d "$HOME/local/n/versions/node" ]; then - log "Node.js is already installed." - register_completed_step "Node.js (already installed)" - return - else - log "Installing Node.js..." - if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s 22)"; then - error "Failed to install Node.js" - fi - register_completed_step "Node.js" - log "Node.js installed successfully!" - fi -} - -# Install Deno runtime -install_deno() { - if [ -f "$HOME/.deno/bin/deno" ] || command -v deno >/dev/null 2>&1; then - log "Deno is already installed.." - register_completed_step "Deno (already installed)" - return - else - log "Installing Deno" - if ! sh -c "$(curl -fsSL https://deno.land/install.sh)"; then - error "Failed to install Deno" - fi - register_completed_step "Deno" - log "Deno installed successfully!" - fi -} - -# Install global NPM packages -install_pkg_global() { - log "Installing global npm packages..." - npm install -g git-cz fastify-cli npm-check-updates node-notifier-cli - register_completed_step "NPM packages" - log "NPM packages installed successfully!" -} - -# Install Yaak via deb package -install_yaak() { - local yaak_url="https://github.com/mountain-loop/yaak/releases/download/v2025.4.0/yaak_2025.4.0_amd64.deb" #latest version at 2025.06.19 - - if [ ! -d "/tmp" ]; then - mkdir -p "/tmp" - fi - - local tmp_folder="/tmp" - local tmp_file="$tmp_folder/yaak-x86_64.deb" - - log "Downloading Yaak..." - if ! curl -L "$yaak_url" -o "$tmp_file"; then - error "Failed to download Yaak." - fi - - log "Installing Yaak..." - if ! sudo dpkg -i "$tmp_file"; then - error "Failed to install Yaak." - fi - - - log "Removing temporary files..." - rm -f "$tmp_file" - log "Temporary files removed." - - register_completed_step "Yaak" - log "Yaak installed successfully!" -} - -# Configure Git settings -setup_git() { - copy_file "$DIR/git/.gitconfig" "$HOME/.gitconfig" - copy_file "$DIR/git/.gitignore" "$HOME/.gitignore" - copy_file "$DIR/git/.gitattributes" "$HOME/.gitattributes" - copy_file "$DIR/git/.git-commit-template" "$HOME/.git-commit-template" - register_completed_step "Git" - log "Git configured successfully!" -} - -# Configure Zsh settings -setup_zsh() { - copy_file "$DIR/linux/zsh/.zshrc" "$HOME/.zshrc" - copy_dir "$DIR/zsh/themes" "$HOME/.oh-my-zsh/themes" - copy_file "$DIR/zsh/aliases.zsh" "$HOME/.oh-my-zsh/custom/aliases.zsh" - copy_dir "$DIR/zsh/custom-functions" "$HOME/.oh-my-zsh/plugins/custom-functions" - - register_completed_step "Zsh" - log "Zsh configured successfully!" -} - -# Configure Homebrew and install packages from Brewfile -setup_brew() { - copy_file "$DIR/linux/Brewfile" "$HOME/Brewfile" - log "Executing brew bundle install..." - if ! brew bundle install; then - error "Brew bundle install failed" - fi - register_completed_step "Homebrew" - log "Homebrew configured successfully!" -} - -# Configure NPM settings and install global packages -setup_npm() { - copy_file "$DIR/.npmrc" "$HOME/.npmrc" - register_completed_step "NPM" - log "NPM configured successfully!" - - # Install npm globally without sudo. Based on https://github.com/sindresorhus/guides/blob/main/npm-global-without-sudo.md - if [ -d "$HOME/.npm-packages" ]; then - log ".npm-packages folder exists" - return - else - mkdir -p "$HOME/.npm-packages" - fi -} - -# Custom fonts -setup_fonts() { - local font_dir="$HOME/.local/share/fonts" - if [ ! -d "$font_dir" ]; then - mkdir -p "$font_dir" - fi - copy_dir "$DIR/extras/fonts" "$font_dir" - log "Installing fonts for Linux..." - fc-cache -f -v - - register_completed_step "Fonts" - log "Fonts installed successfully!" -} - -ask_continue() { - local message="$1" - local step="$2" - echo -e "\n${GREEN}[INFO]${NC} Step $step: $message" - echo -e "${GREEN}[INFO]${NC} Options:" - echo -e " ${GREEN}[y]${NC} - Yes, continue" - echo -e " ${GREEN}[n]${NC} - No, skip this step" - echo -e " ${GREEN}[q]${NC} - Exit installation" - read -p "Your choice (y/n/q): " response - - case "$response" in - [Yy]*) - return 0 - ;; - [Nn]*) - log "Step $step skipped." - return 1 - ;; - [Qq]*) - log "Installation interrupted by user." - exit 0 - ;; - *) - log "Invalid option. Please try again." - ask_continue "$message" "$step" - ;; - esac -} - -main() { - log "Starting installation from $DIR..." - log "This script will configure your environment with the following steps:" - echo "1. Install zsh" - echo "2. Install oh-my-zsh" - echo "3. Install Homebrew" - echo "4. Install Node.js" - echo "5. Install Deno" - echo "6. Install Yaak (HTTP Client GUI)" - echo "7. Configure Zsh" - echo "8. Configure Homebrew and install packages" - echo "9. Configure Git" - echo "10. Configure NPM" - echo "11. Install global NPM packages" - echo "12. Configure the fonts" - - if ask_continue "Install zsh" "1"; then - install_zsh - fi - - if ask_continue "Install oh-my-zsh" "2"; then - install_oh_my_zsh - fi - - if ask_continue "Install Homebrew" "3"; then - install_brew - fi - - if ask_continue "Install Node.js" "4"; then - install_node_using_n - fi - - if ask_continue "Install Deno" "5"; then - install_deno - fi - - if ask_continue "Install Yaak (HTTP Client GUI)" "6"; then - install_yaak - fi - - if ask_continue "Configure Zsh" "7"; then - setup_zsh - fi - - if ask_continue "Configure Homebrew and install packages" "8"; then - setup_brew - fi - - if ask_continue "Configure Git" "9"; then - setup_git - fi - - if ask_continue "Configure NPM" "10"; then - setup_npm - fi - - if ask_continue "Install global some NPM packages" "11"; then - install_pkg_global - fi - - if ask_continue "Configure the fonts" "12"; then - setup_fonts - fi - - log "Configurations completed successfully! 🎉" - log "Steps executed:" - for step in "${completed_steps[@]}"; do - echo "- $step" - done -} - -main "$@" From 43293984710aeaa71a99fd93f6d4680364d76ea3 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Fri, 18 Jul 2025 19:04:22 -0300 Subject: [PATCH 19/23] feat: simplify linux settings --- .macos | 525 ----------------------------------------------- Brewfile | 74 ------- README.md | 57 +++-- install | 101 ++------- linux/Brewfile | 27 --- linux/zsh/.zshrc | 52 ----- zsh/.zshrc | 39 ++-- 7 files changed, 78 insertions(+), 797 deletions(-) delete mode 100755 .macos delete mode 100644 linux/Brewfile delete mode 100644 linux/zsh/.zshrc diff --git a/.macos b/.macos deleted file mode 100755 index 676b73a..0000000 --- a/.macos +++ /dev/null @@ -1,525 +0,0 @@ -#!/usr/bin/env bash - -#~/.macos - -# based on paul irish .macos (https://github.com/paulirish/dotfiles/blob/main/.macos) - -# 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' - -# Ask for the administrator password upfront -sudo -v - -# Keep-alive: update existing `sudo` time stamp until `.osx` has finished -while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & - -# General UI/UX # -############################################################################################# - -# Set standby delay to 24 hours (default is 1 hour) -sudo pmset -a standbydelay 86400 - -# Disable the sound effects on boot -sudo nvram SystemAudioVolume=" " - -# disbale transparency menu bar -defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false - -# Disable the you sure you want to open this application dialog -defaults write com.apple.LaunchServices LSQuarantine -bool false - -# Set sidebar icon size to medium -defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2 - -# Increase window resize speed for Cocoa applications -defaults write NSGlobalDomain NSWindowResizeTime -float 0.001 - -# Adjust toolbar title rollover delay -defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0 - -# Always show scrollbars -defaults write NSGlobalDomain AppleShowScrollBars -string "Always" - -# Expand save panel by default -defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true -defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true - -# Expand print panel by default -defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true -defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true - -# Automatically quit printer app once the print jobs complete -defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true - -# Disable the “Are you sure you want to open this application?” dialog -defaults write com.apple.LaunchServices LSQuarantine -bool false - -# Remove delay when taking a screenshot -defaults write com.apple.screencapture show-thumbnail -bool false - -# Reveal IP address, hostname, OS version, etc. when clicking the clock -# in the login window -sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName - -# Remove duplicates in the “Open With” menu (also see `lscleanup` alias) -/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user - -# Disable Resume system-wide -defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false - -# Edit: ALLOW automatic termination of inactive apps -defaults write NSGlobalDomain NSDisableAutomaticTermination -bool false - -# Set Help Viewer windows to non-floating mode -defaults write com.apple.helpviewer DevMode -bool true - -# Restart automatically if the computer freezes -sudo systemsetup -setrestartfreeze on - -# go into computer sleep mode after 20min -sudo systemsetup -setcomputersleep 20 - -# Disable smart quotes as they’re annoying when typing code -defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false - -# Disable smart dashes as they’re annoying when typing code -defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false - -# Set date display in menu bar -defaults write com.apple.menuextra.clock "DateFormat" "d MMM EEE H.mm" - -# SSD-specific tweaks # -############################################################################### - -# Disable local Time Machine snapshots -sudo tmutil disablelocal - -# Disable hibernation (speeds up entering sleep mode) -sudo pmset -a hibernatemode 0 - -# Remove the sleep image file to save disk space -sudo rm /private/var/vm/sleepimage -# Create a zero-byte file instead… -sudo touch /private/var/vm/sleepimage -# …and make sure it can’t be rewritten -sudo chflags uchg /private/var/vm/sleepimage - -# Disable the sudden motion sensor as it’s not useful for SSDs -sudo pmset -a sms 0 - -# Trackpad, mouse, keyboard, Bluetooth accessories, and input # -############################################################################################# - -# Trackpad: enable tap to click for this user and for the login screen -defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true -defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 -defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 - -# Trackpad: map bottom right corner to right-click -defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2 -defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true -defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1 -defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true - -# Disable “natural” (Lion-style) scrolling -defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false - -# Increase sound quality for Bluetooth headphones/headsets -defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40 - -# mute all sounds, incl volume change feedback -defaults write "com.apple.sound.beep.feedback" -int 0 -defaults write com.apple.systemsound 'com.apple.sound.beep.volume' -float 0 -defaults write "com.apple.systemsound" "com.apple.sound.uiaudio.enabled" -int 0 - -# Enable access for assistive devices -echo -n 'a' | sudo tee /private/var/db/.AccessibilityAPIEnabled > /dev/null 2>&1 -sudo chmod 444 /private/var/db/.AccessibilityAPIEnabled - -# Enable full keyboard access for all controls -# (e.g. enable Tab in modal dialogs) -defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 - -# Use scroll gesture with the Ctrl (^) modifier key to zoom -defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true -defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144 -# Follow the keyboard focus while zoomed in -defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool false -# Zoom should use nearest neighbor instead of smoothing. -defaults write com.apple.universalaccess 'closeViewSmoothImages' -bool false - -# Disable press-and-hold for keys in favor of key repeat -defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false - -# Set a blazingly fast keyboard repeat rate -defaults write NSGlobalDomain KeyRepeat -int 1 -defaults write NSGlobalDomain InitialKeyRepeat -int 10 - -# Disable auto-correct -defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false - -# Stop iTunes from responding to the keyboard media keys -launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist 2> /dev/null - -# Screen # -############################################################################################# - -# Save screenshots to the desktop -defaults write com.apple.screencapture location -string "${HOME}/Pictures/Screenshots" - -# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF) -defaults write com.apple.screencapture type -string "jpg" - -# Disable shadow in screenshots -defaults write com.apple.screencapture disable-shadow -bool true - -# Enable subpixel font rendering on non-Apple LCDs -defaults write NSGlobalDomain AppleFontSmoothing -int 2 - -# Enable HiDPI display modes (requires restart) -sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true - -# 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 - -# Finder: show all filename extensions -defaults write NSGlobalDomain AppleShowAllExtensions -bool true - -# Disable the warning when changing a file extension -defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false - -# Finder: 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" - -# Disable the warning when changing a file extension -defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false - -# Enable spring loading for directories -defaults write NSGlobalDomain com.apple.springing.enabled -bool true - -# Show status bar -defaults write com.apple.finder ShowStatusBar -bool true - -# Remove the spring loading delay for directories -defaults write NSGlobalDomain com.apple.springing.delay -float 0 - -# Avoid creating .DS_Store files on network volumes -defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true - -# Automatically open a new Finder window when a volume is mounted -defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true -defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true -defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true - -# Increase grid spacing for icons on the desktop and in other icon views -/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist - -# Increase the size of icons on the desktop and in other icon views -/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist -/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist - -# Use list view in all Finder windows by default -# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv` -defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" - -# Empty Trash securely by default -defaults write com.apple.finder EmptyTrashSecurely -bool true - -# Disable the warning before emptying the Trash -defaults write com.apple.finder WarnOnEmptyTrash -bool false - -# Show the ~/Library folder -chflags nohidden ~/Library - -# Show the /Volumes folder -sudo chflags nohidden /Volumes - -# Expand the following File Info panes: -# “General”, “Open with”, and “Sharing & Permissions” -defaults write com.apple.finder FXInfoPanesExpanded -dict \ - General -bool true \ - OpenWith -bool true \ - Privileges -bool true - -# Dock, Dashboard, and hot corners -############################################################################################# - -# Enable highlight hover effect for the grid view of a stack (Dock) -defaults write com.apple.dock mouse-over-hilite-stack -bool true - -# Set the icon size of Dock items to 40 pixels -defaults write com.apple.dock tilesize -int 25 - -# Change minimize/maximize window effect -defaults write com.apple.dock mineffect -string "scale" - -# Minimize windows into their application’s icon -defaults write com.apple.dock minimize-to-application -bool false - -# Enable spring loading for all Dock items -defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true - -# Speed up Mission Control animations -defaults write com.apple.dock expose-animation-duration -float 0.1 - -# Don’t group windows by application in Mission Control -# (i.e. use the old Exposé behavior instead) -defaults write com.apple.dock expose-group-by-app -bool false - -# Show indicator lights for open applications in the Dock -defaults write com.apple.dock show-process-indicators -bool false - -# Don't animate opening applications from the Dock -defaults write com.apple.dock launchanim -bool false - -# Disable Dashboard -defaults write com.apple.dashboard mcx-disabled -bool true - -# Don't show Dashboard as a Space -defaults write com.apple.dock dashboard-in-overlay -bool true - -# Don’t automatically rearrange Spaces based on most recent use -defaults write com.apple.dock mru-spaces -bool false - -# Remove the auto-hiding Dock delay -defaults write com.apple.dock autohide-delay -float 0 - -# Remove the animation when hiding/showing the Dock -defaults write com.apple.dock autohide-time-modifier -float 0 - -# Automatically hide and show the Dock -defaults write com.apple.dock autohide -bool true - -# Don't make Dock icons of hidden applications translucent -defaults write com.apple.dock showhidden -bool false - -# Hide 'recent applications' from dock -defaults write com.apple.dock show-recents -bool false - -# Reset Launchpad, but keep the desktop wallpaper intact -find "${HOME}/Library/Application Support/Dock" -name "*-*.db" -maxdepth 1 -delete - -# Hot corners -# Possible values: -# 0: no-op -# 2: Mission Control -# 3: Show application windows -# 4: Desktop -# 5: Start screen saver -# 6: Disable screen saver -# 7: Dashboard -# 10: Put display to sleep -# 11: Launchpad -# 12: Notification Center - -# Top left screen corner → Put to sleep -defaults write com.apple.dock wvous-tl-corner -int 0 -defaults write com.apple.dock wvous-tl-modifier -int 0 -# Top right screen corner → no-op -defaults write com.apple.dock wvous-tr-corner -int 1 -defaults write com.apple.dock wvous-tr-modifier -int 1048576 -# Bottom left screen corner → no-op -defaults write com.apple.dock wvous-bl-corner -int 1 -defaults write com.apple.dock wvous-bl-modifier -int 1048576 -# Bottom right screen corner → no-op -defaults write com.apple.dock wvous-br-corner -int 1 -defaults write com.apple.dock wvous-br-modifier -int 1048576 - -# 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 - -# Show the full URL in the address bar -defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true - -# Set Safari's 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 - -# Allow hitting the Backspace key to go to the previous page in history -defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true - -# Show Safari's bookmarks bar by default -defaults write com.apple.Safari ShowFavoritesBar -bool true - -# Hide Safari's sidebar in Top Sites -defaults write com.apple.Safari ShowSidebarInTopSites -bool false - -# Disable Safari's thumbnail cache for History and Top Sites -defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2 - -# Enable Safari's debug menu -defaults write com.apple.Safari IncludeInternalDebugMenu -bool true - -# Make Safari’s search banners default to Contains instead of Starts With -defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false - -# 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 - -# Remove useless icons from Safari’s bookmarks bar -defaults write com.apple.Safari ProxiesInBookmarksBar "()" - -# Add a context menu item for showing the Web Inspector in web views -defaults write NSGlobalDomain WebKitDeveloperExtras -bool true - -# Do not open previous previewed files (e.g. PDFs) when opening a new one -defaults write com.apple.Preview ApplePersistenceIgnoreState YES - -# Spotlight # -############################################################################################# - -# Hide Spotlight tray-icon (and subsequent helper) -sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search - -# Disable Spotlight indexing for any volume that gets mounted and has not yet -# been indexed before. -# Use `sudo mdutil -i off "/Volumes/foo"` to stop indexing any volume. -sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes" - -# Disable CMD+space for spotlight -/usr/libexec/PlistBuddy ~/Library/Preferences/com.apple.symbolichotkeys.plist -c "Set AppleSymbolicHotKeys:64:enabled false" - -# Time Machine # -############################################################################### - -# Prevent Time Machine from prompting to use new hard drives as backup volume -defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true - -# Disable local Time Machine backups -hash tmutil &> /dev/null && sudo tmutil disablelocal - -# TextEdit and QuickTimePlayer # -############################################################################### - -# Use plain text mode for new TextEdit documents -defaults write com.apple.TextEdit RichText -int 0 - -# Open and save files as UTF-8 in TextEdit -defaults write com.apple.TextEdit PlainTextEncoding -int 4 -defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4 - -# Auto-play videos when opened with QuickTime Player -defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen -bool true - -# Mac App Store # -############################################################################### - -# Enable the WebKit Developer Tools in the Mac App Store -defaults write com.apple.appstore WebKitDeveloperExtras -bool true - -# Enable Debug Menu in the Mac App Store -defaults write com.apple.appstore ShowDebugMenu -bool true - -# Photos # -############################################################################### - -# Prevent Photos from opening automatically when devices are plugged in -defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true - -# Messages # -############################################################################### - -# Disable automatic emoji substitution (i.e. use plain text smileys) -defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false - -# Disable smart quotes as it’s annoying for messages that contain code -defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false - -# Disable continuous spell checking -defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false - -# Transmission.app # -############################################################################### - -# Don’t prompt for confirmation before downloading -defaults write org.m0k.transmission DownloadAsk -bool false -defaults write org.m0k.transmission MagnetOpenAsk -bool false - -# Trash original torrent files -defaults write org.m0k.transmission DeleteOriginalTorrent -bool true - -# Hide the donate message -defaults write org.m0k.transmission WarningDonate -bool false -# Hide the legal disclaimer -defaults write org.m0k.transmission WarningLegal -bool false - -# IP block list. -# Source: https://giuliomac.wordpress.com/2014/02/19/best-blocklist-for-transmission/ -defaults write org.m0k.transmission BlocklistNew -bool true -defaults write org.m0k.transmission BlocklistURL -string "http://john.bitsurge.net/public/biglist.p2p.gz" -defaults write org.m0k.transmission BlocklistAutoUpdate -bool true - - -# Activity Monitor # -############################################################################### - -# Show the main window when launching Activity Monitor -defaults write com.apple.ActivityMonitor OpenMainWindow -bool true - -# Visualize CPU usage in the Activity Monitor Dock icon -defaults write com.apple.ActivityMonitor IconType -int 5 - -# Show all processes in Activity Monitor -defaults write com.apple.ActivityMonitor ShowCategory -int 0 - -# Sets columns for all tabs -defaults read com.apple.ActivityMonitor "UserColumnsPerTab v5.0" -dict \ - '0' '( Command, CPUUsage, CPUTime, Threads, PID, UID, Ports )' \ - '1' '( Command, ResidentSize, Threads, Ports, PID, UID, )' \ - '2' '( Command, PowerScore, 12HRPower, AppSleep, UID, powerAssertion )' \ - '3' '( Command, bytesWritten, bytesRead, Architecture, PID, UID, CPUUsage )' \ - '4' '( Command, txBytes, rxBytes, PID, UID, txPackets, rxPackets, CPUUsage )' - -# Set sort column -defaults write com.apple.ActivityMonitor UserColumnSortPerTab -dict \ - '0' '{ direction = 0; sort = CPUUsage; }' \ - '1' '{ direction = 0; sort = ResidentSize; }' \ - '2' '{ direction = 0; sort = 12HRPower; }' \ - '3' '{ direction = 0; sort = bytesWritten; }' \ - '4' '{ direction = 0; sort = rxBytes; }' -defaults write com.apple.ActivityMonitor SortDirection -int 0 - -# Show Data in the Disk graph (instead of IO) -defaults write com.apple.ActivityMonitor DiskGraphType -int 1 - -# Show Data in the Network graph (instead of packets) -defaults write com.apple.ActivityMonitor NetworkGraphType -int 1 - -# Kill all application # -############################################################################################# - -/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u - -for app in "Activity Monitor" "Calendar" "Contacts" "cfprefsd" \ - "Dock" "Finder" "Messages" "Photos" \ - "Safari" "Firefox" "Floorp" "SystemUIServer" \ - "Terminal" "Transmission" "Raycast"; do - killall "${app}" &> /dev/null -done - -echo "Done. Note that some of these changes require a logout/restart to take effect." diff --git a/Brewfile b/Brewfile index 73c00c7..38f4dd7 100644 --- a/Brewfile +++ b/Brewfile @@ -1,6 +1,4 @@ -tap "espanso/espanso" tap "homebrew/bundle" -tap "localsend/localsend" brew "xz" brew "zstd" brew "libtiff" @@ -9,11 +7,8 @@ brew "c-ares" brew "icu4c@76" brew "libuv" brew "openssl@3" -brew "node" -brew "bitwarden-cli" brew "gettext" brew "glib" -brew "duti" brew "sqlite" brew "gh" brew "git" @@ -30,72 +25,3 @@ brew "pyenv" brew "python-argcomplete" brew "qemu" brew "yarn" -cask "alt-tab" -cask "balenaetcher" -cask "bitwarden" -cask "espanso" -cask "ghostty" -cask "latest" -cask "localsend" -cask "mark-text" -cask "monitorcontrol" -cask "notion-calendar" -cask "notunes" -cask "numi" -cask "pearcleaner" -cask "shottr" -cask "stats" -cask "warp" -cask "yaak" -vscode "aaron-bond.better-comments" -vscode "alefragnani.project-manager" -vscode "bradlc.vscode-tailwindcss" -vscode "christian-kohler.npm-intellisense" -vscode "christian-kohler.path-intellisense" -vscode "chrmarti.regex" -vscode "davidanson.vscode-markdownlint" -vscode "dbaeumer.vscode-eslint" -vscode "denoland.vscode-deno" -vscode "dracula-theme.theme-dracula" -vscode "dsznajder.es7-react-js-snippets" -vscode "editorconfig.editorconfig" -vscode "emmanuelbeziat.vscode-great-icons" -vscode "esbenp.prettier-vscode" -vscode "formulahendry.auto-close-tag" -vscode "formulahendry.auto-rename-tag" -vscode "github.copilot" -vscode "github.copilot-chat" -vscode "github.copilot-workspace" -vscode "github.vscode-github-actions" -vscode "github.vscode-pull-request-github" -vscode "gruntfuggly.todo-tree" -vscode "hashicorp.terraform" -vscode "hbenl.vscode-test-explorer" -vscode "idered.npm" -vscode "maxvanderschee.web-accessibility" -vscode "meganrogge.template-string-converter" -vscode "mikestead.dotenv" -vscode "ms-azuretools.vscode-docker" -vscode "ms-vscode-remote.remote-containers" -vscode "ms-vscode.live-server" -vscode "ms-vscode.test-adapter-converter" -vscode "ms-vsliveshare.vsliveshare" -vscode "mylesmurphy.prettify-ts" -vscode "nicoespeon.abracadabra" -vscode "orta.vscode-jest" -vscode "philnash.ngrok-for-vscode" -vscode "pwabuilder.pwa-studio" -vscode "quicktype.quicktype" -vscode "ritwickdey.liveserver" -vscode "saoudrizwan.claude-dev" -vscode "sburg.vscode-javascript-booster" -vscode "sleistner.vscode-fileutils" -vscode "sonarsource.sonarlint-vscode" -vscode "stevencl.adddoccomments" -vscode "stylelint.vscode-stylelint" -vscode "visualstudioexptteam.intellicode-api-usage-examples" -vscode "visualstudioexptteam.vscodeintellicode" -vscode "wayou.vscode-todo-highlight" -vscode "wmaurer.change-case" -vscode "xabikos.javascriptsnippets" -vscode "yoavbls.pretty-ts-errors" diff --git a/README.md b/README.md index bb4fb9a..e497120 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,59 @@ # dotfiles -Hey! 👋 - -This repo stores my personal app configs and customizations. I mainly use zsh, but you can adapt for bash or other shells. -Since I work with macOS and Ubuntu, configs are optimized for these OSs. But no worries - you can easily tweak them for other systems too! - -## Usage - +This is my dotfiles for personal app configs and customizations. I mainly use zsh, but you might adapt for bash or other shells. This repo is 100% open for you to explore and customize. Just clone it and swap my configs with yours - makes it super easy to get your dev environment up and running on any new machine. -## Getting Started +## How to use -1. Clone this repository to your local machine: +1. Clone this repository: ```bash git clone git@github.com:tcelestino/dotfiles.git ``` -2. Open folder `dotfiles` and set run file to install - -```bash -chmod +x install -``` -3. Open `.zshrc` file and change variables "USER_NAME", "USER_EMAIL" and "NPM_SCOPE". You might set `GH_TOKEN` and `NPM_TOKEN` too. - -```bash +2. Edit `.zshrc` file and set config options for variables `USER_NAME`, `USER_EMAIL` and `NPM_SCOPE`. You might set `GH_TOKEN` and `NPM_TOKEN` too. -4. Run the install script +3. Run the install script ```bash ./install ``` ⚠️ **Don't forget to set values `GH_TOKEN` and `NPM_TOKEN`!!** +## My Apps + +This is my list of apps and tools that I use. + +### Apps + +| Name | Description | Download URL | +|--------------|-------------------------------------------------------------|---------------------------------------------------------------| +| Terminator | Multi-monitor terminal for Linux | [https://gnometerminator.blogspot.com/p/introduction.html](https://gnometerminator.blogspot.com/p/introduction.html) | +| Ulauncher | Spotlight for Linux | [https://ulauncher.io/](https://ulauncher.io/) | +| VSCode | Code editor | [https://code.visualstudio.com/](https://code.visualstudio.com/) | +| Cursor | AI-powered code editor | [https://www.cursor.com/](https://www.cursor.com/) | +| Firefox | Web browser | [https://www.firefox.com/](https://www.firefox.com/) | +| Beekeeper Studio | Database management tool | [https://www.beekeeperstudio.io/](https://www.beekeeperstudio.io/) | + +### Development tools + +| Name | Description | Download URL | +|--------------|-------------------------------------------------------------|-----------------------------------------------------------------| +| Node.js | JavaScript runtime for application development | [https://nodejs.org/](https://nodejs.org/) | +| Yarn | Fast and reliable package manager for Node.js | [https://yarnpkg.com/](https://yarnpkg.com/) | +| Git | Distributed version control system | [https://git-scm.com/](https://git-scm.com/) | + +### NPM packages + +| Name | Description | Download URL | +|--------------|-------------------------------------------------------------|---------------------------------------------------------------| +| fastify-cli | CLI for Fastify framework | [https://www.fastify.io/](https://www.fastify.io/) | +| npm-check-updates | Tool to update npm dependencies | [https://www.npmjs.com/package/npm-check-updates](https://www.npmjs.com/package/npm-check-updates) | +| git-cz | Tool for conventional commits | [https://www.npmjs.com/package/git-cz](https://www.npmjs.com/package/git-cz) | + ## Additional Configurations -- To set the keyboard layout to include the 'ç' character on Ubuntu, follow the steps in the article "[Ajeitando o cedilha errado (ć) no Ubuntu Linux](https://www.danielkossmann.com/pt/ajeitando-cedilha-errado-ubuntu-linux/)" -- If you use iTerm2, you might import the color scheme and other configurations into iTerm2. The settings can be found in the "iterm2" folder. +- To set the keyboard layout to include the 'ç' character on Ubuntu, follow the steps in the article "[Fixing the wrong cedilla (ć) in Ubuntu Linux](https://www.danielkossmann.com/pt/ajeitando-cedilha-errado-ubuntu-linux/)" ## Contributing diff --git a/install b/install index d6caa19..0d495b2 100755 --- a/install +++ b/install @@ -150,22 +150,6 @@ install_oh_my_zsh() { log "oh-my-zsh installed successfully!" } -# Install Node.js -install_node_using_n() { - if [ -d "$HOME/local/n/versions/node" ]; then - log "Node.js is already installed." - register_completed_step "Node.js (already installed)" - return - else - log "Installing Node.js..." - if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s 22)"; then - error "Failed to install Node.js" - fi - register_completed_step "Node.js" - log "Node.js installed successfully!" - fi -} - # Install Deno runtime install_deno() { if [ -f "$HOME/.deno/bin/deno" ] || command -v deno >/dev/null 2>&1; then @@ -182,44 +166,6 @@ install_deno() { fi } -# Install global NPM packages -install_pkg_global() { - log "Installing global npm packages..." - npm install -g git-cz fastify-cli npm-check-updates node-notifier-cli - register_completed_step "NPM packages" - log "NPM packages installed successfully!" -} - -# Install Yaak via deb package -install_yaak() { - local yaak_url="https://github.com/mountain-loop/yaak/releases/download/v2025.4.0/yaak_2025.4.0_amd64.deb" #latest version at 2025.06.19 - - if [ ! -d "/tmp" ]; then - mkdir -p "/tmp" - fi - - local tmp_folder="/tmp" - local tmp_file="$tmp_folder/yaak-x86_64.deb" - - log "Downloading Yaak..." - if ! curl -L "$yaak_url" -o "$tmp_file"; then - error "Failed to download Yaak." - fi - - log "Installing Yaak..." - if ! sudo dpkg -i "$tmp_file"; then - error "Failed to install Yaak." - fi - - - log "Removing temporary files..." - rm -f "$tmp_file" - log "Temporary files removed." - - register_completed_step "Yaak" - log "Yaak installed successfully!" -} - # Configure Git settings setup_git() { copy_file "$DIR/git/.gitconfig" "$HOME/.gitconfig" @@ -232,7 +178,7 @@ setup_git() { # Configure Zsh settings setup_zsh() { - copy_file "$DIR/linux/zsh/.zshrc" "$HOME/.zshrc" + copy_file "$DIR/zsh/.zshrc" "$HOME/.zshrc" copy_dir "$DIR/zsh/themes" "$HOME/.oh-my-zsh/themes" copy_file "$DIR/zsh/aliases.zsh" "$HOME/.oh-my-zsh/custom/aliases.zsh" copy_dir "$DIR/zsh/custom-functions" "$HOME/.oh-my-zsh/plugins/custom-functions" @@ -243,7 +189,7 @@ setup_zsh() { # Configure Homebrew and install packages from Brewfile setup_brew() { - copy_file "$DIR/linux/Brewfile" "$HOME/Brewfile" + copy_file "$DIR/Brewfile" "$HOME/Brewfile" log "Executing brew bundle install..." if ! brew bundle install; then error "Brew bundle install failed" @@ -252,7 +198,7 @@ setup_brew() { log "Homebrew configured successfully!" } -# Configure NPM settings and install global packages +# NPM Settings setup_npm() { copy_file "$DIR/.npmrc" "$HOME/.npmrc" register_completed_step "NPM" @@ -267,7 +213,7 @@ setup_npm() { fi } -# Custom fonts +# Set my favorite custom fonts setup_fonts() { local font_dir="$HOME/.local/share/fonts" if [ ! -d "$font_dir" ]; then @@ -316,15 +262,12 @@ main() { echo "1. Install zsh" echo "2. Install oh-my-zsh" echo "3. Install Homebrew" - echo "4. Install Node.js" - echo "5. Install Deno" - echo "6. Install Yaak (HTTP Client GUI)" - echo "7. Configure Zsh" - echo "8. Configure Homebrew and install packages" - echo "9. Configure Git" - echo "10. Configure NPM" - echo "11. Install global NPM packages" - echo "12. Configure the fonts" + echo "4. Install Deno" + echo "5. Configure Zsh" + echo "6. Configure Homebrew and install packages" + echo "7. Configure Git" + echo "8. Configure NPM" + echo "9. Configure the fonts" if ask_continue "Install zsh" "1"; then install_zsh @@ -338,39 +281,27 @@ main() { install_brew fi - if ask_continue "Install Node.js" "4"; then - install_node_using_n - fi - - if ask_continue "Install Deno" "5"; then + if ask_continue "Install Deno" "4"; then install_deno fi - if ask_continue "Install Yaak (HTTP Client GUI)" "6"; then - install_yaak - fi - - if ask_continue "Configure Zsh" "7"; then + if ask_continue "Configure Zsh" "5"; then setup_zsh fi - if ask_continue "Configure Homebrew and install packages" "8"; then + if ask_continue "Configure Homebrew and install packages" "6"; then setup_brew fi - if ask_continue "Configure Git" "9"; then + if ask_continue "Configure Git" "7"; then setup_git fi - if ask_continue "Configure NPM" "10"; then + if ask_continue "Configure NPM" "8"; then setup_npm fi - if ask_continue "Install global some NPM packages" "11"; then - install_pkg_global - fi - - if ask_continue "Configure the fonts" "12"; then + if ask_continue "Configure the fonts" "9"; then setup_fonts fi diff --git a/linux/Brewfile b/linux/Brewfile deleted file mode 100644 index 38f4dd7..0000000 --- a/linux/Brewfile +++ /dev/null @@ -1,27 +0,0 @@ -tap "homebrew/bundle" -brew "xz" -brew "zstd" -brew "libtiff" -brew "jpeg-xl" -brew "c-ares" -brew "icu4c@76" -brew "libuv" -brew "openssl@3" -brew "gettext" -brew "glib" -brew "sqlite" -brew "gh" -brew "git" -brew "unbound" -brew "gnutls" -brew "netpbm" -brew "harfbuzz" -brew "python@3.13" -brew "graphviz" -brew "httpie" -brew "libssh" -brew "pipx" -brew "pyenv" -brew "python-argcomplete" -brew "qemu" -brew "yarn" diff --git a/linux/zsh/.zshrc b/linux/zsh/.zshrc deleted file mode 100644 index dd29518..0000000 --- a/linux/zsh/.zshrc +++ /dev/null @@ -1,52 +0,0 @@ -export ZSH=$HOME/.oh-my-zsh - -ZSH_THEME="dracula" - -plugins=(brew copypath copyfile custom-functions deno docker docker-compose extract git history npm python vscode web-search yarn) - -# global -export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" -export PATH=$HOME/local/bin:$PATH -export NPM_PACKAGES="${HOME}/.npm-packages" -export PATH="$NPM_PACKAGES/bin:$PATH" -export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" -#export JAVA_HOME="$(/usr/libexec/java_home -v 1.$JAVA_VERSION)" # enable this if you are using java -#export PATH=/usr/share/maven/bin:$PATH # enable this if you are using maven -#export PATH=$HOME/mongodb/bin:$PATH # enable this if you are using mongodb -#export PATH=$PATH:~/.composer/vendor/bin # enable this if you are using composer - -# github -export GH_TOKEN="" # create token at https://github.com/settings/apps select "Personal access tokens" - -# ssh -export SSH_KEY_PATH="~/.ssh/id_ed25519" - -# node and npm -export NODE_ENV="development" -export NPM_TOKEN="" # create token at https://www.npmjs.com/settings/tokens -export NPM_SCOPE="" # e.g. tcelestino - -# local -export USER_NAME="" # e.g. tcelestino -export USER_EMAIL="" # e.g. your.email@provider.com - -# preferred editor for local and remote sessions -if [[ -n $SSH_CONNECTION ]]; then - export EDITOR='vim' -else - export EDITOR='code' -fi - -# web search custom search engines -ZSH_WEB_SEARCH_ENGINES=( - reddit "https://www.reddit.com/search/?q=" - linkedin "https://www.linkedin.com/search/results/all/?keywords=" -) - -# deno settings -. "$HOME/.deno/env" - -# homebrew -eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - -source $ZSH/oh-my-zsh.sh diff --git a/zsh/.zshrc b/zsh/.zshrc index aaa73cc..dd29518 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -2,28 +2,33 @@ export ZSH=$HOME/.oh-my-zsh ZSH_THEME="dracula" -plugins=(alias-finder brew copypath copyfile deno dotenv docker docker-compose extract history iterm2 git macos npm python vscode web-search yarn custom-functions) - +plugins=(brew copypath copyfile custom-functions deno docker docker-compose extract git history npm python vscode web-search yarn) # global -#export JAVA_HOME="$(/usr/libexec/java_home -v 1.$JAVA_VERSION)" # enable this if you are using java export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" -export PATH=/usr/share/maven/bin:$PATH export PATH=$HOME/local/bin:$PATH -export PATH=$HOME/mongodb/bin:$PATH -export PATH=$PATH:~/.composer/vendor/bin -export PATH="/opt/homebrew/bin:$PATH" # brew on Apple Silicon -export PATH="/usr/local/bin:$PATH" # brew on Intel export NPM_PACKAGES="${HOME}/.npm-packages" export PATH="$NPM_PACKAGES/bin:$PATH" export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" -export GH_TOKEN="" # create token at https://github.com/settings/apps select "Personal access tokens" -export NPM_TOKEN="" +#export JAVA_HOME="$(/usr/libexec/java_home -v 1.$JAVA_VERSION)" # enable this if you are using java +#export PATH=/usr/share/maven/bin:$PATH # enable this if you are using maven +#export PATH=$HOME/mongodb/bin:$PATH # enable this if you are using mongodb +#export PATH=$PATH:~/.composer/vendor/bin # enable this if you are using composer + +# github +export GH_TOKEN="" # create token at https://github.com/settings/apps select "Personal access tokens" + +# ssh +export SSH_KEY_PATH="~/.ssh/id_ed25519" + +# node and npm export NODE_ENV="development" -export SSH_KEY_PATH="~/.ssh/id_ed" # set your ssh key path -export USER_NAME="" -export USER_EMAIL="" -export NPM_SCOPE=${USER:-your_username} # e.g. tcelestino +export NPM_TOKEN="" # create token at https://www.npmjs.com/settings/tokens +export NPM_SCOPE="" # e.g. tcelestino + +# local +export USER_NAME="" # e.g. tcelestino +export USER_EMAIL="" # e.g. your.email@provider.com # preferred editor for local and remote sessions if [[ -n $SSH_CONNECTION ]]; then @@ -38,4 +43,10 @@ ZSH_WEB_SEARCH_ENGINES=( linkedin "https://www.linkedin.com/search/results/all/?keywords=" ) +# deno settings +. "$HOME/.deno/env" + +# homebrew +eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + source $ZSH/oh-my-zsh.sh From 7dc6e52ff07fc5e136a24a30227e001eae6a2e9e Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Fri, 18 Jul 2025 19:07:17 -0300 Subject: [PATCH 20/23] docs: adjust terminator website url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e497120..064f497 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ This is my list of apps and tools that I use. | Name | Description | Download URL | |--------------|-------------------------------------------------------------|---------------------------------------------------------------| -| Terminator | Multi-monitor terminal for Linux | [https://gnometerminator.blogspot.com/p/introduction.html](https://gnometerminator.blogspot.com/p/introduction.html) | +| Terminator | Multi-monitor terminal for Linux | [https://gnome-terminator.org/](https://gnome-terminator.org/) | | Ulauncher | Spotlight for Linux | [https://ulauncher.io/](https://ulauncher.io/) | | VSCode | Code editor | [https://code.visualstudio.com/](https://code.visualstudio.com/) | | Cursor | AI-powered code editor | [https://www.cursor.com/](https://www.cursor.com/) | From 6bc97093701fb5f21d1f45a898f72ab88a368b58 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Fri, 18 Jul 2025 19:09:11 -0300 Subject: [PATCH 21/23] docs: add nestjs npm package --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 064f497..827ebe4 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ This is my list of apps and tools that I use. | fastify-cli | CLI for Fastify framework | [https://www.fastify.io/](https://www.fastify.io/) | | npm-check-updates | Tool to update npm dependencies | [https://www.npmjs.com/package/npm-check-updates](https://www.npmjs.com/package/npm-check-updates) | | git-cz | Tool for conventional commits | [https://www.npmjs.com/package/git-cz](https://www.npmjs.com/package/git-cz) | +| @nestjs/cli | NestJS Command Line Interface | [https://docs.nestjs.com/](https://docs.nestjs.com/) | ## Additional Configurations From 3c7b6ebab82d45fe0233e68204931905db3f60db Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Fri, 18 Jul 2025 19:14:40 -0300 Subject: [PATCH 22/23] docs: update usage step --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 827ebe4..b695b53 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,15 @@ This repo is 100% open for you to explore and customize. Just clone it and swap git clone git@github.com:tcelestino/dotfiles.git ``` -2. Edit `.zshrc` file and set config options for variables `USER_NAME`, `USER_EMAIL` and `NPM_SCOPE`. You might set `GH_TOKEN` and `NPM_TOKEN` too. +2. Checkout the branch you want to use: `macos` or `ubuntu` -3. Run the install script +```bash +git checkout +``` + +3. Open `.zshrc` file and set config options for variables `USER_NAME`, `USER_EMAIL` and `NPM_SCOPE`. You might set `GH_TOKEN` and `NPM_TOKEN` too. + +4. Run the install script ```bash ./install From d61d77f1df2348b2791f77571ff341e8cf317661 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Fri, 18 Jul 2025 19:24:52 -0300 Subject: [PATCH 23/23] feat: install oh-my-zsh as of temp folder --- install | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/install b/install index 0d495b2..1eaf327 100755 --- a/install +++ b/install @@ -142,10 +142,23 @@ install_oh_my_zsh() { fi log "Installing oh-my-zsh..." - if ! sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; then + + # Download the install script to a temporary file + local temp_script=$(mktemp) + if ! curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -o "$temp_script"; then + error "Failed to download oh-my-zsh install script" + fi + + # Make the script executable and run it + chmod +x "$temp_script" + if ! bash "$temp_script" --unattended; then + rm -f "$temp_script" error "Failed to install oh-my-zsh" fi + # Clean up the temporary script + rm -f "$temp_script" + register_completed_step "oh-my-zsh" log "oh-my-zsh installed successfully!" }