-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
46 lines (41 loc) · 1.9 KB
/
install
File metadata and controls
46 lines (41 loc) · 1.9 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
#!/bin/bash
# Install zsh using the appropriate package manager
if command -v dnf >/dev/null 2>&1; then
sudo dnf install -y zsh
elif command -v yum >/dev/null 2>&1; then
sudo yum install -y zsh
elif command -v apt >/dev/null 2>&1; then
sudo apt update && sudo apt install -y zsh
else
echo "No supported package manager found (dnf, yum, apt)." >&2
exit 1
fi
chsh -s $(which zsh)
# Install p10k
() {
emulate -L zsh -o xtrace -o err_return
ZDOTDIR=/no/such/dir command zsh -ic '[[ $ZDOTDIR == /no/such/dir ]]'
command mkdir -p -- ~/zsh-backup
local rc
for rc in ~/.zshenv ~/.zprofile ~/.zshrc ~/.zlogin ~/.zlogout ~/.oh-my-zsh; do
[[ -e $rc ]] || continue
[[ ! -e ~/zsh-backup/${rc:t} ]] || {
command rm -rf -- $rc
continue
}
command rm -rf -- ~/zsh-backup/${rc:t}.tmp.$$
command cp -r -- $rc ~/zsh-backup/${rc:t}.tmp.$$
command mv -- ~/zsh-backup/${rc:t}.tmp.$$ ~/zsh-backup/${rc:t}
command rm -rf -- $rc
done
command git clone -- https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
command git clone --depth=1 -- https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k
command sed -- 's|robbyrussell|powerlevel10k/powerlevel10k|' ~/.oh-my-zsh/templates/zshrc.zsh-template >~/.zshrc
ZDOTDIR=~ exec zsh -i
}
# zsh plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone --depth 1 https://github.com/unixorn/fzf-zsh-plugin.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-zsh-plugin
echo "Make sure you install the proper fonts on displaying host: https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/FiraCode/Medium/FiraCodeNerdFont-Medium.ttf"
echo "Make sure you set your terminal to use the font"