diff --git a/.gitignore b/.gitignore index f21dc66..7980428 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ .DS_Store + tokens environment_variables local_aliases + +/dots/zsh/.zsh_sessions +/dots/zsh/.zsh_history /dots/zsh/config/packages diff --git a/README.md b/README.md index d38c2be..a527e7c 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,6 @@ Alternatively, you can also just use this repository as a guide for setting up y Whatever floats your boat is cool with me 💃! - - ## Setup Steps 1) Install **Xcode** from the Mac App Store and run it to accept the license and install **git**. @@ -95,10 +93,10 @@ $ hideFiles ## Application Specific Setups -### Moom +### Moom [**Moom**](https://manytricks.com/moom/) is a great application for moving around and zooming OSX windows, however there is currently no easy way to sync its great customizable configurations across computers. -This repository provides two scripts that copy back and forth the Moom system preference file. Unfortunately, due to how OSX handles the preferences files, they cannot be symlinked to this repository since everytime the application settings are updated, the system preferences file is completed replaced. +This repository provides two scripts that copy back and forth the Moom system preference file. Unfortunately, due to how OSX handles the preferences files, they cannot be symlinked to this repository since everytime the application settings are updated, the system preferences file is completed replaced. Instead, we can run the included _export_ script to copy the preferences (once configured) into this repository, and back from the repository to the system (on another computer with Moom for example) using the _import_ script: @@ -109,4 +107,3 @@ $ bash ~/path/to/this/repo/dotfiles/moom/export.sh ```shell $ bash ~/path/to/this/repo/dotfiles/moom/import.sh ``` - diff --git a/bootstrap.sh b/bootstrap.sh index 00869f4..b24e343 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,5 +1,4 @@ -#!/usr/bin/env bash - +#!/bin/zsh # ------------------------------------------------------------------------------ # Bootstrap @@ -7,94 +6,94 @@ -# source ./extras/colors +# # source ./extras/colors -printf "\n$INFO%s$RESET\n" "Beginning setup bootstrapping..." +# printf "\n$INFO%s$RESET\n" "Beginning setup bootstrapping..." -# Create Directories -# ------------------------------------------------------------------------------ -# Create directories for setup. +# # Create Directories +# # ------------------------------------------------------------------------------ +# # Create directories for setup. -printf "\n$INFO%s$RESET\n" "1) Creating necessary directories:" +# printf "\n$INFO%s$RESET\n" "1) Creating necessary directories:" -./scripts/create_directories.sh +# ./scripts/create_directories.sh -# Copy & Move Files -# ------------------------------------------------------------------------------ -# Copy and move files into specified directory that can not be symlinked. +# # Copy & Move Files +# # ------------------------------------------------------------------------------ +# # Copy and move files into specified directory that can not be symlinked. -printf "\n$INFO%s$RESET\n" "2) Copying and moving files into specified directories:" +# printf "\n$INFO%s$RESET\n" "2) Copying and moving files into specified directories:" -./scripts/copy_move.sh +# ./scripts/copy_move.sh -# Symlink Dotfiles -# ------------------------------------------------------------------------------ -# Symlink necessary dotfiles into home directory. +# # Symlink Dotfiles +# # ------------------------------------------------------------------------------ +# # Symlink necessary dotfiles into home directory. -printf "\n$INFO%s$RESET\n" "3) Symlinking dotfiles into specified directories:" +# printf "\n$INFO%s$RESET\n" "3) Symlinking dotfiles into specified directories:" -./scripts/symlinks.sh +# ./scripts/symlinks.sh -# Install Homebrew -# ------------------------------------------------------------------------------ +# # Install Homebrew +# # ------------------------------------------------------------------------------ -printf "\n$INFO%s$RESET\n" "4) Installing Homebrew:" +# printf "\n$INFO%s$RESET\n" "4) Installing Homebrew:" -./scripts/homebrew.sh +# ./scripts/homebrew.sh -# Install Binary Packages With Homebrew -# ------------------------------------------------------------------------------ +# # Install Binary Packages With Homebrew +# # ------------------------------------------------------------------------------ -printf "\n$INFO%s$RESET\n" "5) Installing binary application packages with Homebrew:" +# printf "\n$INFO%s$RESET\n" "5) Installing binary application packages with Homebrew:" -./scripts/brew-cellar.sh +# ./scripts/brew-cellar.sh -# Install Native Mac Applications With Cask -# ------------------------------------------------------------------------------ +# # Install Native Mac Applications With Cask +# # ------------------------------------------------------------------------------ -printf "\n$INFO%s$RESET\n" "6) Installing native applications with Homebrew Cask." +# printf "\n$INFO%s$RESET\n" "6) Installing native applications with Homebrew Cask." -./scripts/brew-cask.sh +# ./scripts/brew-cask.sh -# Install non-Homebrew Binary Packages -# ------------------------------------------------------------------------------ +# # Install non-Homebrew Binary Packages +# # ------------------------------------------------------------------------------ -printf "\n$INFO%s$RESET\n" "7) Installing binary application packages." +# printf "\n$INFO%s$RESET\n" "7) Installing binary application packages." -./scripts/bins_installations.sh +# ./scripts/bins_installations.sh -# Install non-Homebrew Applications -# ------------------------------------------------------------------------------ +# # Install non-Homebrew Applications +# # ------------------------------------------------------------------------------ -printf "\n$INFO%s$RESET\n" "8) Installing native applications." +# printf "\n$INFO%s$RESET\n" "8) Installing native applications." -./scripts/apps_installations.sh +# ./scripts/apps_installations.sh -# Reload bash_profile -# ------------------------------------------------------------------------------ +# # Reload bash_profile +# # ------------------------------------------------------------------------------ -source ~/.bash_profile +# source ~/.bash_profile -# Bootsrap Process Completed -# ------------------------------------------------------------------------------ -printf "\n$SUCCESS%s$RESET\n" "Bootstrapping process completed! Enjoy your new setup 🍻" +# # Bootsrap Process Completed +# # ------------------------------------------------------------------------------ +# printf "\n$SUCCESS%s$RESET\n" "Bootstrapping process completed! Enjoy your new setup 🍻" diff --git a/dots/.bash/aliases b/dots/.bash/aliases deleted file mode 100644 index 0ad459b..0000000 --- a/dots/.bash/aliases +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env bash - -# ------------------------------------------------------------------------------ -# Aliases -# ------------------------------------------------------------------------------ - - - -# UNIX -# ------------------------------------------------------------------------------ - -# Use coreutils `ls` if available. -hash gls >/dev/null 2>&1 || alias gls="ls" - -# Detect which `ls` flavor is in use. -if gls --color > /dev/null 2>&1; then # GNU `ls` - colorflag="--color" -else # OS X `ls` - colorflag="-G" -fi - -# List files options. -# F = put `/` after folders -# h = byte unit suffixes -alias ls='CLICOLOR_FORCE=1 gls -aFh ${colorflag} --group-directories-first' - -# List all files. -alias la="ls -la" - - - -# OS X -# ------------------------------------------------------------------------------ - -alias desk='cd ~/Desktop' -alias dev='cd ~/Code' -alias hosts='subl /etc/hosts' - -alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app' -alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app' - - -alias gnm="open /usr/local/lib/node_modules" - - -# Git -# ------------------------------------------------------------------------------ - -alias ga="git add" -alias gc="git commit" -alias gd="git diff" -alias gr="git rm" -alias gs="git status" -alias gco="git checkout" -alias gcm="git checkout master" -alias gpl="git pull" -alias gph="git push" - - - -# Laravel -# ------------------------------------------------------------------------------ - -alias homestead='function __homestead() { (cd ~/Code/homestead && vagrant $*); unset -f __homestead; }; __homestead' - - - -# Papertrail -# ------------------------------------------------------------------------------ -# Download all logs matching a pattern. -# Usage: pt-archive -# $ pt-archive 2018-12-01 2018-12-02 "dosomething-northstar" "ns-logs" - -function pt-archive() { - DIRECTORY=$(pwd) - FILTER="${3:-\".*\"}" - - cd $(mktemp -d) - - echo "Downloading log archives from $1 to $2..." - curl -sH "X-Papertrail-Token: $PAPERTRAIL_API_KEY" https://papertrailapp.com/api/v1/archives.json | - grep -o '"filename":"[^"]*"' | egrep -o '[0-9-]+' | - awk '$0 >= "'$1'" && $0 < "'$2'" { - print "output " $0 ".tsv.gz" - print "url https://papertrailapp.com/api/v1/archives/" $0 "/download" - }' | curl --progress-bar -fLH "X-Papertrail-Token: $PAPERTRAIL_API_KEY" -K- - - - echo "Unzipping compressed archives..." - gunzip *.tsv.gz - - echo "Filtering by '$FILTER' & concatenating to one file..." - cat *.tsv | grep -E $FILTER > $DIRECTORY/$4.tsv - - echo "Cleaning up..." - rm *.tsv - - echo "All done! 🎊 $DIRECTORY/$4.tsv!" - - cd - > /dev/null -} \ No newline at end of file diff --git a/dots/.bash/completions b/dots/.bash/completions deleted file mode 100644 index 70f2927..0000000 --- a/dots/.bash/completions +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# ------------------------------------------------------------------------------ -# Completions -# ------------------------------------------------------------------------------ - - - -# Bash Completion -# ------------------------------------------------------------------------------ -if [ -f $(brew --prefix)/etc/bash_completion ]; then - . $(brew --prefix)/etc/bash_completion -fi diff --git a/dots/.bash/exports b/dots/.bash/exports deleted file mode 100644 index dfc82bb..0000000 --- a/dots/.bash/exports +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# ------------------------------------------------------------------------------ -# Exports -# ------------------------------------------------------------------------------ - - - -# PATH -# ------------------------------------------------------------------------------ -export PATH=$(brew --prefix coreutils)/libexec/gnubin:$PATH - - - -# MANPATH -# ------------------------------------------------------------------------------ -export MANPATH=$(brew --prefix coreutils)/libexec/gnuman:$MANPATH diff --git a/dots/.bash/prompt b/dots/.bash/prompt deleted file mode 100644 index f351f21..0000000 --- a/dots/.bash/prompt +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env bash - -# ------------------------------------------------------------------------------ -# Prompt -# ------------------------------------------------------------------------------ - - - -# Colors -# ------------------------------------------------------------------------------ - -if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then - export TERM=gnome-256color -elif infocmp xterm-256color >/dev/null 2>&1; then - export TERM=xterm-256color -fi - -if tput setaf 1 &> /dev/null; then - tput sgr0 - if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then - MAGENTA=$(tput setaf 9) - ORANGE=$(tput setaf 172) - GREEN=$(tput setaf 190) - PURPLE=$(tput setaf 141) - WHITE=$(tput setaf 256) - else - MAGENTA=$(tput setaf 5) - ORANGE=$(tput setaf 4) - GREEN=$(tput setaf 2) - PURPLE=$(tput setaf 1) - WHITE=$(tput setaf 7) - fi - BOLD=$(tput bold) - RESET=$(tput sgr0) -else - MAGENTA="\033[1;31m" - ORANGE="\033[1;33m" - GREEN="\033[1;32m" - PURPLE="\033[1;35m" - WHITE="\033[1;37m" - BOLD="" - RESET="\033[m" -fi - - - -# Git Info -# ------------------------------------------------------------------------------ - -parse_git_dirty () { - [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" -} -parse_git_branch () { - git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" -} - - - -# Custom Header -# ------------------------------------------------------------------------------ - -custom_prompt_header () { - # Get width of terminal and subtract specified number of column units. - let x_coord=$(tput cols)-21 - - printf "\n$WHITE%s" "(╯°□°)╯︵ ┻━┻" - tput cuf ${x_coord} - printf "$WHITE[%s]\n" "$(date +%I:%M)" -} - - - -# Prompt Output -# ------------------------------------------------------------------------------ -# \h: hostname -# \u: username -# \W: current working directory -# \w: full path to current working directory - -PROMPT_COMMAND=custom_prompt_header - -PS1="\[${BOLD}${MAGENTA}\]\u " -PS1+="\[$WHITE\]at " -PS1+="\[$ORANGE\]\h " -PS1+="\[$WHITE\]in " -PS1+="\[$GREEN\]\w" -PS1+="\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)" -PS1+="\[$WHITE\]\n😾 \[$RESET\]" diff --git a/dots/.gitconfig b/dots/.gitconfig index fcc688a..23301b4 100644 --- a/dots/.gitconfig +++ b/dots/.gitconfig @@ -1,22 +1,9 @@ -[alias] - s = status - a = add - r = rm - c = commit - pl = pull - ph = push - co = checkout - [user] - name = Diego Lorenzo email = diego@diegolorenzo.com + name = Diego Lorenzo [color] ui = true [core] excludesfile = ~/.gitignore - -[push] - default = simple - \ No newline at end of file diff --git a/dots/.gitignore b/dots/.gitignore index 27cd6c4..0778fd0 100644 --- a/dots/.gitignore +++ b/dots/.gitignore @@ -1,5 +1,7 @@ .DS_Store +_scraps.* scraps.* +_scraps/ scraps/ dots/zsh/packages diff --git a/dots/zsh/.zprofile b/dots/zsh/.zprofile new file mode 100644 index 0000000..c574b19 --- /dev/null +++ b/dots/zsh/.zprofile @@ -0,0 +1,37 @@ +# ------------------------------------------------------------------------------ +# Zsh Profile +# ------------------------------------------------------------------------------ +# +# zprofile - Diego Lorenzo +# +# The /etc/zprofile file will be run first if it exists and then this file is run. +# +# This file runs in the following shell environments: +# - Login shell +# - Terminal shell + + + +# Zsh Prompt Prefix +# ------------------------------------------------------------------------------ + +echo "\n (╯°□°)╯︵ ┻━┻ \n" + +echo "\ + /\$\$ /\$\$\$\$\$\$\$\$ /\$\$\$\$\$\$\$\$ /\$\$ /\$\$\$\$\$\$ /\$\$\$\$\$\$ /\$\$\$\$\$\$ /\$\$ +| \$\$ | \$\$_____/|__ \$\$__/| \$//\$\$__ \$\$ /\$\$__ \$\$ /\$\$__ \$\$| \$\$ +| \$\$ | \$\$ | \$\$ |_/| \$\$ \__/ | \$\$ \__/| \$\$ \ \$\$| \$\$ +| \$\$ | \$\$\$\$\$ | \$\$ | \$\$\$\$\$\$ | \$\$ /\$\$\$\$| \$\$ | \$\$| \$\$ +| \$\$ | \$\$__/ | \$\$ \____ \$\$ | \$\$|_ \$\$| \$\$ | \$\$|__/ +| \$\$ | \$\$ | \$\$ /\$\$ \ \$\$ | \$\$ \ \$\$| \$\$ | \$\$ +| \$\$\$\$\$\$\$\$| \$\$\$\$\$\$\$\$ | \$\$ | \$\$\$\$\$\$/ | \$\$\$\$\$\$/| \$\$\$\$\$\$/ /\$\$ +|________/|________/ |__/ \______/ \______/ \______/ |__/ +\n" + + + +# Homebrew +# ------------------------------------------------------------------------------ +# Adds brew to PATH but also doing it via exports file, so maybe not necessary. + +# eval "$(/opt/homebrew/bin/brew shellenv)" diff --git a/dots/zsh/.zshenv b/dots/zsh/.zshenv new file mode 100644 index 0000000..bb2014e --- /dev/null +++ b/dots/zsh/.zshenv @@ -0,0 +1,20 @@ +# ------------------------------------------------------------------------------ +# Zsh Environment +# ------------------------------------------------------------------------------ +# +# zshenv - Diego Lorenzo +# +# The /etc/zshenv file will be run first if it exists and then this file is run. +# +# This file runs in the following shell environments: +# - Login shell +# - Interactive shell +# - Scripts shell +# - Terminal shell + + + +# Zsh Configuration Directory +# ------------------------------------------------------------------------------ + +export ZDOTDIR="$HOME/Code/dotfiles/dots/zsh" diff --git a/dots/zsh/.zshrc b/dots/zsh/.zshrc new file mode 100644 index 0000000..bd8acb1 --- /dev/null +++ b/dots/zsh/.zshrc @@ -0,0 +1,53 @@ +# ------------------------------------------------------------------------------ +# Zsh RC +# ------------------------------------------------------------------------------ +# +# zshrc - Diego Lorenzo +# +# The /etc/zshrc file will be run first if it exists and then this file is run. +# +# This file runs in the following shell environments: +# - Login shell +# - Interactive Shell +# - Terminal shell + + + +zshDir="$HOME/Code/dotfiles/dots/zsh" + + + +# Exports +# ------------------------------------------------------------------------------ + +# export PATH="/usr/local/opt/node@16/bin:$PATH" +# export PATH="/usr/local/sbin:$PATH" # brew executables path + + + +# Shell Options +# ------------------------------------------------------------------------------ + +# Change directories when path entered without specifying 'cd' +setopt autocd + + + +# +# ------------------------------------------------------------------------------ + +source $zshDir/config/prompt +source $zshDir/config/aliases +source $zshDir/config/exports +source $zshDir/config/functions +# source ~/.zsh/config/bindings +# source ~/.zsh/config/extensions # @TODO: script needs to create the config/packages directory that is gitignored + + + +# ZSH Version +# ------------------------------------------------------------------------------ + +echo macOS version $(sw_vers -productVersion) \| build $(sw_vers -buildVersion) + +echo zsh v$ZSH_VERSION diff --git a/dots/zsh/config/aliases b/dots/zsh/config/aliases index d648619..23371c3 100644 --- a/dots/zsh/config/aliases +++ b/dots/zsh/config/aliases @@ -33,7 +33,6 @@ alias ll="ls -la" alias desk='cd ~/Desktop' alias dev='cd ~/Code' alias hosts='code /etc/hosts' -alias notes='code /Users/Weerd/Dropbox/Code\ Support/development_notes.code-workspace' alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app' alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app' @@ -51,7 +50,7 @@ alias gd="git diff" alias gr="git rm" alias gs="git status" alias gco="git checkout" -alias gcm="git checkout master" +alias gcom="git checkout main" alias gpl="git pull" alias gph="git push" @@ -60,6 +59,10 @@ alias gph="git push" # Laravel # ------------------------------------------------------------------------------ +# Homestead # @TODO: check if this has been updated. # @TODO: should this go in functions file. -alias homestead='function __homestead() { (cd ~/Code/homestead && vagrant $*); unset -f __homestead; }; __homestead' +# alias homestead='function __homestead() { (cd ~/Code/homestead && vagrant $*); unset -f __homestead; }; __homestead' + +# Sail +alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail' diff --git a/dots/zsh/config/exports b/dots/zsh/config/exports new file mode 100644 index 0000000..8a3e043 --- /dev/null +++ b/dots/zsh/config/exports @@ -0,0 +1,45 @@ +#!/bin/zsh + +# ------------------------------------------------------------------------------ +# Exports +# ------------------------------------------------------------------------------ + + + +# Homebrew Exports +# ------------------------------------------------------------------------------ +export PATH="/opt/homebrew/bin:/opt/homebrew/sbin":$PATH + + + +# Herd Exports +# ------------------------------------------------------------------------------ +export PATH="/Users/weerd/Library/Application Support/Herd/bin/":$PATH +export PHP_INI_SCAN_DIR="/Users/weerd/Library/Application Support/Herd/config/php/":$PHP_INI_SCAN_DIR + + +# Herd injected PHP 8.2 configuration. +export HERD_PHP_82_INI_SCAN_DIR="/Users/weerd/Library/Application Support/Herd/config/php/82/" + + +# Herd injected PHP 7.4 configuration. +export HERD_PHP_74_INI_SCAN_DIR="/Users/weerd/Library/Application Support/Herd/config/php/74/" + + +# Herd injected PHP 8.0 configuration. +export HERD_PHP_80_INI_SCAN_DIR="/Users/weerd/Library/Application Support/Herd/config/php/80/" + + +# Herd injected PHP 8.3 configuration. +export HERD_PHP_83_INI_SCAN_DIR="/Users/weerd/Library/Application Support/Herd/config/php/83/" + + +# Herd injected PHP 8.1 configuration. +export HERD_PHP_81_INI_SCAN_DIR="/Users/weerd/Library/Application Support/Herd/config/php/81/" + + +# Herd injected NVM configuration +export NVM_DIR="/Users/weerd/Library/Application Support/Herd/config/nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + +[[ -f "/Applications/Herd.app/Contents/Resources/config/shell/zshrc.zsh" ]] && builtin source "/Applications/Herd.app/Contents/Resources/config/shell/zshrc.zsh" diff --git a/dots/zsh/config/functions b/dots/zsh/config/functions index 05e5cb7..eb2652f 100644 --- a/dots/zsh/config/functions +++ b/dots/zsh/config/functions @@ -1,34 +1,5 @@ -# Papertrail +# Youtube DLP # ------------------------------------------------------------------------------ -# Download all logs matching a pattern. -# Usage: pt-archive -# $ pt-archive 2018-12-01 2018-12-02 "dosomething-northstar" "ns-logs" -# function pt-archive() { -# DIRECTORY=$(pwd) -# FILTER="${3:-\".*\"}" - -# cd $(mktemp -d) - -# echo "Downloading log archives from $1 to $2..." -# curl -sH "X-Papertrail-Token: $PAPERTRAIL_API_KEY" https://papertrailapp.com/api/v1/archives.json | -# grep -o '"filename":"[^"]*"' | egrep -o '[0-9-]+' | -# awk '$0 >= "'$1'" && $0 < "'$2'" { -# print "output " $0 ".tsv.gz" -# print "url https://papertrailapp.com/api/v1/archives/" $0 "/download" -# }' | curl --progress-bar -fLH "X-Papertrail-Token: $PAPERTRAIL_API_KEY" -K- - - -# echo "Unzipping compressed archives..." -# gunzip *.tsv.gz - -# echo "Filtering by '$FILTER' & concatenating to one file..." -# cat *.tsv | grep -E $FILTER > $DIRECTORY/$4.tsv - -# echo "Cleaning up..." -# rm *.tsv - -# echo "All done! 🎊 $DIRECTORY/$4.tsv!" - -# cd - > /dev/null -# } +# alias ytAudio="yt-dlp -f 'ba' -x --audio-format m4a 'youtubelinkhere.com'" +function pullAudio() { yt-dlp -f 'ba' -x --audio-format m4a $1 } diff --git a/dots/zsh/zprofile b/dots/zsh/zprofile deleted file mode 100644 index 38afc70..0000000 --- a/dots/zsh/zprofile +++ /dev/null @@ -1 +0,0 @@ -"(╯°□°)╯︵ ┻━┻" diff --git a/dots/zsh/zshenv b/dots/zsh/zshenv deleted file mode 100644 index 075c5f6..0000000 --- a/dots/zsh/zshenv +++ /dev/null @@ -1,5 +0,0 @@ -# ------------------------------------------------------------------------------ -# ZSH Configuration Directory -# ------------------------------------------------------------------------------ - -export ZDOTDIR="$HOME/.zsh" diff --git a/dots/zsh/zshrc b/dots/zsh/zshrc deleted file mode 100644 index 1f5ebca..0000000 --- a/dots/zsh/zshrc +++ /dev/null @@ -1,27 +0,0 @@ -# zshrc - Diego Lorenzo - -# Exports -export PATH="/usr/local/opt/node@16/bin:$PATH" -export PATH="/usr/local/sbin:$PATH" # brew executables path - - -# Shell Options - -# Change directories when path entered without specifying 'cd' -setopt autocd - - -# ------------------------------------------------------------------------------ -# Bash Profile -# ------------------------------------------------------------------------------ - - -source ~/.zsh/config/prompt -source ~/.zsh/config/aliases -source ~/.zsh/config/bindings -source ~/.zsh/config/extensions # @TODO: script needs to create the config/packages directory that is gitignored - - -# ZSH Version - -echo zsh v$ZSH_VERSION diff --git a/install.sh b/install.sh index c821554..821a491 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,4 @@ -#!/usr/bin/env zsh - +#!/bin/zsh # ------------------------------------------------------------------------------ # Main Installation @@ -14,7 +13,7 @@ CODE_DIRECTORY="$HOME/Code" -# If "Code" does not exist or is not a directory, create it. +# If ~/Code directory does not exist or is not a directory, create it. if [ ! -d $CODE_DIRECTORY ] then mkdir -p $CODE_DIRECTORY @@ -22,7 +21,8 @@ fi cd $CODE_DIRECTORY -# If "dotfiles" does not exist or is not a directory, create it. +# If "dotfiles" does not exist or is not a directory, download the repository +# to create it. if [ ! -d $CODE_DIRECTORY/dotfiles ] then git clone git@github.com:weerd/dotfiles.git @@ -31,7 +31,9 @@ fi cd dotfiles # Make all bash script files in the repository executable. -find ./ -type f -name "*.sh" -exec chmod 755 {} \; +# find ./ -type f -name "*.sh" -exec chmod 755 {} \; # Begin the setup bootstrapping process. -zsh bootstrap.sh +# zsh bootstrap.sh + +echo "Installation Completed." diff --git a/scripts/create_directories.sh b/scripts/create_directories.sh index d167df1..8af07b4 100755 --- a/scripts/create_directories.sh +++ b/scripts/create_directories.sh @@ -1,5 +1,4 @@ -#!/usr/bin/env bash - +#!/bin/zsh # ------------------------------------------------------------------------------ # Create Directories @@ -7,17 +6,13 @@ -source ./extras/colors - - - -# Create Screenshots Directory +# Create Screen Captures Directory # ------------------------------------------------------------------------------ -if [ ! -d $HOME/Screenshots ]; then - mkdir -p $HOME/Screenshots - - printf "\n$SUCCESS - %s$RESET\n" "Screenshots directory created." +if [ ! -d $HOME/"Screen Captures" ]; then + mkdir -p $HOME/"Screen Captures" + + echo "Screen Captures directory created." else - printf "\n$INFO - %s$RESET\n" "Screenshots directory already exists." + echo "Screen Captures directory already exists." fi diff --git a/scripts/symlinks.sh b/scripts/symlinks.sh index 5527a14..76e5c2b 100755 --- a/scripts/symlinks.sh +++ b/scripts/symlinks.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/zsh # ------------------------------------------------------------------------------ @@ -7,29 +7,33 @@ -source ./extras/colors - - - # Link Dotfiles Into Home Directory # ------------------------------------------------------------------------------ +# +# @see https://www.man7.org/linux/man-pages/man1/bash.1.html#CONDITIONAL_EXPRESSIONS +# -e is true if file exists. +# -h is true if file exists and is a symbolic link. +# ln -sf creates a soft (symbolic) link, and forces the command to overwrite a +# file that alread exists. dir="$HOME/Code" -if [ ! -d ~/.bash ]; then - ln -s $dir/dotfiles/dots/.bash ~/.bash -fi +if [ ! -e ~/.zshenv ] || [ ! -h ~/.zshenv ]; then + ln -sf $dir/dotfiles/dots/zsh/.zshenv ~/.zshenv -if [ ! -e ~/.bash_profile ]; then - ln -s $dir/dotfiles/dots/.bash_profile ~/.bash_profile + echo "Created symlink for .zshenv file." fi -if [ ! -e ~/.gitconfig ]; then - ln -s $dir/dotfiles/dots/.gitconfig ~/.gitconfig +if [ ! -e ~/.gitconfig ] || [ ! -h ~/.gitconfig ]; then + ln -sf $dir/dotfiles/dots/.gitconfig ~/.gitconfig + + echo "Created symlink for .gitconfig file." fi -if [ ! -e ~/.gitignore ]; then - ln -s $dir/dotfiles/dots/.gitignore ~/.gitignore +if [ ! -e ~/.gitignore ] || [ ! -h ~/.gitignore ]; then + ln -sf $dir/dotfiles/dots/.gitignore ~/.gitignore + + echo "Created symlink for .gitignore file." fi -printf "\n$INFO - %s$RESET\n" "Dotfiles were symlinked into the home directory." +echo "Dotfiles were symlinked into the home directory."