forked from hashirsajid58200p/earth-and-moon-grub-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
45 lines (36 loc) · 1.04 KB
/
install.sh
File metadata and controls
45 lines (36 loc) · 1.04 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
#!/bin/bash
THEME_NAME="EarthandMoon"
THEME_DIR="/boot/grub/themes/$THEME_NAME"
CURRENT_DIR=$(pwd)
# Check root
if [ "$(id -u)" -ne 0 ]; then
echo "Error: Run as root" >&2
exit 1
fi
# Resolution selection
echo "Select display resolution:"
echo "1) Full HD (1920x1080)"
echo "2) 2K (2560x1440)"
echo "3) 4K (3840x2160)"
read -p "Enter choice [1-3]: " res_choice
case $res_choice in
1) GFXMODE="1920x1080x32" ;;
2) GFXMODE="2560x1440x32" ;;
3) GFXMODE="3840x2160x32" ;;
esac
# Install theme
echo "Installing GRUB theme with $GFXMODE resolution..."
mkdir -p "$THEME_DIR"
cp -r "$CURRENT_DIR"/* "$THEME_DIR/"
# Update GRUB config
sed -i '/GRUB_THEME=/d' /etc/default/grub
sed -i '/GRUB_GFXMODE=/d' /etc/default/grub
echo 'GRUB_THEME="/boot/grub/themes/EarthandMoon/theme.txt"' >> /etc/default/grub
echo "GRUB_GFXMODE=\"$GFXMODE\"" >> /etc/default/grub
# Update GRUB
if command -v update-grub &> /dev/null; then
update-grub
else
grub-mkconfig -o /boot/grub/grub.cfg
fi
echo "Theme installed successfully with $GFXMODE resolution!"