Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dotfiles for macOS #139

Merged
merged 12 commits into from
Jun 11, 2024
18 changes: 16 additions & 2 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,29 @@ source $ZSH/oh-my-zsh.sh
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias dc='docker compose'
alias dce='dc exec'
alias dcr='dc run'

alias art='php artisan'
alias tinker='art tinker'
alias phpunit='vendor/bin/phpunit'
alias sail='vendor/bin/sail'
alias pint='vendor/bin/pint'
alias phpstan='vendor/bin/phpstan'

alias c='clear'

alias g='git'
alias gti='git'
alias nah='git reset --hard; git clean -df'

source ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.oh-my-zsh/custom/plugins/fast-syntax-highlighting/F-Sy-H.plugin.zsh

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
12 changes: 12 additions & 0 deletions global/zsh-additional.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Fast Syntax Highlighting
sudo git clone https://github.com/zdharma/fast-syntax-highlighting.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/plugins/fast-syntax-highlighting
# ZSH Autosuggestions
sudo git clone https://github.com/zsh-users/zsh-autosuggestions.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/plugins/zsh-autosuggestions
# p10k theme
sudo git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/themes/powerlevel10k
# end ====== oh-my-zsh

# set zsh as default
chsh -s /bin/"${REQUIRED_PKG:-zsh}"
10 changes: 1 addition & 9 deletions linux/options/packages/zsh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ if [ "" = "$PKG_OK" ]; then

# start ====== oh-my-zsh
sudo git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
# Fast Syntax Highlighting
sudo git clone https://github.com/zdharma/fast-syntax-highlighting.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/plugins/fast-syntax-highlighting
# ZSH Autosuggestions
sudo git clone https://github.com/zsh-users/zsh-autosuggestions.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/plugins/zsh-autosuggestions
# p10k theme
sudo git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/themes/powerlevel10k
# end ====== oh-my-zsh

# set zsh as default
chsh -s /bin/$REQUIRED_PKG
bash ../../../global/zsh-additional.sh
fi
20 changes: 10 additions & 10 deletions linux/options/setup/after-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ while true; do
sudo apt install gir1.2-gda-5.0 gir1.2-gsound-1.0 -y # install gsound for 'Pano Clipboard Manager'
#cp -TRv ../../../ "${ZSH_CUSTOM:-$HOME/}"

cp -TR ../../../.psensor ~/.psensor
cp ../../../.zshrc ~/.zshrc
cp ../../../.p10k.zsh ~/.p10k.zsh
cp -TR ../../../.config ~/.config
cp -TR ../../../.psensor "${ZSH_CUSTOM:-$HOME}"/.psensor
cp ../../../.zshrc "${ZSH_CUSTOM:-$HOME}"/.zshrc
cp ../../../.p10k.zsh "${ZSH_CUSTOM:-$HOME}"/.p10k.zsh
cp -TR ../../../.config "${ZSH_CUSTOM:-$HOME}"/.config

if [ -d ~/.local ]; then
cp -TR ../../../.local ~/.local
if [ -d "${ZSH_CUSTOM:-$HOME}"/.local ]; then
cp -TR ../../../.local "${ZSH_CUSTOM:-$HOME}"/.local
fi

# shellcheck disable=SC1091
Expand All @@ -37,11 +37,11 @@ while true; do
OS=$NAME

if [ "$OS" == "Ubuntu" ]; then
cp -TR ../../../ubuntu/.config ~/.config
cp -TR ../../../ubuntu/.local ~/.local
cp -TR ../../../ubuntu/.config "${ZSH_CUSTOM:-$HOME}"/.config
cp -TR ../../../ubuntu/.local "${ZSH_CUSTOM:-$HOME}"/.local
elif [ "$OS" == "Zorin OS" ]; then
cp -TR ../../../zorin/.config ~/.config
cp -TR ../../../zorin/.local ~/.local
cp -TR ../../../zorin/.config "${ZSH_CUSTOM:-$HOME}"/.config
cp -TR ../../../zorin/.local "${ZSH_CUSTOM:-$HOME}"/.local
fi
fi

Expand Down
2 changes: 2 additions & 0 deletions macos/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ brew "jq"
brew "neofetch"
brew "nginx"
brew "pinentry-mac"
brew "pngquant"
brew "tree"
cask "google-chrome"
cask "docker"
cask "font-aileron"
Expand Down
8 changes: 8 additions & 0 deletions macos/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Ensure ~/.config is exists
mkdir -p "${ZSH_CUSTOM:-$HOME}"/.config

bash ../global/zsh-additional.sh
cp ../.zshrc "${ZSH_CUSTOM:-$HOME}"
cp ../.p10k.zsh "${ZSH_CUSTOM:-$HOME}"/.p10k.zsh
5 changes: 5 additions & 0 deletions macos/develop/packages/nvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
nvm install --lts
4 changes: 3 additions & 1 deletion macos/develop/setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash

bash packages/nvm.sh

brewInstallation() {
APP_LIST=("visual-studio-code" "dbngin" "tableplus" "postman")
APP_LIST=("visual-studio-code" "dbngin" "tableplus" "postman" "insomnia")

for appName in "${APP_LIST[@]}"; do
echo "=========================== $appName ==========================="
Expand Down
4 changes: 3 additions & 1 deletion macos/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ done

echo '####################################################################'
brewInstallation() {
APP_LIST=("skype" "spotify" "anydesk" "teamviewer" "obs" "chatgpt" "slack" "gpg-suite" "notion" "zoom" "figma")
APP_LIST=("iterm2" "skype" "spotify" "anydesk" "teamviewer" "obs" "chatgpt" "slack" "gpg-suite" "notion" "zoom" "figma" "vlc")

for appName in "${APP_LIST[@]}"; do
echo "=========================== $appName ==========================="
Expand Down Expand Up @@ -101,3 +101,5 @@ brewFormulaInstallation
if [[ $ACCEPT_INSTALL =~ ^[Yy]$ ]]; then
sudo spctl --master-enable
fi

bash config.sh
Loading