-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebian_based.sh
More file actions
37 lines (27 loc) · 1009 Bytes
/
debian_based.sh
File metadata and controls
37 lines (27 loc) · 1009 Bytes
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
#!/bin/bash
# Check if the script is being run as root, if not, exit
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
# Install shell utils
apt update && apt upgrade -y
apt install -y curl wget git unzip zsh
# Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Powerlevel 10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# Update ~/.zshrc to use Powerlevel10k theme
ZSHRC_FILE="$HOME/.zshrc"
THEME_CONFIG='ZSH_THEME="powerlevel10k/powerlevel10k"'
echo "Updating $ZSHRC_FILE..."
if grep -q '^ZSH_THEME=' "$ZSHRC_FILE"; then
# Change the existing ZSH_THEME line
sed -i "s/^ZSH_THEME=.*/$THEME_CONFIG/" "$ZSHRC_FILE"
else
# Add the ZSH_THEME line if it doesn't exist
echo "$THEME_CONFIG" >> "$ZSHRC_FILE"
fi
# Set default shell as zsh
chsh -s /bin/zsh
echo "Now, you need to restart the shell to apply the changes."