PaganOS Luna 0.6.0
PL EN DE
🔒 Repository is read-only – file editing is disabled.

recipes/gui/pagan-plymouth-theme/pagan.script main

36 lines Raw ← Back
123456789101112131415161718192021222324252627282930313233343536
# Pagan Linux – skrypt motywu Plymouth (plugin "script").
# Logo LOKI na środku + delikatne „oddychanie" i pasek postępu pod spodem.

logo.image = Image("logo.png");
logo.sprite = Sprite(logo.image);
logo.sprite.SetX((Window.GetWidth() - logo.image.GetWidth()) / 2);
logo.sprite.SetY((Window.GetHeight() - logo.image.GetHeight()) / 2 - 40);

# Pasek postępu (cienki, w kolorze akcentu Pagan #7bd88f).
bar_bg.image = Image.Threshold(Window.GetWidth() / 3, 6, 0.9, 0.9, 0.9, 0.25);
bar_bg.sprite = Sprite(bar_bg.image);
bar_bg.sprite.SetX((Window.GetWidth() - bar_bg.image.GetWidth()) / 2);
bar_bg.sprite.SetY(Window.GetHeight() * 3 / 4);

bar.image = Image.Threshold(Window.GetWidth() / 3, 6, 0.48, 0.85, 0.56, 1.0);
bar.sprite = Sprite(bar.image);
bar.sprite.SetX((Window.GetWidth() - bar.image.GetWidth()) / 2);
bar.sprite.SetY(Window.GetHeight() * 3 / 4);

fun refresh_callback () {
    progress = Plymouth.GetBootProgress();
    width = bar.image.GetWidth();
    bar.sprite.SetImage(bar.image.Scale(width * progress, bar.image.GetHeight()));
    bar.sprite.SetX((Window.GetWidth() - width * progress) / 2);
}
Plymouth.SetBootProgressFunction(refresh_callback);

fun display_message_callback (text, boot) {
    # Miejsce na komunikaty (np. „Sprawdzanie systemu plików…").
    message.image = Image.Text(text, 0.9, 0.9, 0.9, 1.0);
    message.sprite = Sprite(message.image);
    message.sprite.SetX((Window.GetWidth() - message.image.GetWidth()) / 2);
    message.sprite.SetY(Window.GetHeight() * 3 / 4 + 24);
    message.sprite.SetOpacity(1);
}
Plymouth.SetDisplayMessageFunction(display_message_callback);