-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path07-install-plymouth-theme.sh
More file actions
executable file
·58 lines (48 loc) · 1.9 KB
/
07-install-plymouth-theme.sh
File metadata and controls
executable file
·58 lines (48 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
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
set -e
echo "--> Installing Plymouth..."
apt-get install -y plymouth
echo "--> Setting up LuminOS theme directory..."
THEME_DIR="/usr/share/plymouth/themes/luminos"
# CRITICAL FIX: Create the directory first
mkdir -p "$THEME_DIR"
# Retrieve the logo (build.sh put assets in /usr/share/wallpapers/luminos)
if [ -f "/usr/share/wallpapers/luminos/logo-plymouth.png" ]; then
echo "--> Copying logo to theme folder..."
cp "/usr/share/wallpapers/luminos/logo-plymouth.png" "$THEME_DIR/logo.png"
else
echo "ERROR: Logo not found at /usr/share/wallpapers/luminos/logo-plymouth.png"
exit 1
fi
echo "--> Creating theme configuration files..."
cat > "${THEME_DIR}/luminos.plymouth" << EOF
[Plymouth Theme]
Name=LuminOS
Description=A clean and simple boot splash for LuminOS
ModuleName=script
[script]
ImageDir=${THEME_DIR}
ScriptFile=${THEME_DIR}/luminos.script
EOF
cat > "${THEME_DIR}/luminos.script" << EOF
logo_image = Image("logo.png");
logo_sprite = Sprite(logo_image);
logo_sprite.SetX(Window.GetWidth() / 2 - logo_image.GetWidth() / 2);
logo_sprite.SetY(Window.GetHeight() / 2 - logo_image.GetHeight() / 2 - 100);
progress_box_image = Image.Box(Window.GetWidth() / 4, 8, 0, 0, 0);
progress_box_sprite = Sprite(progress_box_image);
progress_box_sprite.SetX(Window.GetWidth() / 2 - progress_box_image.GetWidth() / 2);
progress_box_sprite.SetY(logo_sprite.GetY() + logo_image.GetHeight() + 50);
fun refresh_callback () {
progress = Plymouth.GetProgress();
progress_image = Image.Box(Window.GetWidth() / 4 * progress, 8, 1, 1, 1);
progress_sprite = Sprite(progress_image);
progress_sprite.SetX(Window.GetWidth() / 2 - progress_box_image.GetWidth() / 2);
progress_sprite.SetY(logo_sprite.GetY() + logo_image.GetHeight() + 50);
}
Plymouth.SetRefreshFunction(refresh_callback);
EOF
echo "--> Applying theme..."
plymouth-set-default-theme -R luminos
update-initramfs -u
echo "SUCCESS: Plymouth theme installed."