mirror of
https://github.com/dschmenk/apple2pi.git
synced 2025-01-04 21:29:19 +00:00
Add plymouth splash screen theme
This commit is contained in:
parent
07a5bd8c62
commit
5622726290
6
debian/postinst
vendored
6
debian/postinst
vendored
@ -27,6 +27,12 @@ case "$1" in
|
||||
cp /boot/cmdline.txt /boot/cmdline.bak
|
||||
sed -i 's/console=ttyAMA0,[0-9]* kgdboc=ttyAMA0,[0-9]* //g' /boot/cmdline.txt
|
||||
fi
|
||||
#
|
||||
# Make sure UART is enabled
|
||||
#
|
||||
if [ "$(grep enable_uart /boot/config.txt)" = "" ] ; then
|
||||
echo "enable_uart=1" >> /etc/apt/sources.list
|
||||
fi
|
||||
#
|
||||
# Disable getty on built-in serial port.
|
||||
#
|
||||
|
8
share/plymouth/themes/a2pi/a2pi.plymouth
Normal file
8
share/plymouth/themes/a2pi/a2pi.plymouth
Normal file
@ -0,0 +1,8 @@
|
||||
[Plymouth Theme]
|
||||
Name=a2pi
|
||||
Description=Apple II Pi Splash
|
||||
ModuleName=script
|
||||
|
||||
[script]
|
||||
ImageDir=/usr/share/plymouth/themes/a2pi
|
||||
ScriptFile=/usr/share/plymouth/themes/a2pi/a2pi.script
|
50
share/plymouth/themes/a2pi/a2pi.script
Normal file
50
share/plymouth/themes/a2pi/a2pi.script
Normal file
@ -0,0 +1,50 @@
|
||||
screen_width = Window.GetWidth();
|
||||
screen_height = Window.GetHeight();
|
||||
|
||||
theme_image = Image("splash.png");
|
||||
image_width = theme_image.GetWidth();
|
||||
image_height = theme_image.GetHeight();
|
||||
|
||||
scale_x = image_width / screen_width;
|
||||
scale_y = image_height / screen_height;
|
||||
|
||||
flag = 1;
|
||||
|
||||
if (scale_x > 1 || scale_y > 1)
|
||||
{
|
||||
if (scale_x > scale_y)
|
||||
{
|
||||
resized_image = theme_image.Scale (screen_width, image_height / scale_x);
|
||||
image_x = 0;
|
||||
image_y = (screen_height - ((image_height * screen_width) / image_width)) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
resized_image = theme_image.Scale (image_width / scale_y, screen_height);
|
||||
image_x = (screen_width - ((image_width * screen_height) / image_height)) / 2;
|
||||
image_y = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
resized_image = theme_image.Scale (image_width, image_height);
|
||||
image_x = (screen_width - image_width) / 2;
|
||||
image_y = (screen_height - image_height) / 2;
|
||||
}
|
||||
|
||||
if (Plymouth.GetMode() != "shutdown")
|
||||
{
|
||||
sprite = Sprite (resized_image);
|
||||
sprite.SetPosition (image_x, image_y, -100);
|
||||
}
|
||||
|
||||
message_sprite = Sprite();
|
||||
message_sprite.SetPosition(screen_width * 0.1, screen_height * 0.9, 10000);
|
||||
|
||||
fun message_callback (text) {
|
||||
my_image = Image.Text(text, 1, 1, 1);
|
||||
message_sprite.SetImage(my_image);
|
||||
sprite.SetImage (resized_image);
|
||||
}
|
||||
|
||||
Plymouth.SetUpdateStatusFunction(message_callback);
|
BIN
share/plymouth/themes/a2pi/splash.png
Normal file
BIN
share/plymouth/themes/a2pi/splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
Loading…
Reference in New Issue
Block a user