Skip to content

Commit

Permalink
remove throbber and fix font
Browse files Browse the repository at this point in the history
  • Loading branch information
13r0ck authored and jackpot51 committed Feb 28, 2022
1 parent fa22dfd commit a2ac127
Show file tree
Hide file tree
Showing 15 changed files with 256 additions and 4 deletions.
3 changes: 2 additions & 1 deletion debian/install
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pop-basic/ usr/share/plymouth/themes/
pop-basic/ usr/share/plymouth/themes/
usr/share/initramfs-tools/hooks/plymouth-pop
6 changes: 3 additions & 3 deletions pop-basic/pop-basic.plymouth
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Description=Re-Write of Pop!_OS decryption screen using two-step rather than ply
ModuleName=two-step

[two-step]
Font=FiraSans-Regular 12
TitleFont=Cantarell Light 30
Font=Fira Sans Regular 11
TitleFont=Fira Sans Regular 11
ImageDir=/usr/share/plymouth/themes/pop-basic
DialogHorizontalAlignment=.5
DialogVerticalAlignment=.5
Expand All @@ -23,7 +23,7 @@ ProgressBarBackgroundColor=0x606060
ProgressBarForegroundColor=0xffffff
DialogClearsFirmwareBackground=true
MessageBelowAnimation=true
MessageBelowAnimationDistance=80
MessageBelowAnimationDistance=10
CursorAnimation=breath
CursorAnimationSpeed=7

Expand Down
Binary file removed pop-basic/throbber-0001.png
Binary file not shown.
9 changes: 9 additions & 0 deletions usr/share/initramfs-tools/hooks/plymouth-pop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# Based on part of the behavior from Ubuntu's /usr/share/initramfs-tools/hooks/plymouth

set -e

mkdir -p "${DESTDIR}/usr/share/fonts/truetype/fira"
cp -a /usr/share/fonts/opentype/fira/FiraSans-Regular.otf "${DESTDIR}/usr/share/fonts/fira"
fc-cache -s -y "${DESTDIR}" > /dev/null 2>&1
Binary file added usr/share/plymouth/themes/pop-basic/bullet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added usr/share/plymouth/themes/pop-basic/cursor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added usr/share/plymouth/themes/pop-basic/entry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added usr/share/plymouth/themes/pop-basic/lock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added usr/share/plymouth/themes/pop-basic/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions usr/share/plymouth/themes/pop-basic/pop-basic.plymouth
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Plymouth Theme]
Name=Pop Basic
Description=Plymouth theme for Pop!_OS
ModuleName=script

[script]
ImageDir=/usr/share/plymouth/themes/pop-basic
ScriptFile=/usr/share/plymouth/themes/pop-basic/pop-basic.script

[script-env-vars]
208 changes: 208 additions & 0 deletions usr/share/plymouth/themes/pop-basic/pop-basic.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
active_status = "normal";
scale_factor = 1;
logo_size = 256;

window_height = Window.GetHeight ();

if (window_height < 1080) {
logo_size = 128;
} else if (window_height > 1440) {
scale_factor = 2;
}

fun scale (input) {
return input * scale_factor;
}

column_padding = scale (16);
row_padding = scale (32);

xcenter = Window.GetX() + Window.GetWidth(0) / 2;
ycenter = Window.GetY() + Window.GetHeight(0) / 2;

logo.image = Image ("logo.png").Scale (scale (logo_size), scale (logo_size));
logo.sprite = Sprite (logo.image);
logo.sprite.SetOpacity (0);
logo.sprite.SetPosition (
xcenter - logo.image.GetWidth () / 2,
ycenter - logo.image.GetHeight () - scale(32),
10001
);

cursor.image = Image ("cursor.png").Scale (scale (2), scale (12));
cursor.sprite = Sprite (cursor.image);
cursor.opacity_angle = 0;

message_sprite = Sprite ();

# 0x36322f = 0.2117647, 0.1960784, 0.1843137
Window.SetBackgroundTopColor(0.2117647, 0.1960784, 0.1843137);
Window.SetBackgroundBottomColor(0.2117647, 0.1960784, 0.1843137);

debug_status.sprite = Sprite ();
debug_status.sprite.SetOpacity (1);
debug_status.sprite.SetPosition (xcenter, 100, 10000);

# Applies a breathing pattern to the opacity of an element.
#
# - `element` should contain a `sprite` with an `opacity_angle`.
# - The `rate` defines the frequency in Hz
fun breathe (element, rate) {
element.opacity_angle += ((2 * 3.14) / 50) * rate;
opacity = (Math.Cos(element.opacity_angle) + 1) / 2;
element.sprite.SetOpacity (opacity);
}

fun refresh_callback () {
# Hide the cursor and logo by default on each display refresh
cursor.sprite.SetOpacity (0);
logo.sprite.SetOpacity (0);

# Show the logo if the status is `updates`, and show the cursor if `password`.
if (active_status == "updates") {
logo.sprite.SetOpacity (1);
} else if (active_status == "password") {
breathe (cursor, 0.5);
}
}

Plymouth.SetRefreshFunction (refresh_callback);

#----------------------------------------- Dialogue --------------------------------

fun dialog_setup () {
local.lock;
local.entry;
local.cursor;
local.arrow;

lock_size = scale(48);
arrow_size = scale(16);

lock.image = Image("lock.png").Scale(lock_size, lock_size);
entry.image = Image("entry.png").Scale(scale(400), scale(30));
arrow.image = Image("return.png").Scale(arrow_size, arrow_size);

height = entry.image.GetHeight() + row_padding;
ystart = ycenter + (height / 2);

lock.sprite = Sprite(lock.image);
lock.x = xcenter - (lock.image.GetWidth() + entry.image.GetWidth()) / 2;
lock.y = ystart - lock.image.GetHeight() / 2;
lock.sprite.SetPosition(lock.x, lock.y, 1000);

entry.sprite = Sprite(entry.image);
entry.x = lock.x + column_padding + lock.image.GetWidth();
entry.y = ystart - entry.image.GetHeight() / 2;
entry.sprite.SetPosition(entry.x, entry.y, 1000);

arrow.sprite = Sprite(arrow.image);
arrow.x = entry.x + entry.image.GetWidth() - arrow.image.GetWidth() - 2;
arrow.y = ystart - 4 - arrow.image.GetHeight() / 2;
arrow.sprite.SetPosition(arrow.x, arrow.y, 1000);

bullet_size = scale(12);
global.dialog.height = height;
global.dialog.lock = lock;
global.dialog.entry = entry;
global.dialog.arrow = arrow;
global.dialog.bullet_image = Image("bullet.png").Scale(bullet_size, bullet_size);
dialog_opacity (1);
}

fun dialog_opacity (opacity) {
dialog.lock.sprite.SetOpacity (opacity);
dialog.entry.sprite.SetOpacity (opacity);
dialog.arrow.sprite.SetOpacity (opacity);
cursor.sprite.SetOpacity (opacity);
for (index = 0; dialog.bullet[index]; index++) {
dialog.bullet[index].sprite.SetOpacity (opacity);
}
}

fun display_normal_callback () {
if (global.dialog) {
dialog_opacity (0);
}

active_status = "normal";
}

fun display_password_callback (prompt, bullets) {
active_status = "password";
if (!global.dialog) {
dialog_setup();
} else {
dialog_opacity(1);
}

yvalue = dialog.entry.y + dialog.entry.image.GetHeight() / 2
- dialog.bullet_image.GetHeight() / 2
- scale(2);
zvalue = dialog.entry.z + 1;

oindex = 0;
for (index = 0; dialog.bullet[index] || index < bullets && index < 31; index++) {
if (!dialog.bullet[index]) {
dialog.bullet[index].sprite = Sprite(dialog.bullet_image);
dialog.bullet[index].x = dialog.entry.x + index * dialog.bullet_image.GetWidth();
dialog.bullet[index].sprite.SetPosition(dialog.bullet[index].x, yvalue, zvalue);
}

if (index < bullets) {
oindex = index + 1;
dialog.bullet[index].sprite.SetOpacity(1);
} else {
dialog.bullet[index].sprite.SetOpacity(0);
}
}

xvalue = dialog.entry.x + oindex * dialog.bullet_image.GetWidth() + scale(4);
cursor.sprite.SetPosition(xvalue, yvalue, zvalue);
display_message_callback(prompt);
}

Plymouth.SetDisplayNormalFunction(display_normal_callback);
Plymouth.SetDisplayPasswordFunction(display_password_callback);

#----------------------------------------- Message --------------------------------

fun display_message_callback (text) {
if (text == "system-updates") {
active_status = "updates";
logo.sprite.SetOpacity (1);
return;
} else if (text == "system-updates-stop") {
active_status = "normal";
return;
}

text_image = Image.Text(text, 1, 1, 1, 1, "Fira Sans, Regular 11");
text_image = text_image.Scale(
scale(text_image.GetWidth()),
scale(text_image.GetHeight())
);

if (active_status == "updates") {
ypos = ycenter + text_image.GetHeight() / 2 + scale(30);
} else {
ypos = ycenter + dialog.height / 2 + scale(30);
}

message_sprite.SetImage(text_image);
message_sprite.SetPosition(
xcenter - text_image.GetWidth() / 2,
ypos,
10000
);

message_sprite.SetOpacity (1);
}

fun hide_message_callback (text) {
message_sprite = Sprite();
message_sprite.SetPosition(10, 10, 10000);
}

Plymouth.SetDisplayMessageFunction (display_message_callback);
Plymouth.SetHideMessageFunction (hide_message_callback);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added usr/share/plymouth/themes/pop-basic/return.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions usr/share/plymouth/themes/pop-logo/pop-logo.plymouth
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Plymouth Theme]
Name=Pop Logo
Description=Pop Logo
ModuleName=two-step

[two-step]
ImageDir=/usr/share/plymouth/themes/pop-logo
HorizontalAlignment=.5
VerticalAlignment=.5
Transition=merge-fade
TransitionDuration=.5
BackgroundStartColor=0x36322f
BackgroundEndColor=0x36322f
11 changes: 11 additions & 0 deletions usr/share/plymouth/themes/pop-text/pop-text.plymouth.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Plymouth Theme]
Name=Pop Text
Description=Text mode theme based on pop-logo theme
ModuleName=ubuntu-text

[ubuntu-text]
title=Pop!_OS VERSION
black=0x574f4a
white=0xf6f6f6
brown=0x48b9c7
blue=0x48b9c7

0 comments on commit a2ac127

Please sign in to comment.