Skip to content

Commit

Permalink
Setup: customization with config.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui committed Dec 20, 2024
1 parent 99a58d6 commit 4532c29
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
```sh
cd ~
git clone https://github.com/ken-matsui/dotfiles.git
./dotfiles/setup/common/config.sh
./dotfiles/setup/common/config.sh minimal
```

### Full Installation (only on macOS or Manjaro Sway)
Expand Down
75 changes: 51 additions & 24 deletions setup/common/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,58 @@ backup_and_link() {
ln -s "$DOTSPATH/$1" "$TARGET"
}

ALL='
.config/alacritty
.config/atuin
.config/git
.config/neomutt
.config/nvim
.config/shell
.config/sway
.config/tmux
.config/topgrade
.config/vim
.config/w3m
.config/waybar
.config/starship.toml
.ssh
.Brewfile
.zshenv
.zshrc
'

MINIMAL='
.config/git
.config/nvim
.config/shell
.config/tmux
.config/vim
.config/starship.toml
.zshenv
.zshrc
'

if [ "$#" -eq 0 ]; then
ITEMS="$ALL"
elif [ "$1" = 'minimal' ]; then
ITEMS="$MINIMAL"
else
ITEMS="$1"
fi

mkdir -p "$HOME/.config"

OS_NAME="$(uname -s)"
if [ "$OS_NAME" = Darwin ]; then
# TARGET=$HOME/Library/Application Support/Code
backup_and_link .config/Code "$HOME/Library/Application Support"
elif [ "$OS_NAME" = Linux ]; then
# TARGET=$HOME/.config/Code
backup_and_link .config/Code
if [ "$1" = 'all' ] || [ "$1" = '.config/Code' ]; then
OS_NAME="$(uname -s)"
if [ "$OS_NAME" = Darwin ]; then
# TARGET=$HOME/Library/Application Support/Code
backup_and_link .config/Code "$HOME/Library/Application Support"
elif [ "$OS_NAME" = Linux ]; then
# TARGET=$HOME/.config/Code
backup_and_link .config/Code
fi
fi

backup_and_link .config/alacritty
backup_and_link .config/atuin
backup_and_link .config/git
backup_and_link .config/neomutt
backup_and_link .config/nvim
backup_and_link .config/shell
backup_and_link .config/sway
backup_and_link .config/tmux
backup_and_link .config/topgrade
backup_and_link .config/vim
backup_and_link .config/w3m
backup_and_link .config/waybar
backup_and_link .config/starship.toml
backup_and_link .ssh
backup_and_link .Brewfile
backup_and_link .zshenv
backup_and_link .zshrc
for item in $ITEMS; do
backup_and_link "$item"
done

0 comments on commit 4532c29

Please sign in to comment.