-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli_toolkit_install.sh
45 lines (41 loc) · 1.75 KB
/
cli_toolkit_install.sh
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
if [ "$(id -u)" = "0" ]; then
Sudo=''
elif which sudo; then
Sudo='sudo'
else
echo "ERR: 'sudo' command not found."
echo " Install 'sudo' before calling this script"
exit 1
fi
# install zsh+oh my zsh+p10k theme
sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.0/zsh-in-docker.sh)" -- \
-t https://github.com/romkatv/powerlevel10k \
-a 'POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(user dir newline prompt_char)' \
-a 'POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status direnv virtualenv pyenv newline)' \
-a 'POWERLEVEL9K_MODE=ascii' \
-a 'POWERLEVEL9K_PROMPT_CHAR_BACKGROUND=' \
-a 'POWERLEVEL9K_PROMPT_CHAR_LEFT_LEFT_WHITESPACE=' \
-a 'POWERLEVEL9K_PROMPT_CHAR_LEFT_RIGHT_WHITESPACE=' \
-p https://github.com/zsh-users/zsh-autosuggestions \
-p z
echo "=======zsh installation susscessful======="
# download zellij binary from internet
wget -qO- https://github.com/zellij-org/zellij/releases/download/v0.40.1/zellij-x86_64-unknown-linux-musl.tar.gz \
| tar -xzv && $Sudo chmod +x zellij && $Sudo mv zellij /usr/bin/
echo "=======zellij installation susscessful======="
# download yazi binary and link them to /usr/bin
wget -qO yazi.zip https://github.com/sxyazi/yazi/releases/download/v0.3.3/yazi-x86_64-unknown-linux-musl.zip \
&& unzip yazi.zip -d ~/.yazi \
&& $Sudo ln -s ~/.yazi/yazi-x86_64-unknown-linux-musl/ya /usr/bin/ya \
&& $Sudo ln -s ~/.yazi/yazi-x86_64-unknown-linux-musl/yazi /usr/bin/yazi \
&& $Sudo rm yazi.zip
# add yy() to .zshrc
echo 'function yy() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
}' >> ~/.zshrc
echo "=======yazi installation susscessful======="