-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalpine.sh
More file actions
47 lines (36 loc) · 1.35 KB
/
alpine.sh
File metadata and controls
47 lines (36 loc) · 1.35 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
#!/bin/sh
# 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
# Uncomment the community repository
echo "Uncommenting the community repository..."
sed -i '/^#.*http.*alpine\/v[0-9]\.[0-9]\/community/s/^#//' /etc/apk/repositories
# Update and upgrade the system
echo "Updating system packages..."
apk update && apk upgrade
# Install shell utilities
echo "Installing utilities..."
apk add curl wget git unzip zsh
# Install oh-my-zsh
echo "Installing oh-my-zsh..."
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Powerlevel10k
echo "Cloning Powerlevel10k theme..."
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
echo "Setting zsh as the default shell..."
chsh -s /bin/zsh
echo "Now, you need to restart the shell to apply the changes."