diff --git a/debian/install b/debian/install index c9d90b0..398ecf0 100644 --- a/debian/install +++ b/debian/install @@ -1 +1,2 @@ -pop-basic/ usr/share/plymouth/themes/ \ No newline at end of file +pop-basic/ usr/share/plymouth/themes/ +usr/share/initramfs-tools/hooks/plymouth-pop diff --git a/pop-basic/pop-basic.plymouth b/pop-basic/pop-basic.plymouth index 7d7cbf1..eccfe23 100755 --- a/pop-basic/pop-basic.plymouth +++ b/pop-basic/pop-basic.plymouth @@ -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 @@ -23,7 +23,7 @@ ProgressBarBackgroundColor=0x606060 ProgressBarForegroundColor=0xffffff DialogClearsFirmwareBackground=true MessageBelowAnimation=true -MessageBelowAnimationDistance=80 +MessageBelowAnimationDistance=10 CursorAnimation=breath CursorAnimationSpeed=7 diff --git a/pop-basic/throbber-0001.png b/pop-basic/throbber-0001.png deleted file mode 100755 index 2974d00..0000000 Binary files a/pop-basic/throbber-0001.png and /dev/null differ diff --git a/usr/share/initramfs-tools/hooks/plymouth-pop b/usr/share/initramfs-tools/hooks/plymouth-pop new file mode 100755 index 0000000..a826fe2 --- /dev/null +++ b/usr/share/initramfs-tools/hooks/plymouth-pop @@ -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 diff --git a/usr/share/plymouth/themes/pop-basic/bullet.png b/usr/share/plymouth/themes/pop-basic/bullet.png new file mode 100644 index 0000000..a428b55 Binary files /dev/null and b/usr/share/plymouth/themes/pop-basic/bullet.png differ diff --git a/usr/share/plymouth/themes/pop-basic/cursor.png b/usr/share/plymouth/themes/pop-basic/cursor.png new file mode 100644 index 0000000..a099548 Binary files /dev/null and b/usr/share/plymouth/themes/pop-basic/cursor.png differ diff --git a/usr/share/plymouth/themes/pop-basic/entry.png b/usr/share/plymouth/themes/pop-basic/entry.png new file mode 100644 index 0000000..57df4bf Binary files /dev/null and b/usr/share/plymouth/themes/pop-basic/entry.png differ diff --git a/usr/share/plymouth/themes/pop-basic/lock.png b/usr/share/plymouth/themes/pop-basic/lock.png new file mode 100644 index 0000000..b46481b Binary files /dev/null and b/usr/share/plymouth/themes/pop-basic/lock.png differ diff --git a/usr/share/plymouth/themes/pop-basic/logo.png b/usr/share/plymouth/themes/pop-basic/logo.png new file mode 100644 index 0000000..c749afd Binary files /dev/null and b/usr/share/plymouth/themes/pop-basic/logo.png differ diff --git a/usr/share/plymouth/themes/pop-basic/pop-basic.plymouth b/usr/share/plymouth/themes/pop-basic/pop-basic.plymouth new file mode 100644 index 0000000..75a3db9 --- /dev/null +++ b/usr/share/plymouth/themes/pop-basic/pop-basic.plymouth @@ -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] diff --git a/usr/share/plymouth/themes/pop-basic/pop-basic.script b/usr/share/plymouth/themes/pop-basic/pop-basic.script new file mode 100644 index 0000000..3060895 --- /dev/null +++ b/usr/share/plymouth/themes/pop-basic/pop-basic.script @@ -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); diff --git a/usr/share/plymouth/themes/pop-basic/progress_bar.png b/usr/share/plymouth/themes/pop-basic/progress_bar.png new file mode 100644 index 0000000..5f3e52a Binary files /dev/null and b/usr/share/plymouth/themes/pop-basic/progress_bar.png differ diff --git a/usr/share/plymouth/themes/pop-basic/return.png b/usr/share/plymouth/themes/pop-basic/return.png new file mode 100644 index 0000000..23064c6 Binary files /dev/null and b/usr/share/plymouth/themes/pop-basic/return.png differ diff --git a/usr/share/plymouth/themes/pop-logo/pop-logo.plymouth b/usr/share/plymouth/themes/pop-logo/pop-logo.plymouth new file mode 100644 index 0000000..ba9288e --- /dev/null +++ b/usr/share/plymouth/themes/pop-logo/pop-logo.plymouth @@ -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 diff --git a/usr/share/plymouth/themes/pop-text/pop-text.plymouth.in b/usr/share/plymouth/themes/pop-text/pop-text.plymouth.in new file mode 100644 index 0000000..0fef1cf --- /dev/null +++ b/usr/share/plymouth/themes/pop-text/pop-text.plymouth.in @@ -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