-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
127 lines (104 loc) · 3.7 KB
/
Copy pathinit.sh
File metadata and controls
127 lines (104 loc) · 3.7 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
119
120
121
122
123
124
125
126
127
#!/bin/bash
POSITIONAL_ARGS=()
install=false
symlinks=false
POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do
case $1 in
-i | --install)
#echo "Install"
install=true
shift # past argument
# shift # past value if you want to
;;
-s | --symlink)
#echo "Symlinks only"
symlinks=true
shift # past argument
# shift # past value if you want to
;;
-*)
echo "Unknown option $1"
exit 1
;;
# *)
# POSITIONAL_ARGS+=("$1") # save positional arg
# shift # past argument
# ;;
esac
done
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
if [ $install = false ]; then
echo "Not installing..."
fi
if [ $symlinks = false ]; then
echo "Not setting up symlinks/config..."
fi
# Install the things if needed
if [ $install = true ]; then
cd ~ || exit
# Install Zsh for all (not local user)
echo "Installing Zsh..."
sudo apt install zsh
# Set Zsh as default shell.
echo "Setting zsh as default shell..."
chsh -s /usr/bin/zsh
# Install ZIM https://zimfw.sh/docs/
echo "Installing ZIM..."
curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
# use my own zimrc
rm "$HOME/.zimrv"
ln -s "$HOME/dotfiles/bash/zimrc" "$HOME/.zimrc"
echo "Installing Starship..."
curl -sS https://starship.rs/install.sh | sh
# Install some standard bits
echo "Intalling tools..."
sudo apt install bat
sudo apt install btop
sudo apt install fd-find
sudo apt install ripgrep
echo "Installing Lazygit..."
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | \grep -Po '"tag_name": *"v\K[^"]*')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit -D -t /usr/local/bin/
rm lazygit*
# Install zoxide https://github.com/ajeetdsouza/zoxide
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
# install eza
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y eza
# Git will need to have been installed already
sudo apt install git-delta
git config --global core.pager delta
git config --global interactive.diffFilter 'delta --color-only'
git config --global delta.navigate true
git config --global delta.side-by-side true
git config --global merge.conflictStyle zdiff3
# install Dust
curl -sSfL https://raw.githubusercontent.com/bootandy/dust/refs/heads/master/install.sh | sh
fi
# Setup the symlinks things if needed
if [ $symlinks = true ]; then
# Starship config
echo "Setting up Starship config..."
rm "$HOME/.config/starship.toml"
ln -s "$HOME/dotfiles/starship/starship.toml" "$HOME/.config/starship.toml"
# Set up my bash things and use zsh as my bash shell (backup/work shell)
# clear out any symlinks/files to be replaced by my own
rm "$HOME/.bashrc"
rm "$HOME/.profile"
rm "$HOME/.work-profile"
# Create symlinks
ln -s "$HOME/dotfiles/bash/bashrc" "$HOME/.bashrc"
ln -s "$HOME/dotfiles/bash/profile" "$HOME/.profile"
ln -s "$HOME/dotfiles/work/work-profile" "$HOME/.work-profile"
rm "$HOME/.zshrc"
ln -s "$HOME/dotfiles/bash/zshrc" "$HOME/.zshrc"
rm "$HOME/.zshenv"
ln -s "$HOME/dotfiles/bash/zshenv" "$HOME/.zshenv"
fi