mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 00:33:00 +00:00
refractor(bootstrap): Format with shfmt
This commit is contained in:
parent
f015467b1b
commit
0ce74497cd
21 changed files with 271 additions and 377 deletions
68
.github/workflows/shell-check.yml
vendored
Normal file
68
.github/workflows/shell-check.yml
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
name: Shell Script Check & Format
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '**.sh'
|
||||||
|
- '**.bash'
|
||||||
|
- '**.zsh'
|
||||||
|
- '**.bashrc'
|
||||||
|
- 'justfile'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**.sh'
|
||||||
|
- '**.bash'
|
||||||
|
- '**.zsh'
|
||||||
|
- '**.bashrc'
|
||||||
|
- 'justfile'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
shell-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install just
|
||||||
|
uses: extractions/setup-just@v2
|
||||||
|
|
||||||
|
- name: Install shellcheck
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y shellcheck
|
||||||
|
|
||||||
|
- name: Install go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '>=1.17.0'
|
||||||
|
- run: go version
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get update
|
||||||
|
# sudo apt-get install -y go
|
||||||
|
|
||||||
|
- name: Install shfmt
|
||||||
|
run: |
|
||||||
|
go install mvdan.cc/sh/v3/cmd/shfmt@latest
|
||||||
|
echo "$HOME/go/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: fish-actions/install-fish
|
||||||
|
uses: fish-actions/install-fish@v1.1.0
|
||||||
|
|
||||||
|
- name: Run shell script check
|
||||||
|
run: just check
|
||||||
|
|
||||||
|
- name: Run shell script format
|
||||||
|
run: just format
|
||||||
|
|
||||||
|
- name: Check for changes
|
||||||
|
id: git-check
|
||||||
|
run: |
|
||||||
|
git diff --exit-code || echo "format_changes=true" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Commit changes
|
||||||
|
if: steps.git-check.outputs.format_changes == 'true'
|
||||||
|
run: |
|
||||||
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --local user.name "github-actions[bot]"
|
||||||
|
git add -A
|
||||||
|
git commit -m "style: format shell scripts"
|
||||||
|
git push
|
||||||
10
Justfile
10
Justfile
|
|
@ -1,6 +1,16 @@
|
||||||
set shell := ["fish", "-c"]
|
set shell := ["fish", "-c"]
|
||||||
set windows-shell := ["pwsh", "-c"]
|
set windows-shell := ["pwsh", "-c"]
|
||||||
|
|
||||||
|
check_info:
|
||||||
|
shellcheck -x -s sh ./bootstrap/**/*.sh
|
||||||
|
shellcheck -x -s bash **/*.bash tools/bash/* scripts/*.{sh,zsh,bash} **/*.bashrc
|
||||||
|
check:
|
||||||
|
shellcheck -x -s sh --severity=error ./bootstrap/**/*.sh
|
||||||
|
shellcheck -x -s bash --severity=error **/*.bash tools/bash/* **/*.bashrc
|
||||||
|
format:
|
||||||
|
# shfmt -w -d -i 2 -ci -bn **/*.sh tools/bash/* scripts/*.{sh,bash,zsh} **/*.bashrc
|
||||||
|
shfmt -w -d -i 2 -ci -bn -p ./bootstrap/**/*.sh
|
||||||
|
shfmt -w -d -i 2 -ci -bn -ln bash ./bootstrap/**/*.bash
|
||||||
pull:
|
pull:
|
||||||
git pull github master
|
git pull github master
|
||||||
git pull codeberg master
|
git pull codeberg master
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
# nodejs
|
|
||||||
npm install -g typescript
|
|
||||||
npm install -g tsx
|
|
||||||
|
|
||||||
# dotnet
|
|
||||||
dotnet tool install -g dotnet-script
|
|
||||||
dotnet tool install -g dotnet-repl
|
|
||||||
|
|
||||||
# python
|
|
||||||
pip install neovim
|
|
||||||
pip install requests
|
|
||||||
pip install ipython
|
|
||||||
pip install jupyter
|
|
||||||
pip install numpy
|
|
||||||
pip install matplotlib
|
|
||||||
pip install pandas
|
|
||||||
pip install scipy
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# shellcheck shell=sh
|
||||||
echo "[INFO] Installing DOOM Emacs"
|
echo "[INFO] Installing DOOM Emacs"
|
||||||
echo "[ACTION] Request Human Takeover"
|
echo "[ACTION] Request Human Takeover"
|
||||||
test -d ~/.config/emacs && mv ~/.config/emacs ~/.config/emacs.bak
|
test -d ~/.config/emacs && mv ~/.config/emacs ~/.config/emacs.bak
|
||||||
git clnh https://github.com/doomemacs/doomemacs ~/.config/emacs
|
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
|
||||||
~/.config/emacs/bin/doom install
|
~/.config/emacs/bin/doom install
|
||||||
~/.config/emacs/bin/doom sync
|
~/.config/emacs/bin/doom sync
|
||||||
|
|
||||||
echo "[INFO] Installing Emacs-Rime"
|
echo "[INFO] Installing Emacs-Rime"
|
||||||
git clnh https://github.com/js0ny/Rime.git ~/.config/emacs/.local/cache/rime
|
git clone --depth 1 https://github.com/js0ny/Rime.git ~/.config/emacs/.local/cache/rime
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
echo "[INFO] Installing Rime"
|
echo "[INFO] Installing Rime"
|
||||||
|
|
||||||
git clone --depth 1 https://github.com/js0ny/rime_wanxiang_pro.git ~/Library/Rime
|
git clone --depth 1 https://github.com/js0ny/rime_wanxiang_pro.git ~/Library/Rime
|
||||||
|
|
@ -8,4 +7,3 @@ just init
|
||||||
# just install_rime
|
# just install_rime
|
||||||
## Rime is installed via Brewfile
|
## Rime is installed via Brewfile
|
||||||
just clone_plum
|
just clone_plum
|
||||||
|
|
||||||
|
|
|
||||||
110
bootstrap/components/symlinks.bash
Normal file
110
bootstrap/components/symlinks.bash
Normal file
|
|
@ -0,0 +1,110 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# vim:ft=bash
|
||||||
|
# shellcheck disable=SC1090 shell=bash
|
||||||
|
# This should be run with bash > 4.0 or zsh
|
||||||
|
set -e # Exit immediately if a command exits with a non-zero status
|
||||||
|
|
||||||
|
DOTFILES="${DOTFILES:-$HOME/.dotfiles}"
|
||||||
|
ZDOTDIR="${ZDOTDIR:-$HOME/.config/zsh}"
|
||||||
|
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||||
|
NPM_CONFIG_USERCONFIG="${NPM_CONFIG_USERCONFIG:-$XDG_CONFIG_HOME/npm/npmrc}"
|
||||||
|
GUI_SETUP="${GUI_SETUP:-1}"
|
||||||
|
WHEEL="${WHEEL:-0}"
|
||||||
|
|
||||||
|
XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||||
|
XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
||||||
|
XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
||||||
|
|
||||||
|
echo "[INFO] Setting up some local directories"
|
||||||
|
test -d $XDG_CACHE_HOME || mkdir -p $XDG_CACHE_HOME
|
||||||
|
test -d $XDG_DATA_HOME || mkdir -p $XDG_DATA_HOME
|
||||||
|
test -d $XDG_STATE_HOME || mkdir -p $XDG_STATE_HOME
|
||||||
|
test -d ~/.local/state/zsh || mkdir -p ~/.local/state/zsh
|
||||||
|
|
||||||
|
# echo "[INFO] Setting up system-wide zsh configuration"
|
||||||
|
# echo "[ACTION] Elevation required!"
|
||||||
|
# test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zsh/zshenv"
|
||||||
|
# test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zshenv"
|
||||||
|
|
||||||
|
declare -A linkDots
|
||||||
|
|
||||||
|
linkDots=(
|
||||||
|
["$DOTFILES/common/condarc.yaml"]="$XDG_CONFIG_HOME/conda/.condarc"
|
||||||
|
# ["$DOTFILES/common/gitconfig"]="$XDG_CONFIG_HOME/git/config"
|
||||||
|
["$DOTFILES/common/glow.yaml"]="$HOME/.config/glow/config.yml"
|
||||||
|
["$DOTFILES/common/haskeline"]="$HOME/.haskeline"
|
||||||
|
["$DOTFILES/common/ideavimrc"]="$XDG_CONFIG_HOME/ideavim/ideavimrc"
|
||||||
|
["$DOTFILES/common/lazygit.yaml"]="$XDG_CONFIG_HOME/lazygit/config.yml"
|
||||||
|
["$DOTFILES/common/lesskey"]="$XDG_CONFIG_HOME/lesskey"
|
||||||
|
["$DOTFILES/common/npmrc"]="$NPM_CONFIG_USERCONFIG"
|
||||||
|
["$DOTFILES/common/NuGet.Config"]="$XDG_CONFIG_HOME/NuGet/NuGet.Config"
|
||||||
|
["$DOTFILES/common/pip.conf"]="$XDG_CONFIG_HOME/pip/pip.conf"
|
||||||
|
["$DOTFILES/common/starship.toml"]="$HOME/.config/starship.toml"
|
||||||
|
["$DOTFILES/common/tmux.conf"]="$XDG_CONFIG_HOME/tmux/tmux.conf"
|
||||||
|
["$DOTFILES/common/vimrc"]="$XDG_CONFIG_HOME/vim/vimrc"
|
||||||
|
["$DOTFILES/common/zellij.config.kdl"]="$HOME/.config/zellij/config.kdl"
|
||||||
|
# ["$DOTFILES/tools/emacs.d"]="$HOME/.emacs.d"
|
||||||
|
["$DOTFILES/tools/doom"]="$HOME/.config/doom"
|
||||||
|
["$DOTFILES/tools/fish"]="$HOME/.config/fish"
|
||||||
|
["$DOTFILES/tools/ipython"]="$XDG_CONFIG_HOME/ipython"
|
||||||
|
["$DOTFILES/tools/nvim"]="$XDG_CONFIG_HOME/nvim"
|
||||||
|
["$DOTFILES/tools/yazi"]="$HOME/.config/yazi"
|
||||||
|
["$DOTFILES/tools/zsh/zshrc"]="$ZDOTDIR/.zshrc"
|
||||||
|
["$DOTFILES/tools/zsh/zshenv"]="$ZDOTDIR/.zshenv"
|
||||||
|
["$DOTFILES/platforms/mac/pwshProfile.ps1"]="$HOME/.config/powershell/Microsoft.PowerShell_profile.ps1"
|
||||||
|
)
|
||||||
|
|
||||||
|
if [ $(uname) = "Darwin" ]; then
|
||||||
|
echo "[INFO] Running on macOS"
|
||||||
|
linkDots+=(
|
||||||
|
["$DOTFILES/platforms/mac/karabiner"]="$HOME/.config/karabiner"
|
||||||
|
["$DOTFILES/platforms/mac/skhdrc"]="$XDG_CONFIG_HOME/skhd/skhdrc"
|
||||||
|
["$DOTFILES/platforms/mac/sketchybarrc"]="$XDG_CONFIG_HOME/sketchybar/sketchybarrc"
|
||||||
|
["$DOTFILES/platforms/mac/yabairc"]="$XDG_CONFIG_HOME/yabai/yabairc"
|
||||||
|
["$DOTFILES/tools/wezterm"]="$HOME/.config/wezterm"
|
||||||
|
["$DOTFILES/tools/zed"]="$HOME/.config/zed"
|
||||||
|
["$DOTFILES/tools/sioyek"]="$HOME/.config/sioyek"
|
||||||
|
)
|
||||||
|
else
|
||||||
|
echo "[INFO] Running on Linux"
|
||||||
|
linkDots+=(
|
||||||
|
["$DOTFILES/common/inputrc"]="$HOME/.inputrc"
|
||||||
|
)
|
||||||
|
# WSL1 : Microsoft
|
||||||
|
# WSL2 : microsoft
|
||||||
|
# if [ "$(uname -r)" = *icrosoft* ]; then
|
||||||
|
# echo "[INFO] Running on WSL"
|
||||||
|
# : # NOP
|
||||||
|
if [ "$GUI_SETUP" -eq 1 ]; then
|
||||||
|
echo "[INFO] Setting up Linux GUI Applications"
|
||||||
|
linkDots+=(
|
||||||
|
["$DOTFILES/platforms/linux/awesome"]="$HOME/.config/awesome"
|
||||||
|
["$DOTFILES/platforms/linux/hypr"]="$HOME/.config/hypr"
|
||||||
|
["$DOTFILES/platforms/linux/waybar"]="$HOME/.config/waybar"
|
||||||
|
["$DOTFILES/platforms/linux/wlogout"]="$HOME/.config/wlogout"
|
||||||
|
["$DOTFILES/platforms/linux/mako-config"]="$HOME/.config/mako/config"
|
||||||
|
["$DOTFILES/tools/wezterm"]="$HOME/.config/wezterm"
|
||||||
|
["$DOTFILES/tools/zed"]="$HOME/.config/zed"
|
||||||
|
["$DOTFILES/tools/sioyek"]="$HOME/.config/sioyek"
|
||||||
|
)
|
||||||
|
for kde in "$DOTFILES/platforms/linux/kde/"*; do
|
||||||
|
linkDots+=["$kde"]="$HOME/.config/kde/$(basename $kde)"
|
||||||
|
# echo "Linking $kde to $HOME/.config/kde/$(basename $kde)"
|
||||||
|
done
|
||||||
|
if [ "$WHEEL" -eq 1 ]; then
|
||||||
|
echo "[INFO] Setting up system environment variables"
|
||||||
|
echo "[ACTION] Elevation required!"
|
||||||
|
sudo cp "$DOTFILES/platforms/linux/etc/environment" "/etc/environment"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[INFO] Copying example files"
|
||||||
|
test -d $XDG_CONFIG_HOME/git || mkdir -p $XDG_CONFIG_HOME/git
|
||||||
|
test -f $XDG_CONFIG_HOME/git/config && mv $XDG_CONFIG_HOME/git/config $XDG_CONFIG_HOME/git/config.bak
|
||||||
|
cp $DOTFILES/common/gitconfig.example $XDG_CONFIG_HOME/git/config
|
||||||
|
echo "[INFO] Don't forget to update your gitconfig!"
|
||||||
|
|
||||||
|
test -f ~/.wakatime.cfg && mv ~/.wakatime.cfg ~/.wakatime.cfg.bak
|
||||||
|
cp $DOTFILES/common/wakatime.example.cfg ~/.wakatime.cfg
|
||||||
|
echo "[INFO] Don't forget to update your wakatime config!"
|
||||||
|
|
@ -1,109 +0,0 @@
|
||||||
# This should be run with bash > 4.0 or zsh
|
|
||||||
set -e # Exit immediately if a command exits with a non-zero status
|
|
||||||
|
|
||||||
DOTFILES="${DOTFILES:-$HOME/.dotfiles}"
|
|
||||||
ZDOTDIR="${ZDOTDIR:-$HOME/.config/zsh}"
|
|
||||||
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
|
||||||
NPM_CONFIG_USERCONFIG="${NPM_CONFIG_USERCONFIG:-$XDG_CONFIG_HOME/npm/npmrc}"
|
|
||||||
GUI_SETUP="${GUI_SETUP:-1}"
|
|
||||||
WHEEL="${WHEEL:-0}"
|
|
||||||
|
|
||||||
XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
|
||||||
XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
|
||||||
XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
|
||||||
|
|
||||||
echo "[INFO] Setting up some local directories"
|
|
||||||
test -d $XDG_CACHE_HOME || mkdir -p $XDG_CACHE_HOME
|
|
||||||
test -d $XDG_DATA_HOME || mkdir -p $XDG_DATA_HOME
|
|
||||||
test -d $XDG_STATE_HOME || mkdir -p $XDG_STATE_HOME
|
|
||||||
test -d ~/.local/state/zsh || mkdir -p ~/.local/state/zsh
|
|
||||||
|
|
||||||
# echo "[INFO] Setting up system-wide zsh configuration"
|
|
||||||
# echo "[ACTION] Elevation required!"
|
|
||||||
# test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zsh/zshenv"
|
|
||||||
# test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zshenv"
|
|
||||||
|
|
||||||
declare -A linkDots
|
|
||||||
|
|
||||||
linkDots=(
|
|
||||||
["$DOTFILES/common/condarc.yaml"]="$XDG_CONFIG_HOME/conda/.condarc"
|
|
||||||
# ["$DOTFILES/common/gitconfig"]="$XDG_CONFIG_HOME/git/config"
|
|
||||||
["$DOTFILES/common/glow.yaml"]="$HOME/.config/glow/config.yml"
|
|
||||||
["$DOTFILES/common/haskeline"]="$HOME/.haskeline"
|
|
||||||
["$DOTFILES/common/ideavimrc"]="$XDG_CONFIG_HOME/ideavim/ideavimrc"
|
|
||||||
["$DOTFILES/common/lazygit.yaml"]="$XDG_CONFIG_HOME/lazygit/config.yml"
|
|
||||||
["$DOTFILES/common/lesskey"]="$XDG_CONFIG_HOME/lesskey"
|
|
||||||
["$DOTFILES/common/npmrc"]="$NPM_CONFIG_USERCONFIG"
|
|
||||||
["$DOTFILES/common/NuGet.Config"]="$XDG_CONFIG_HOME/NuGet/NuGet.Config"
|
|
||||||
["$DOTFILES/common/pip.conf"]="$XDG_CONFIG_HOME/pip/pip.conf"
|
|
||||||
["$DOTFILES/common/starship.toml"]="$HOME/.config/starship.toml"
|
|
||||||
["$DOTFILES/common/tmux.conf"]="$XDG_CONFIG_HOME/tmux/tmux.conf"
|
|
||||||
["$DOTFILES/common/vimrc"]="$XDG_CONFIG_HOME/vim/vimrc"
|
|
||||||
["$DOTFILES/common/zellij.config.kdl"]="$HOME/.config/zellij/config.kdl"
|
|
||||||
# ["$DOTFILES/tools/emacs.d"]="$HOME/.emacs.d"
|
|
||||||
["$DOTFILES/tools/doom"]="$HOME/.config/doom"
|
|
||||||
["$DOTFILES/tools/fish"]="$HOME/.config/fish"
|
|
||||||
["$DOTFILES/tools/ipython"]="$XDG_CONFIG_HOME/ipython"
|
|
||||||
["$DOTFILES/tools/nvim"]="$XDG_CONFIG_HOME/nvim"
|
|
||||||
["$DOTFILES/tools/yazi"]="$HOME/.config/yazi"
|
|
||||||
["$DOTFILES/tools/zsh/zshrc"]="$ZDOTDIR/.zshrc"
|
|
||||||
["$DOTFILES/tools/zsh/zshenv"]="$ZDOTDIR/.zshenv"
|
|
||||||
["$DOTFILES/platforms/mac/pwshProfile.ps1"]="$HOME/.config/powershell/Microsoft.PowerShell_profile.ps1"
|
|
||||||
)
|
|
||||||
|
|
||||||
if [ $(uname) = "Darwin" ]; then
|
|
||||||
echo "[INFO] Running on macOS"
|
|
||||||
linkDots+=(
|
|
||||||
["$DOTFILES/platforms/mac/karabiner"]="$HOME/.config/karabiner"
|
|
||||||
["$DOTFILES/platforms/mac/skhdrc"]="$XDG_CONFIG_HOME/skhd/skhdrc"
|
|
||||||
["$DOTFILES/platforms/mac/sketchybarrc"]="$XDG_CONFIG_HOME/sketchybar/sketchybarrc"
|
|
||||||
["$DOTFILES/platforms/mac/yabairc"]="$XDG_CONFIG_HOME/yabai/yabairc"
|
|
||||||
["$DOTFILES/tools/wezterm"]="$HOME/.config/wezterm"
|
|
||||||
["$DOTFILES/tools/zed"]="$HOME/.config/zed"
|
|
||||||
["$DOTFILES/tools/sioyek"]="$HOME/.config/sioyek"
|
|
||||||
)
|
|
||||||
else
|
|
||||||
echo "[INFO] Running on Linux"
|
|
||||||
linkDots+=(
|
|
||||||
["$DOTFILES/common/inputrc"]="$HOME/.inputrc"
|
|
||||||
)
|
|
||||||
# WSL1 : Microsoft
|
|
||||||
# WSL2 : microsoft
|
|
||||||
# if [ "$(uname -r)" = *icrosoft* ]; then
|
|
||||||
# echo "[INFO] Running on WSL"
|
|
||||||
# : # NOP
|
|
||||||
if [ "$GUI_SETUP" -eq 1 ]; then
|
|
||||||
echo "[INFO] Setting up Linux GUI Applications"
|
|
||||||
linkDots+=(
|
|
||||||
["$DOTFILES/platforms/linux/awesome"]="$HOME/.config/awesome"
|
|
||||||
["$DOTFILES/platforms/linux/hypr"]="$HOME/.config/hypr"
|
|
||||||
["$DOTFILES/platforms/linux/waybar"]="$HOME/.config/waybar"
|
|
||||||
["$DOTFILES/platforms/linux/wlogout"]="$HOME/.config/wlogout"
|
|
||||||
["$DOTFILES/platforms/linux/mako-config"]="$HOME/.config/mako/config"
|
|
||||||
["$DOTFILES/tools/wezterm"]="$HOME/.config/wezterm"
|
|
||||||
["$DOTFILES/tools/zed"]="$HOME/.config/zed"
|
|
||||||
["$DOTFILES/tools/sioyek"]="$HOME/.config/sioyek"
|
|
||||||
)
|
|
||||||
for kde in "$DOTFILES/platforms/linux/kde/"*; do
|
|
||||||
linkDots+=["$kde"]="$HOME/.config/kde/$(basename $kde)"
|
|
||||||
# echo "Linking $kde to $HOME/.config/kde/$(basename $kde)"
|
|
||||||
done
|
|
||||||
if [ "$WHEEL" -eq 1 ]; then
|
|
||||||
echo "[INFO] Setting up system environment variables"
|
|
||||||
echo "[ACTION] Elevation required!"
|
|
||||||
sudo cp "$DOTFILES/platforms/linux/etc/environment" "/etc/environment"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "[INFO] Copying example files"
|
|
||||||
test -d $XDG_CONFIG_HOME/git || mkdir -p $XDG_CONFIG_HOME/git
|
|
||||||
test -f $XDG_CONFIG_HOME/git/config && mv $XDG_CONFIG_HOME/git/config $XDG_CONFIG_HOME/git/config.bak
|
|
||||||
cp $DOTFILES/common/gitconfig.example $XDG_CONFIG_HOME/git/config
|
|
||||||
echo "[INFO] Don't forget to update your gitconfig!"
|
|
||||||
|
|
||||||
test -f ~/.wakatime.cfg && mv ~/.wakatime.cfg ~/.wakatime.cfg.bak
|
|
||||||
cp $DOTFILES/common/wakatime.example.cfg ~/.wakatime.cfg
|
|
||||||
echo "[INFO] Don't forget to update your wakatime config!"
|
|
||||||
|
|
@ -7,22 +7,20 @@ echo "[INFO] WHEEL = $WHEEL"
|
||||||
echo "[ACTION] Press any key to proceed"
|
echo "[ACTION] Press any key to proceed"
|
||||||
read -n 1
|
read -n 1
|
||||||
|
|
||||||
|
|
||||||
if [ "$WHEEL" -eq 1 ]; then
|
if [ "$WHEEL" -eq 1 ]; then
|
||||||
echo "[INFO] Setting up system-wide zsh configuration"
|
echo "[INFO] Setting up system-wide zsh configuration"
|
||||||
echo "[ACTION] Elevation required"
|
echo "[ACTION] Elevation required"
|
||||||
test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zsh/zshenv"
|
test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zsh/zshenv"
|
||||||
test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zshenv"
|
test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zshenv"
|
||||||
if [ $(uname) = "Darwin" ]; then
|
if [ $(uname) = "Darwin" ]; then
|
||||||
sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zshenv"
|
sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zshenv"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "[INFO] Setting up user zsh configuration"
|
echo "[INFO] Setting up user zsh configuration"
|
||||||
# A fallback case to set $ZDOTDIR in ~/.zshenv if the user cannot access global zshenv
|
# A fallback case to set $ZDOTDIR in ~/.zshenv if the user cannot access global zshenv
|
||||||
ln -sf "$DOTFILES/tools/zsh/zshenv" "$HOME/.zshenv"
|
ln -sf "$DOTFILES/tools/zsh/zshenv" "$HOME/.zshenv"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "[INFO] Installing zsh plugins"
|
echo "[INFO] Installing zsh plugins"
|
||||||
test -d $ZDOTDIR/plugins/zsh-autosuggestions || git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git $ZDOTDIR/plugins/zsh-autosuggestions
|
test -d $ZDOTDIR/plugins/zsh-autosuggestions || git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git $ZDOTDIR/plugins/zsh-autosuggestions
|
||||||
test -d $ZDOTDIR/plugins/zsh-syntax-highlighting || git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git $ZDOTDIR/plugins/zsh-syntax-highlighting
|
test -d $ZDOTDIR/plugins/zsh-syntax-highlighting || git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git $ZDOTDIR/plugins/zsh-syntax-highlighting
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# vim:ft=bash
|
||||||
echo "[INFO] Installing AppMan"
|
echo "[INFO] Installing AppMan"
|
||||||
echo "[ACTION] Type [2] to install AppMan"
|
echo "[ACTION] Type [2] to install AppMan"
|
||||||
wget -q https://raw.githubusercontent.com/ivan-hc/AM/main/AM-INSTALLER && chmod a+x ./AM-INSTALLER && ./AM-INSTALLER
|
wget -q https://raw.githubusercontent.com/ivan-hc/AM/main/AM-INSTALLER && chmod a+x ./AM-INSTALLER && ./AM-INSTALLER
|
||||||
|
|
@ -5,6 +7,6 @@ wget -q https://raw.githubusercontent.com/ivan-hc/AM/main/AM-INSTALLER && chmod
|
||||||
APPMAN_PATH="$HOME/.local/bin/appman"
|
APPMAN_PATH="$HOME/.local/bin/appman"
|
||||||
|
|
||||||
if command -v $APPMAN_PATH >/dev/null 2>&1; then
|
if command -v $APPMAN_PATH >/dev/null 2>&1; then
|
||||||
$APPMAN_PATH install wezterm
|
$APPMAN_PATH install wezterm
|
||||||
$APPMAN_PATH install nvim
|
$APPMAN_PATH install nvim
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
# vim:ft=bash
|
||||||
# chromium-flags.sh
|
# chromium-flags.sh
|
||||||
# Set Chromium & Electron Flags
|
# Set Chromium & Electron Flags
|
||||||
|
|
||||||
|
|
@ -12,35 +13,34 @@ ELECTRON_FLAG=$DOTFILES/platforms/linux/electron-flags.conf
|
||||||
# Browser Flags
|
# Browser Flags
|
||||||
|
|
||||||
browser_flags_path=(
|
browser_flags_path=(
|
||||||
"$XDG_CONFIG_HOME/chromium-flags.conf" # Chromium
|
"$XDG_CONFIG_HOME/chromium-flags.conf" # Chromium
|
||||||
"$XDG_CONFIG_HOME/chrome-flags.conf" # Google Chrome
|
"$XDG_CONFIG_HOME/chrome-flags.conf" # Google Chrome
|
||||||
"$XDG_CONFIG_HOME/thorium-flags.conf" # Thorium
|
"$XDG_CONFIG_HOME/thorium-flags.conf" # Thorium
|
||||||
"$XDG_CONFIG_HOME/vivaldi-flags.conf" # Vivaldi
|
"$XDG_CONFIG_HOME/vivaldi-flags.conf" # Vivaldi
|
||||||
"$XDG_CONFIG_HOME/vivaldi-stable.conf" # Vivaldi
|
"$XDG_CONFIG_HOME/vivaldi-stable.conf" # Vivaldi
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
electron_flags_path=(
|
electron_flags_path=(
|
||||||
"$XDG_CONFIG_HOME/electron-flags.conf" # General
|
"$XDG_CONFIG_HOME/electron-flags.conf" # General
|
||||||
"$XDG_CONFIG_HOME/code-flags.conf" # VSCode
|
"$XDG_CONFIG_HOME/code-flags.conf" # VSCode
|
||||||
"$XDG_CONFIG_HOME/qq-electron-flags.conf" # Slack
|
"$XDG_CONFIG_HOME/qq-electron-flags.conf" # Slack
|
||||||
)
|
)
|
||||||
|
|
||||||
for path in "${browser_flags_path[@]}"; do
|
for path in "${browser_flags_path[@]}"; do
|
||||||
if [ -f "$path" ]; then
|
if [ -f "$path" ]; then
|
||||||
echo "[INFO] Found Browser Flags: $path"
|
echo "[INFO] Found Browser Flags: $path"
|
||||||
else
|
else
|
||||||
echo "[INFO] Creating Browser Flags: $path"
|
echo "[INFO] Creating Browser Flags: $path"
|
||||||
ln -s $BROWSER_FLAG $path
|
ln -s $BROWSER_FLAG $path
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
for path in "${electron_flags_path[@]}"; do
|
for path in "${electron_flags_path[@]}"; do
|
||||||
if [ -f "$path" ]; then
|
if [ -f "$path" ]; then
|
||||||
echo "[INFO] Found Electron Flags: $path"
|
echo "[INFO] Found Electron Flags: $path"
|
||||||
else
|
else
|
||||||
echo "[INFO] Creating Electron Flags: $path"
|
echo "[INFO] Creating Electron Flags: $path"
|
||||||
ln -s $ELECTRON_FLAG $path
|
ln -s $ELECTRON_FLAG $path
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# vim:ft=bash
|
# vim:ft=bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
@ -21,15 +21,15 @@ fi
|
||||||
|
|
||||||
export WHEEL
|
export WHEEL
|
||||||
|
|
||||||
|
|
||||||
GUI_SETUP=0
|
GUI_SETUP=0
|
||||||
|
|
||||||
if [ "$(uname -r)" = *Microsoft* ]; then
|
# NOTE: This is NOT a POSIX-compliant way, for POSIX-compliant way, use case/esac
|
||||||
|
if [[ "$(uname -r)" = *Microsoft* ]]; then
|
||||||
echo "[INFO] Running on WSL1 Skipping GUI setup"
|
echo "[INFO] Running on WSL1 Skipping GUI setup"
|
||||||
else
|
else
|
||||||
read -p "[ACTION] Do you want to setup Linux GUI? (y/N) " choice
|
read -p "[ACTION] Do you want to setup Linux GUI? (y/N) " choice
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
y|Y)
|
y | Y)
|
||||||
GUI_SETUP=1
|
GUI_SETUP=1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
@ -70,8 +70,8 @@ fi
|
||||||
if [ "$WHEEL" -eq 0 ]; then
|
if [ "$WHEEL" -eq 0 ]; then
|
||||||
read -p "[ACTION] Do you want to install some AppImages (by AppMan)? (y/N) " choice
|
read -p "[ACTION] Do you want to install some AppImages (by AppMan)? (y/N) " choice
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
y|Y)
|
y | Y)
|
||||||
source "$DOTFILES/bootstrap/linux/appman.bash"
|
source "$DOTFILES/bootstrap/linux/appman.bash"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "[INFO] Skipping AppMan installation"
|
echo "[INFO] Skipping AppMan installation"
|
||||||
|
|
@ -96,7 +96,7 @@ if command -v zsh >/dev/null 2>&1; then
|
||||||
|
|
||||||
read -p "[ACTION] Do you want to setup zsh? (Y/n) " choice
|
read -p "[ACTION] Do you want to setup zsh? (Y/n) " choice
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
n|N)
|
n | N)
|
||||||
:
|
:
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
@ -105,7 +105,6 @@ if command -v zsh >/dev/null 2>&1; then
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$WHEEL" -eq 0 ]; then
|
if [ "$WHEEL" -eq 0 ]; then
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
@ -113,7 +112,7 @@ fi
|
||||||
|
|
||||||
read -p "[ACTION] Do you want to use other package managers? (y/N) " choice
|
read -p "[ACTION] Do you want to use other package managers? (y/N) " choice
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
y|Y)
|
y | Y)
|
||||||
:
|
:
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
@ -143,5 +142,4 @@ echo "[INFO] Installing Color Scheme (Catppuccin Mocha)"
|
||||||
|
|
||||||
fish $DOTFILES/bootstrap/temp/mocha_port.fish
|
fish $DOTFILES/bootstrap/temp/mocha_port.fish
|
||||||
|
|
||||||
|
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# vim:ft=bash
|
||||||
set -e # Exit immediately if a command exits with a non-zero status
|
set -e # Exit immediately if a command exits with a non-zero status
|
||||||
|
|
||||||
declare -A linkDots
|
declare -A linkDots
|
||||||
|
|
||||||
|
source "$DOTFILES/bootstrap/components/symlinks.bash"
|
||||||
source "$DOTFILES/bootstrap/components/symlinks.sh"
|
|
||||||
|
|
||||||
echo "[INFO] DOTFILES = $DOTFILES"
|
echo "[INFO] DOTFILES = $DOTFILES"
|
||||||
|
|
||||||
|
|
@ -13,16 +14,16 @@ read -n 1
|
||||||
echo "[INFO] Setting up symbolic links"
|
echo "[INFO] Setting up symbolic links"
|
||||||
|
|
||||||
for src in "${!linkDots[@]}"; do
|
for src in "${!linkDots[@]}"; do
|
||||||
dest="${linkDots[$src]}"
|
dest="${linkDots[$src]}"
|
||||||
echo "Linking $src to $dest"
|
echo "Linking $src to $dest"
|
||||||
if [ -d "$src" ]; then
|
if [ -d "$src" ]; then
|
||||||
test -d "$dest" && mv "$dest" "$dest.bak"
|
test -d "$dest" && mv "$dest" "$dest.bak"
|
||||||
ln -sf "$src" "$dest"
|
ln -sf "$src" "$dest"
|
||||||
elif [ -f "$src" ]; then
|
elif [ -f "$src" ]; then
|
||||||
dest_parent=$(dirname "$dest")
|
dest_parent=$(dirname "$dest")
|
||||||
test -d "$dest_parent" || mkdir -p "$dest_parent"
|
test -d "$dest_parent" || mkdir -p "$dest_parent"
|
||||||
ln -sf "$src" "$dest"
|
ln -sf "$src" "$dest"
|
||||||
else
|
else
|
||||||
echo "[ERROR] $src does not exist"
|
echo "[ERROR] $src does not exist"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
#! /bin/zsh
|
#! /bin/zsh
|
||||||
|
|
||||||
echo "Running the setup script"
|
echo "Running the setup script"
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
# VARIABLES
|
# VARIABLES
|
||||||
|
|
||||||
|
|
@ -10,7 +12,6 @@ export DOTFILES="${DOTFILES:-$HOME/.dotfiles}"
|
||||||
export WHEEL=1
|
export WHEEL=1
|
||||||
export GUI_SETUP=1
|
export GUI_SETUP=1
|
||||||
|
|
||||||
|
|
||||||
# Xcode Command Line Tools
|
# Xcode Command Line Tools
|
||||||
echo "[INFO] Installing Xcode Command Line Tools"
|
echo "[INFO] Installing Xcode Command Line Tools"
|
||||||
echo "[ACTION] Request Human Takeover"
|
echo "[ACTION] Request Human Takeover"
|
||||||
|
|
@ -34,7 +35,6 @@ echo "[INFO] Installing Homebrew"
|
||||||
echo "[ACTION] Request Human Input"
|
echo "[ACTION] Request Human Input"
|
||||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
|
|
||||||
|
|
||||||
echo "[ACTION] Press any key to continue when xcode CLI tools are installed"
|
echo "[ACTION] Press any key to continue when xcode CLI tools are installed"
|
||||||
read -n 1
|
read -n 1
|
||||||
|
|
||||||
|
|
@ -55,7 +55,6 @@ brew bundle --file=$DOTFILES/bootstrap/macOS/Brewfile
|
||||||
# Setting up emacs
|
# Setting up emacs
|
||||||
ln -s /usr/local/opt/emacs-mac/Emacs.app /Applications/Emacs.app
|
ln -s /usr/local/opt/emacs-mac/Emacs.app /Applications/Emacs.app
|
||||||
|
|
||||||
|
|
||||||
# Setting Default Apps
|
# Setting Default Apps
|
||||||
|
|
||||||
source $DOTFILES/bootstrap/macOS/duti.zsh
|
source $DOTFILES/bootstrap/macOS/duti.zsh
|
||||||
|
|
@ -77,14 +76,12 @@ echo "[INFO] Installing Doom Emacs"
|
||||||
|
|
||||||
source $DOTFILES/bootstrap/components/emacs.sh
|
source $DOTFILES/bootstrap/components/emacs.sh
|
||||||
|
|
||||||
|
|
||||||
echo "[INFO] Installing Color Scheme (Catppuccin Mocha)"
|
echo "[INFO] Installing Color Scheme (Catppuccin Mocha)"
|
||||||
|
|
||||||
fish $DOTFILES/bootstrap/temp/mocha_port.fish
|
fish $DOTFILES/bootstrap/temp/mocha_port.fish
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
|
|
||||||
|
|
||||||
dotnet tool install --global dotnet-repl
|
dotnet tool install --global dotnet-repl
|
||||||
|
|
||||||
pnpm install -g typescript
|
pnpm install -g typescript
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
## Finder
|
## Finder
|
||||||
echo "[INFO] Setting Finder Preferences"
|
echo "[INFO] Setting Finder Preferences"
|
||||||
defaults write com.apple.finder QuitMenuItem -bool true # Quit with CMD+Q
|
defaults write com.apple.finder QuitMenuItem -bool true # Quit with CMD+Q
|
||||||
defaults write com.apple.finder ShowPathbar -bool true # Show Path Bar
|
defaults write com.apple.finder ShowPathbar -bool true # Show Path Bar
|
||||||
defaults write com.apple.finder ShowStatusBar -bool true # Show Status Bar
|
defaults write com.apple.finder ShowStatusBar -bool true # Show Status Bar
|
||||||
defaults write NSGlobalDomain AppleShowAllExtensions -bool true # Show All File Extensions
|
defaults write NSGlobalDomain AppleShowAllExtensions -bool true # Show All File Extensions
|
||||||
defaults write com.apple.finder AppleShowAllFiles -bool true # Show Hidden Files
|
defaults write com.apple.finder AppleShowAllFiles -bool true # Show Hidden Files
|
||||||
defaults write com.apple.finder _FXSortFoldersFirst -bool true
|
defaults write com.apple.finder _FXSortFoldersFirst -bool true
|
||||||
defaults write com.apple.finder FinderSpawnTab -bool true
|
defaults write com.apple.finder FinderSpawnTab -bool true
|
||||||
# Don't show External Hard Drives on Desktop
|
# Don't show External Hard Drives on Desktop
|
||||||
|
|
@ -25,7 +25,7 @@ defaults write com.apple.dock persistent-apps -array
|
||||||
defaults write com.apple.dock persistent-others -array
|
defaults write com.apple.dock persistent-others -array
|
||||||
defaults write com.apple.dock autohide -bool true # Autohide Dock
|
defaults write com.apple.dock autohide -bool true # Autohide Dock
|
||||||
defaults write com.apple.dock autohide-time-modifier -float 0.5
|
defaults write com.apple.dock autohide-time-modifier -float 0.5
|
||||||
defaults write com.apple.dock autohide-delay -float 0 # Immediately Autohide Dock
|
defaults write com.apple.dock autohide-delay -float 0 # Immediately Autohide Dock
|
||||||
defaults write com.apple.dock show-recents -bool false # Hide Recent Applications
|
defaults write com.apple.dock show-recents -bool false # Hide Recent Applications
|
||||||
killall Dock
|
killall Dock
|
||||||
## Trackpad
|
## Trackpad
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ set -e # Exit immediately if a command exits with a non-zero status
|
||||||
typeset -A linkDots
|
typeset -A linkDots
|
||||||
|
|
||||||
# 从通用配置文件加载
|
# 从通用配置文件加载
|
||||||
source "$DOTFILES/bootstrap/components/symlinks.sh"
|
source "$DOTFILES/bootstrap/components/symlinks.bash"
|
||||||
|
|
||||||
echo "[INFO] DOTFILES = $DOTFILES"
|
echo "[INFO] DOTFILES = $DOTFILES"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
[System.Environment]::SetEnvironmentVariable("Path_EXT_0", "D:\bin", "User")
|
|
||||||
[System.Environment]::SetEnvironmentVariable("Path_EXT_0", "$Env:LocalAppData\Cargo\bin", "User")
|
|
||||||
[System.Environment]::SetEnvironmentVariable("Path_EXT_1", "$Env:LocalAppData\Go\bin", "User")
|
|
||||||
[System.Environment]::SetEnvironmentVariable("Path_EXT_2", "$Env:LocalAppData\Cargo\bin", "User")
|
|
||||||
[System.Environment]::SetEnvironmentVariable("Path_EXT_2", "", "User")
|
|
||||||
|
|
@ -1,142 +0,0 @@
|
||||||
#! /usr/bin/env bash
|
|
||||||
# $DOTFILES/bootstrap/set_symlink_unix.sh
|
|
||||||
# Date: 2025-01-28
|
|
||||||
# Author: js0ny
|
|
||||||
# Set symbolic links for Unix-like systems
|
|
||||||
# IMPORTANT: The default `bash` in macOS is outdated, run with zsh or install the latest `bash` via Homebrew
|
|
||||||
|
|
||||||
set -e # Exit immediately if a command exits with a non-zero status
|
|
||||||
|
|
||||||
DOTFILES="${DOTFILES:-$HOME/.dotfiles}"
|
|
||||||
ZDOTDIR="${ZDOTDIR:-$HOME/.config/zsh}"
|
|
||||||
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
|
||||||
NPM_CONFIG_USERCONFIG="${NPM_CONFIG_USERCONFIG:-$XDG_CONFIG_HOME/npm/npmrc}"
|
|
||||||
|
|
||||||
mkdir -p $ZDOTDIR/plugins
|
|
||||||
|
|
||||||
echo "[INFO] Setting up system-wide zsh configuration"
|
|
||||||
echo "[ACTION] Elevation required!"
|
|
||||||
test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zsh/zshenv"
|
|
||||||
test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zshenv"
|
|
||||||
|
|
||||||
declare -A linkDots
|
|
||||||
|
|
||||||
linkDots=(
|
|
||||||
["$DOTFILES/common/condarc.yaml"]="$XDG_CONFIG_HOME/conda/.condarc"
|
|
||||||
# ["$DOTFILES/common/gitconfig"]="$XDG_CONFIG_HOME/git/config"
|
|
||||||
["$DOTFILES/common/glow.yaml"]="$HOME/.config/glow/config.yml"
|
|
||||||
["$DOTFILES/common/haskeline"]="$HOME/.haskeline"
|
|
||||||
["$DOTFILES/common/ideavimrc"]="$XDG_CONFIG_HOME/ideavim/ideavimrc"
|
|
||||||
["$DOTFILES/common/lazygit.yaml"]="$XDG_CONFIG_HOME/lazygit/config.yml"
|
|
||||||
["$DOTFILES/common/lesskey"]="$XDG_CONFIG_HOME/lesskey"
|
|
||||||
["$DOTFILES/common/npmrc"]="$NPM_CONFIG_USERCONFIG"
|
|
||||||
["$DOTFILES/common/NuGet.Config"]="$XDG_CONFIG_HOME/NuGet/NuGet.Config"
|
|
||||||
["$DOTFILES/common/pip.conf"]="$XDG_CONFIG_HOME/pip/pip.conf"
|
|
||||||
["$DOTFILES/common/starship.toml"]="$HOME/.config/starship.toml"
|
|
||||||
["$DOTFILES/common/tmux.conf"]="$XDG_CONFIG_HOME/tmux/tmux.conf"
|
|
||||||
["$DOTFILES/common/vimrc"]="$XDG_CONFIG_HOME/vim/vimrc"
|
|
||||||
["$DOTFILES/common/zellij.config.kdl"]="$HOME/.config/zellij/config.kdl"
|
|
||||||
# ["$DOTFILES/tools/emacs.d"]="$HOME/.emacs.d"
|
|
||||||
["$DOTFILES/tools/doom"]="$HOME/.config/doom"
|
|
||||||
["$DOTFILES/tools/fish"]="$HOME/.config/fish"
|
|
||||||
["$DOTFILES/tools/ipython"]="$XDG_CONFIG_HOME/ipython"
|
|
||||||
["$DOTFILES/tools/nvim"]="$XDG_CONFIG_HOME/nvim"
|
|
||||||
["$DOTFILES/tools/yazi"]="$HOME/.config/yazi"
|
|
||||||
["$DOTFILES/tools/zsh/zshrc"]="$ZDOTDIR/.zshrc"
|
|
||||||
["$DOTFILES/tools/zsh/zshenv"]="$ZDOTDIR/.zshenv"
|
|
||||||
["$DOTFILES/platforms/mac/pwshProfile.ps1"]="$HOME/.config/powershell/Microsoft.PowerShell_profile.ps1"
|
|
||||||
)
|
|
||||||
|
|
||||||
if [ $(uname) = "Darwin" ]; then
|
|
||||||
echo "[INFO] Running on macOS"
|
|
||||||
linkDots+=(
|
|
||||||
["$DOTFILES/platforms/mac/karabiner"]="$HOME/.config/karabiner"
|
|
||||||
["$DOTFILES/platforms/mac/skhdrc"]="$XDG_CONFIG_HOME/skhd/skhdrc"
|
|
||||||
["$DOTFILES/platforms/mac/sketchybarrc"]="$XDG_CONFIG_HOME/sketchybar/sketchybarrc"
|
|
||||||
["$DOTFILES/platforms/mac/yabairc"]="$XDG_CONFIG_HOME/yabai/yabairc"
|
|
||||||
["$DOTFILES/tools/wezterm"]="$HOME/.config/wezterm"
|
|
||||||
["$DOTFILES/tools/zed"]="$HOME/.config/zed"
|
|
||||||
["$DOTFILES/tools/sioyek"]="$HOME/.config/sioyek"
|
|
||||||
)
|
|
||||||
else
|
|
||||||
echo "[INFO] Running on Linux"
|
|
||||||
linkDots+=(
|
|
||||||
["$DOTFILES/common/inputrc"]="$HOME/.inputrc"
|
|
||||||
)
|
|
||||||
if [ "$(uname -r)" = *Microsoft* ]; then
|
|
||||||
echo "[INFO] Running on WSL1"
|
|
||||||
: # NOP
|
|
||||||
else
|
|
||||||
echo "[INFO] Running on Native Linux"
|
|
||||||
linkDots+=(
|
|
||||||
["$DOTFILES/platforms/linux/awesome"]="$HOME/.config/awesome"
|
|
||||||
["$DOTFILES/platforms/linux/hypr"]="$HOME/.config/hypr"
|
|
||||||
["$DOTFILES/platforms/linux/waybar"]="$HOME/.config/waybar"
|
|
||||||
["$DOTFILES/platforms/linux/wlogout"]="$HOME/.config/wlogout"
|
|
||||||
["$DOTFILES/platforms/linux/mako-config"]="$HOME/.config/mako/config"
|
|
||||||
["$DOTFILES/tools/wezterm"]="$HOME/.config/wezterm"
|
|
||||||
["$DOTFILES/tools/zed"]="$HOME/.config/zed"
|
|
||||||
["$DOTFILES/tools/sioyek"]="$HOME/.config/sioyek"
|
|
||||||
)
|
|
||||||
for kde in "$DOTFILES/platforms/linux/kde/"*; do
|
|
||||||
linkDots+=["$kde"]="$HOME/.config/kde/$(basename $kde)"
|
|
||||||
# echo "Linking $kde to $HOME/.config/kde/$(basename $kde)"
|
|
||||||
done
|
|
||||||
echo "[INFO] Setting up system environment variables"
|
|
||||||
echo "[ACTION] Elevation required!"
|
|
||||||
sudo cp "$DOTFILES/platforms/linux/etc/environment" "/etc/environment"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "[INFO] Setting up symbolic links"
|
|
||||||
for src in "${!linkDots[@]}"; do
|
|
||||||
echo "Linking $src to ${linkDots[$src]}"
|
|
||||||
dest="${linkDots[$src]}"
|
|
||||||
if [ -d "$src" ]; then
|
|
||||||
test -d $dest && mv $dest $dest.bak
|
|
||||||
mkdir -p $dest
|
|
||||||
ln -sf $src $dest
|
|
||||||
elif [ -f "$src" ]; then
|
|
||||||
dest_parent=$(dirname $dest)
|
|
||||||
test -d $dest_parent || mkdir -p $dest_parent
|
|
||||||
ln -sf $src $dest
|
|
||||||
else
|
|
||||||
echo "[ERROR] $src does not exist"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "[INFO] Installing zsh plugins"
|
|
||||||
test -d $ZDOTDIR/plugins/zsh-autosuggestions || git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git $ZDOTDIR/plugins/zsh-autosuggestions
|
|
||||||
test -d $ZDOTDIR/plugins/zsh-syntax-highlighting || git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git $ZDOTDIR/plugins/zsh-syntax-highlighting
|
|
||||||
test -d $ZDOTDIR/plugins/zsh-history-substring-search || git clone --depth 1 https://github.com/zsh-users/zsh-history-substring-search.git $ZDOTDIR/plugins/zsh-history-substring-search
|
|
||||||
test -d $ZDOTDIR/plugins/zsh-completions || git clone --depth 1 https://github.com/zsh-users/zsh-completions.git $ZDOTDIR/plugins/zsh-completions
|
|
||||||
|
|
||||||
echo "[INFO] Setting up some local directories"
|
|
||||||
test -d $XDG_CACHE_HOME || mkdir -p $XDG_CACHE_HOME
|
|
||||||
test -d $XDG_DATA_HOME || mkdir -p $XDG_DATA_HOME
|
|
||||||
test -d $XDG_STATE_HOME || mkdir -p $XDG_STATE_HOME
|
|
||||||
test -d ~/.local/state/zsh || mkdir -p ~/.local/state/zsh
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "[INFO] Copying example files"
|
|
||||||
test -d $XDG_CONFIG_HOME/git || mkdir -p $XDG_CONFIG_HOME/git
|
|
||||||
cp $DOTFILES/common/gitconfig.example $XDG_CONFIG_HOME/git/config
|
|
||||||
echo "[INFO] Don't forget to update your gitconfig!"
|
|
||||||
|
|
||||||
echo "[INFO] Installing DOOM Emacs"
|
|
||||||
echo "[ACTION] Request Human Takeover"
|
|
||||||
test -d ~/.config/emacs && mv ~/.config/emacs ~/.config/emacs.bak
|
|
||||||
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
|
|
||||||
~/.config/emacs/bin/doom install
|
|
||||||
~/.config/emacs/bin/doom sync
|
|
||||||
|
|
||||||
echo "[INFO] Installing Emacs-Rime"
|
|
||||||
git clnh https://github.com/js0ny/Rime.git ~/.config/emacs/.local/cache/rime
|
|
||||||
|
|
||||||
|
|
||||||
echo "[INFO] Done!"
|
|
||||||
|
|
||||||
export ZDOTDIR
|
|
||||||
export DOTFILES
|
|
||||||
export NPM_CONFIG_USERCONFIG
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck disable=SC1090 shell=sh
|
||||||
# Date: 2025-02-11
|
# Date: 2025-02-11
|
||||||
# Author: js0ny
|
# Author: js0ny
|
||||||
# IMPORTANT: The default `bash` in macOS is outdated, run with zsh or install the latest `bash` via Homebrew
|
# IMPORTANT: The default `bash` in macOS is outdated, run with zsh or install the latest `bash` via Homebrew
|
||||||
# If you are macOS, run `xcode select --install` first
|
# If you are macOS, run `xcode select --install` first
|
||||||
|
|
||||||
set -e # Exit immediately if a command exits with a non-zero status
|
set -o errexit
|
||||||
|
set -o xtrace
|
||||||
|
|
||||||
DOTFILES="${DOTFILES:-$HOME/.dotfiles}"
|
DOTFILES="${DOTFILES:-$HOME/.dotfiles}"
|
||||||
|
|
||||||
|
|
@ -14,13 +16,13 @@ export DOTFILES
|
||||||
|
|
||||||
case "$(uname)" in
|
case "$(uname)" in
|
||||||
Linux)
|
Linux)
|
||||||
curl https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/bootstrap/linux/main.bash -o ~/.local/.tmp/main.bash
|
curl https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/bootstrap/linux/main.bash -o ~/.local/.tmp/main.bash
|
||||||
source ~/.local/.tmp/main.bash
|
source ~/.local/.tmp/main.bash
|
||||||
rm -rf ~/.local/.tmp/main.bash
|
rm -rf ~/.local/.tmp/main.bash
|
||||||
;;
|
;;
|
||||||
Darwin)
|
Darwin)
|
||||||
curl https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/bootstrap/macOS/main.zsh -o ~/.local/.tmp/main.zsh
|
curl https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/bootstrap/macOS/main.zsh -o ~/.local/.tmp/main.zsh
|
||||||
zsh ~/.local/.tmp/main.zsh
|
zsh ~/.local/.tmp/main.zsh
|
||||||
rm -rf ~/.local/.tmp/main.zsh
|
rm -rf ~/.local/.tmp/main.zsh
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
export DOTFILES=~/.dotfiles
|
|
||||||
export ZDOTDIR=~/.config/zsh
|
|
||||||
|
|
||||||
mkdir -p $ZDOTDIR
|
|
||||||
mkdir -p $DOTFILES
|
|
||||||
|
|
||||||
git clone https://github.com/js0ny/dotfiles $DOTFILES
|
|
||||||
|
|
||||||
sudo cp $DOTFILES/tools/zsh/global.zshenv /etc/zsh/zshenv
|
|
||||||
|
|
||||||
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
|
||||||
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
|
||||||
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
|
||||||
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
|
||||||
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
|
|
||||||
|
|
||||||
|
|
||||||
mkdir -p $XDG_CONFIG_HOME $XDG_DATA_HOME $XDG_STATE_HOME $XDG_CACHE_HOME
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue