Add fancy plymouth theme
|
@ -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;
|
||||
|
|
31
modules/base/plymouth-nixos-blur/default.nix
Normal 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";
|
||||
}];
|
||||
};
|
||||
}
|
9
modules/base/plymouth-nixos-blur/nixos-blur.plymouth
Normal 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
|
103
modules/base/plymouth-nixos-blur/nixos-blur.script
Normal 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);
|
||||
|
BIN
modules/base/plymouth-nixos-blur/progress-0.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-1.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-10.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-100.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-101.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-102.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-103.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-104.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-105.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-106.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-107.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-108.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-109.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-11.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-110.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-111.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-112.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-113.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-114.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-115.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-116.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-117.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-118.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-119.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-12.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-120.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-121.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-122.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-123.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-124.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-125.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-13.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-14.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-15.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-16.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-17.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-18.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-19.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-2.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-20.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-21.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-22.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-23.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-24.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-25.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-26.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-27.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-28.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-29.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-3.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-30.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-31.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-32.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-33.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-34.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-35.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-36.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-37.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-38.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-39.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-4.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-40.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-41.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-42.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-43.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-44.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-45.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-46.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-47.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-48.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-49.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-5.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-50.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-51.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-52.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-53.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-54.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-55.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-56.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-57.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-58.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-59.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-6.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-60.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-61.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-62.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-63.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-64.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-65.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-66.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-67.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-68.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-69.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-7.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-70.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
modules/base/plymouth-nixos-blur/progress-71.png
Normal file
After Width: | Height: | Size: 22 KiB |