Add fancy plymouth theme

This commit is contained in:
Erwin Boskma 2023-01-13 21:20:11 +01:00
parent 8cd50b7232
commit b89bc56846
Signed by: erwin
SSH key fingerprint: SHA256:CyeNoWXd3kjX2Nwu6pDxxdS7OqmPVOy0NavA/KU/ntU
130 changed files with 150 additions and 1 deletions

View file

@ -25,6 +25,11 @@ with lib; let
inherit (pkgs.stdenv) mkDerivation;
inherit lib;
};
plymouth-nixos-blur = pkgs.callPackage ./plymouth-nixos-blur {
inherit (pkgs.stdenv) mkDerivation;
inherit lib;
};
in
{
options.eboskma.base = {
@ -58,7 +63,8 @@ in
boot.plymouth = mkIf cfg.plymouth.enable {
enable = true;
theme = "breeze";
themePackages = [ plymouth-nixos-blur ];
theme = "nixos-blur";
};
hardware.opengl.enable = true;

View file

@ -0,0 +1,31 @@
{ lib, stdenv, ... }:
let
pname = "plymouth-nixos-blur";
version = "0.1.0";
in
stdenv.mkDerivation {
inherit pname version;
src = ./.;
phases = [ "installPhase" ];
installPhase = ''
install -Dm 0644 *.png $out/share/plymouth/themes/nixos-blur/images/
install -Dm 0644 nixos-blur.script $out/share/plymouth/themes/nixos-blur/
install -Dm 0644 nixos-blur.plymouth $out/share/plymouth/themes/nixos-blur/
sed -i 's/@OUT@/${placeholder "out"}/' $out/share/plymouth/themes/nixos-blur/nixos-blur.plymouth
'';
meta = with lib; {
description = "Plymouth theme nixos-blur";
homepage = "https://git.gurkan.in/gurkan/nixos-blur-plymouth";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = [{
email = "erwin@datarift.nl";
github = "eboskma";
name = "Erwin Boskma";
}];
};
}

View file

@ -0,0 +1,9 @@
[Plymouth Theme]
Name=nixos-blur
Description=nixos logo blurring
Comment=created By Gurkan (gurkan.in)
ModuleName=script
[script]
ImageDir=@OUT@/plymouth/themes/nixos-blur/images
ScriptFile=@OUT@/plymouth/themes/nixos-blur/nixos-blur.script

View file

@ -0,0 +1,103 @@
// Screen size
screen.w = Window.GetWidth();
screen.h = Window.GetHeight();
screen.half.w = Window.GetWidth() / 2;
screen.half.h = Window.GetHeight() / 2;
// Question prompt
question = null;
answer = null;
// Message
message = null;
// Password prompt
bullets = null;
prompt = null;
bullet.image = Image.Text("*", 1, 1, 1);
// Flow
state.status = "play";
state.time = 0.0;
//--------------------------------- Refresh (Logo animation) --------------------------
# cycle through all images
for (i = 0; i < 151; i++)
flyingman_image[i] = Image("progress-" + i + ".png");
flyingman_sprite = Sprite();
# set image position
flyingman_sprite.SetX(Window.GetX() + (Window.GetWidth() / 2 - flyingman_image[0].GetWidth() / 2)); # Place images in the center
flyingman_sprite.SetY(Window.GetY() + (Window.GetHeight() / 2 - flyingman_image[0].GetHeight() / 2));
progress = 0;
fun refresh_callback ()
{
flyingman_sprite.SetImage(flyingman_image[Math.Int(progress / 2) % 151]);
progress++;
}
Plymouth.SetRefreshFunction (refresh_callback);
//------------------------------------- Password prompt -------------------------------
fun DisplayQuestionCallback(prompt, entry) {
question = null;
answer = null;
if (entry == "")
entry = "<answer>";
question.image = Image.Text(prompt, 1, 1, 1);
question.sprite = Sprite(question.image);
question.sprite.SetX(screen.half.w - question.image.GetWidth() / 2);
question.sprite.SetY(screen.h - 4 * question.image.GetHeight());
answer.image = Image.Text(entry, 1, 1, 1);
answer.sprite = Sprite(answer.image);
answer.sprite.SetX(screen.half.w - answer.image.GetWidth() / 2);
answer.sprite.SetY(screen.h - 2 * answer.image.GetHeight());
}
Plymouth.SetDisplayQuestionFunction(DisplayQuestionCallback);
//------------------------------------- Password prompt -------------------------------
fun DisplayPasswordCallback(nil, bulletCount) {
state.status = "pause";
totalWidth = bulletCount * bullet.image.GetWidth();
startPos = screen.half.w - totalWidth / 2;
prompt.image = Image.Text("Enter Password", 1, 1, 1);
prompt.sprite = Sprite(prompt.image);
prompt.sprite.SetX(screen.half.w - prompt.image.GetWidth() / 2);
prompt.sprite.SetY(screen.h - 4 * prompt.image.GetHeight());
// Clear all bullets (user might hit backspace)
bullets = null;
for (i = 0; i < bulletCount; i++) {
bullets[i].sprite = Sprite(bullet.image);
bullets[i].sprite.SetX(startPos + i * bullet.image.GetWidth());
bullets[i].sprite.SetY(screen.h - 2 * bullet.image.GetHeight());
}
}
Plymouth.SetDisplayPasswordFunction(DisplayPasswordCallback);
//--------------------------- Normal display (unset all text) ----------------------
fun DisplayNormalCallback() {
state.status = "play";
bullets = null;
prompt = null;
message = null;
question = null;
answer = null;
}
Plymouth.SetDisplayNormalFunction(DisplayNormalCallback);
//----------------------------------------- Message --------------------------------
fun MessageCallback(text) {
message.image = Image.Text(text, 1, 1, 1);
message.sprite = Sprite(message.image);
message.sprite.SetPosition(screen.half.w - message.image.GetWidth() / 2, message.image.GetHeight());
}
Plymouth.SetMessageFunction(MessageCallback);

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Some files were not shown because too many files have changed in this diff Show more