-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·118 lines (96 loc) · 3.44 KB
/
Copy pathbootstrap.sh
File metadata and controls
executable file
·118 lines (96 loc) · 3.44 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/sh
if [ 'Darwin' = "$(uname -s)" ]; then
alias readlink=greadlink
alias ln=gln
fi
DOTFILES=$(dirname $(readlink -f -n $0))
if type apt >/dev/null 2>&1 ; then
packages=""
if ! type zsh >/dev/null 2>&1 ; then
packages+=" zsh"
fi
if ! type python3 >/dev/null 2>&1 ; then
packages+=" python3 python3-venv"
fi
if ! type emacs >/dev/null 2>&1 ; then
packages+=" emacs"
fi
if [ ! -z "$packages" ]; then
sudo apt install -y ${packages}
fi
fi
# Link dot files
ln -s -t ~ \
$DOTFILES/.zshrc \
$DOTFILES/.zshkeys \
$DOTFILES/.zprofile \
$DOTFILES/.gnomerc \
$DOTFILES/.aliases \
$DOTFILES/.tmux.conf \
$DOTFILES/.tomorrow-night.tmux \
$DOTFILES/.pylintrc \
$DOTFILES/.ackrc \
$DOTFILES/.gitconfig \
$DOTFILES/.gitattributes \
$DOTFILES/.git-templates \
$DOTFILES/.gitignore_global
mkdir -p ~/.config/zellij
ln -s $DOTFILES/zellij.kdl ~/.config/zellij/config.kdl
mkdir -p ~/.config/atuin
ln -s $DOTFILES/atuin.toml ~/.config/atuin/config.toml
# this is deliberately the opposite direction
# since zshsys is machine-specific, but it's convenient to have
# a symlink to it here (which is gitignored) for editing.
ln -s $HOME/.zshsys $DOTFILES/.zshsys
ln -s -t ~/.config $DOTFILES/starship.toml
# Link all scripts to bin
[ ! -d ~/bin ] && mkdir ~/bin
ln -s -t ~/bin $DOTFILES/bin/*
# Cover our X defaults/resources bases
ln -s .Xresources ~/.Xdefaults
# Emacs init.el
[ ! -d ~/.emacs.d ] && mkdir ~/.emacs.d
ln -s -t ~/.emacs.d $DOTFILES/.emacs.d/*
# Base16
[ ! -d ~/.base16 ] && mkdir ~/.base16
[ -e ~/.base16/xresources/.git ] && git -C ~/.base16/xresources pull
[ ! -d ~/.base16/xresources ] && git clone --depth 1 --single-branch https://github.com/base16-project/base16-xresources.git ~/.base16/xresources
[ -e ~/.base16/tomorrow/.git ] && git -C ~/.base16/tomorrow pull
[ ! -d ~/.base16/tomorrow ] && git clone --depth 1 --single-branch https://github.com/chriskempson/tomorrow-theme ~/.base16/tomorrow
[ ! -d ~/.zgenom ] && git clone --depth 1 --single-branch https://github.com/jandamm/zgenom.git ~/.zgenom
# Add update to crontab
if [ $(crontab -l | grep -c "update-dotfiles.sh") -eq 0 ]; then
command="$DOTFILES/bin/update-dotfiles.sh"
job="0 0 * * * $command > $DOTFILES/autoupdate.log 2>&1"
echo "$(crontab -l | fgrep -v update-dotfiles)
$job" | crontab -
fi
# Xresources
(
cat ~/.base16/xresources/xresources/base16-tomorrow-night-256.Xresources
cat ~/dotfiles/utils.Xresources
) > ~/.Xresources
mkdir -p ~/.config/vivid/themes
[ ! -e ~/.config/vivid/themes/tomorrownight.yml ] && ln -s $DOTFILES/vivid_tomorrownight.yml ~/.config/vivid/themes/tomorrownight.yml
if ! type cargo >/dev/null 2>&1 ; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y
source ~/.cargo/env
fi
mkdir -p ~/.config/bat
ln -s $DOTFILES/bat.conf ~/.config/bat/config
# Utils
rustup update
# https://github.com/ajeetdsouza/zoxide
# https://github.com/eza-community/eza
# https://github.com/sharkdp/bat
# https://github.com/BurntSushi/ripgrep
# https://crates.io/crates/fd-find
# https://github.com/chmln/sd
# https://github.com/ClementTsang/bottom
# https://github.com/zellij-org/zellij
# https://github.com/dandavison/delta
# https://starship.rs/
# https://github.com/sharkdp/vivid
# https://github.com/atuinsh/atuin
# https://github.com/jdx/mise
cargo install zoxide eza bat ripgrep fd-find sd bottom zellij git-delta starship vivid atuin mise