Skip to content

Commit

Permalink
Fist Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rippanda12 committed Sep 6, 2022
0 parents commit 0240ff3
Show file tree
Hide file tree
Showing 11 changed files with 224 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pkg/
src/
*.zst
*.sig
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) Jiri Tyr 2017

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 changes: 32 additions & 0 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Maintainer: Panda <[email protected]>

pkgname=rebornos-plymouth-theme
pkgver=1.0.0
pkgrel=1
pkgdesc='RebornOS plymouth theme '
arch=('any')
url='https://github.com/RebornOS-Developers/rebornos-plymouth-theme'
license=('GPL3')
depends=('plymouth')
install="${pkgname}.install"
source=(
'bullet.png'
'entry.png'
'logo.png'
'reborn.plymouth'
'script'
'spinner.png')

sha256sums=('efc4c1e327bb30a4c29b2e27316f13b080c7887acf5d6b32569611222f735474'
'c28a4665da4b56cc667ff6ec68e2af289f40767cf41b3f2f75c26609c1c3f162'
'ce560aeb2842ccc1b915818d8fdd360f7f05410ce63c75a844616bf026cb84b2'
'29a786b2a7dd4f6a6412e2356b35adb866de4cab3cda4e2345f9fc43db768f75'
'61445616ab6c73a9dee8dffdcfce7a01debbf6530be685859b41d229412128e9'
'e7dee248d77ea92db4fbc39c2b73a99caa982cff5fd5c00472db98efb0726259')

package() {
cd "${srcdir}"

install -d "${pkgdir}/usr/share/plymouth/themes/reborn"
install -Dm 644 * "${pkgdir}/usr/share/plymouth/themes/reborn"
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# RebornOS plymouth theme

This is a Plymouth theme for RebornOS

The script is taken from the arch-breeze theme, insired by the script from the dark-arch theme. The spinner image is taken from KDE Breeze splash screen.

The theme wasn't tested with all possible features Plymouth offers.
Please provide feedback or suggestions how to improve it.
Binary file added 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 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 logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions reborn.plymouth
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Plymouth Theme]
Name=reborn
Description=RebornOS theme inspired by KDE Breeze
ModuleName=script

[script]
ImageDir=/usr/share/plymouth/themes/reborn
ScriptFile=/usr/share/plymouth/themes/reborn/script
12 changes: 12 additions & 0 deletions rebornos-plymouth-theme.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
post_install() {
cat <<EOF

==> To activate the theme, run as root:
==> plymouth-set-default-theme -R reborn

EOF
}

post_upgrade() {
post_install $1
}
140 changes: 140 additions & 0 deletions script
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
fun rotate_image(index) {
index = Math.Int(index);

if (! RotatedImageCache[index]) {
RotatedImageCache[index] = spinner.image.Rotate((Math.Pi * 2 * index) / spinner.imagecount);
}

return RotatedImageCache[index];
}

fun init() {
// Background
Window.SetBackgroundTopColor(0.0, 0.0, 0.0);
Window.SetBackgroundBottomColor(0.0, 0.0, 0.0);

// Spinner
spinner.image = ImageNew("spinner.png");
spinner.sprite = SpriteNew();
spinner.sprite.SetImage(rotate_image(0));
spinner.sprite.SetX((Window.GetX() + Window.GetWidth() - spinner.image.GetWidth()) / 2);
spinner.sprite.SetY(Window.GetY() + Window.GetHeight() * 0.7);
spinner.angle = 0;
spinner.index = 0;
spinner.imagecount = 64;

// Logo
logo.image = Image("logo.png");
logo.sprite = Sprite(logo.image);
logo.sprite.SetX(Window.GetWidth() / 2 - logo.image.GetWidth() / 2);
logo.sprite.SetY(Window.GetHeight() / 2 - logo.image.GetHeight() / 2);
logo.sprite.SetOpacity(1);
logo.sprite.SetZ(10000);

// Message
message = SpriteNew();

// Dialog
entry.image = ImageNew("entry.png");

entry.sprite = SpriteNew();
entry.sprite.SetImage(entry.image);
entry.x = Window.GetX() + Window.GetWidth() / 2 - entry.image.GetWidth() / 2;
entry.y = Window.GetY() + Window.GetHeight() * 0.7;
entry.z = 10000;
entry.sprite.SetPosition(entry.x, entry.y, entry.z);

msg = SpriteNew();
msg.SetPosition(entry.x + 10, entry.y + 7, entry.z);

dialog.entry = entry;
dialog.message = msg;
dialog.bullet_image = ImageNew("bullet.png");
dialog.visible = 0;

show_dialog(0);
}

fun show_dialog(visibility) {
dialog.visible = visibility;

dialog.entry.sprite.SetOpacity(visibility);
dialog.message.SetOpacity(visibility);

for (index=0; dialog.bullet[index]; index++) {
dialog.bullet[index].sprite.SetOpacity(visibility);
}
}

fun refresh_callback() {
if (dialog.visible) {
spinner.sprite.SetOpacity(0);
} else {
spinner.index += 1;
spinner.index %= spinner.imagecount;
spinner.sprite.SetImage(rotate_image(spinner.index));
spinner.sprite.SetOpacity(1);
}
}

fun display_normal_callback() {
show_dialog(0);
}

fun display_password_callback(text, bullets) {
show_dialog(1);

spinner.sprite.SetOpacity(0);
dialog.message.SetImage(Image.Text(text, 0.6, 0.6, 0.6));

if (bullets > 0) {
dialog.message.SetOpacity(0);
}

for (index=0; dialog.bullet[index] || index<bullets; index++) {
if (! dialog.bullet[index]) {
dialog.bullet[index].sprite = SpriteNew();
dialog.bullet[index].sprite.SetImage(dialog.bullet_image);
dialog.bullet[index].x = dialog.entry.x + index * dialog.bullet_image.GetWidth() + dialog.entry.image.GetWidth() * 0.03;
dialog.bullet[index].y = dialog.entry.y + dialog.entry.image.GetHeight() / 2 - dialog.bullet_image.GetHeight() / 2;
dialog.bullet[index].z = dialog.entry.z + 1;
dialog.bullet[index].sprite.SetPosition(dialog.bullet[index].x, dialog.bullet[index].y, dialog.bullet[index].z);
}

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

if (dialog.bullet[index].x - dialog.entry.x >= dialog.entry.image.GetWidth() * 0.97) {
dialog.bullet[index].sprite.SetOpacity(0);
}
}
}

fun display_message_callback(text) {
text_img = Image.Text(text, 1.0, 1.0, 1.0);
message.SetImage(text_img);
message.SetPosition(Window.GetX() + (Window.GetWidth() - text_img.GetWidth()) / 2, Window.GetY() + Window.GetHeight() * 0.93, 2);
}

fun quit_callback() {
spinner.sprite.SetOpacity(0);
}

// Global variables
spinner;
logo;
message;
dialog;

// Initiate all graphical elements
init();

// Set callback functions
Plymouth.SetRefreshFunction(refresh_callback);
Plymouth.SetDisplayNormalFunction(display_normal_callback);
Plymouth.SetDisplayPasswordFunction(display_password_callback);
Plymouth.SetMessageFunction(display_message_callback);
Plymouth.SetQuitFunction(quit_callback);
Binary file added spinner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0240ff3

Please sign in to comment.