all repos

dotfiles @ 451e274635f297997a4f065eec91ed73f5ffe741

my dotfiles

bootstrap (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
set -e

# the path to dir where the script and dotfiles are located
# set to specific path so this script can be run from anywhere
dotfilesPath="$HOME/.dotfiles"

create_links_in_dir_recursively() {
    local base_dir="$dotfilesPath/$1"
    local target_dir="$2"

    for dir in $(find "$base_dir/" -type d); do
        mkdir -p "$HOME/$target_dir${dir#$base_dir}"
        for file in $(find "$dir" -maxdepth 1 -type f); do
            ln -sf "$file" "$HOME/$target_dir${file#$base_dir}"
        done
    done
}

ln -sf "$dotfilesPath/zshrc" "$HOME/.zshrc"
ln -sf "$dotfilesPath/gitconfig" "$HOME/.gitconfig"
ln -sf "$dotfilesPath/tmux.conf" "$HOME/.tmux.conf"

mkdir -p "$HOME/bin/"
for file in $(find "$dotfilesPath/bin" -type f); do
    ln -sf "$file" "$HOME/bin"
done

create_links_in_dir_recursively "config" ".config"
ln -sf "$dotfilesPath/config/alacritty.yml" "$HOME/.config/alacritty.yml"
ln -sf "$dotfilesPath/config/electron-flags.conf" "$HOME/.config/electron-flags.conf"
ln -sf "$dotfilesPath/config/starship.toml" "$HOME/.config/starship.toml"

create_links_in_dir_recursively "logseq" ".logseq"