master
DSLitvinov 2 years ago
parent 289b9c32a9
commit 94e297c862
  1. BIN
      mos/boot16x9.png
  2. BIN
      mos/boot4x3.png
  3. BIN
      mos/box.png
  4. BIN
      mos/bullet.png
  5. 49
      mos/bullet.svg
  6. BIN
      mos/entry.png
  7. BIN
      mos/lock.png
  8. 53
      mos/lock.svg
  9. 9
      mos/mos.plymouth
  10. 192
      mos/mos.script
  11. BIN
      mos/progress_bar.png
  12. BIN
      mos/progress_box.png
  13. BIN
      mos/shutdown16x9.png
  14. BIN
      mos/shutdown4x3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="7"
height="7"
viewBox="0 0 1.8520833 1.8520833"
version="1.1"
id="svg5"
inkscape:version="1.2 (1:1.2.1+202207142221+cd75a1ee6d)"
sodipodi:docname="bullet.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="45.254834"
inkscape:cx="5.2591067"
inkscape:cy="4.4194174"
inkscape:window-width="1920"
inkscape:window-height="1007"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Слой 1"
inkscape:groupmode="layer"
id="layer1">
<circle
style="fill:#4c6ef5;fill-opacity:1;stroke:none;stroke-width:1.75033"
id="path236"
cx="0.92604166"
cy="0.92604166"
r="0.79374999" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="44"
height="44"
viewBox="0 0 11.641666 11.641667"
version="1.1"
id="svg5"
xml:space="preserve"
inkscape:version="1.2 (1:1.2.1+202207142221+cd75a1ee6d)"
sodipodi:docname="lock.svg"
inkscape:export-filename="lock.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="24.316722"
inkscape:cx="22.782676"
inkscape:cy="24.222015"
inkscape:window-width="1920"
inkscape:window-height="1007"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><defs
id="defs2" /><g
inkscape:label="Слой 1"
inkscape:groupmode="layer"
id="layer1"><rect
style="fill:#ffffff;stroke-width:26.4583"
id="rect354"
width="7.5671072"
height="5.9816194"
x="2.0372798"
y="4.9993453"
ry="0.37841314" /><path
style="fill:none;stroke:#fefefe;stroke-width:1;stroke-dasharray:none;stroke-opacity:1"
d="m 3.1810624,5.5285122 0.010156,-2.3296573 c 0.010733,-2.46197711 5.2426785,-2.46196141 5.2535092,0.00452 l 0.01021,2.3251373"
id="path412"
sodipodi:nodetypes="cssc" /></g></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -0,0 +1,9 @@
[Plymouth Theme]
Name=MOS
Description=MOS Plymouth theme.
ModuleName=script
[script]
ImageDir=/usr/share/plymouth/themes/mos
ScriptFile=/usr/share/plymouth/themes/mos/mos.script
UseFirmwareBackground=false

@ -0,0 +1,192 @@
# background
fun imglogo( image, scaleX, scaleY )
{
image.Scale( image.GetWidth() * scaleX, image.GetHeight() * scaleY );
}
#----------------------------------------- Ptogress Bar __________________________
if (Plymouth.GetMode () == "boot")
{
# background
if( Window.GetWidth()/Window.GetHeight() > 1.5 )
{
logo.raw = Image("boot16x9.png");
}
else
{
logo.raw = Image("boot4x3.png");
}
logo.image = imglogo( logo.raw, Window.GetWidth()/logo.raw.GetWidth(), Window.GetHeight()/logo.raw.GetHeight());
logo.sprite = Sprite(logo.image);
logo.sprite.SetPosition(0, 0, 0);
progress_box.image = Image("progress_box.png");
progress_box.sprite = Sprite(progress_box.image);
progress_box.x = Window.GetX() + Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2;
#change here
progress_box.y = Window.GetY() + Window.GetHeight() * 0.65 - progress_box.image.GetHeight() / 2;
progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 0);
progress_bar.original_image = Image("progress_bar.png");
progress_bar.sprite = Sprite();
progress_bar.x = Window.GetX() + Window.GetWidth() / 2 - progress_bar.original_image.GetWidth() / 2;
#change here
progress_bar.y = Window.GetY() + Window.GetHeight() / 2 * 1.3 - progress_box.image.GetHeight() / 2 + (progress_box.image.GetHeight() - progress_bar.original_image.GetHeight()) / 2;
progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 1);
fun progress_callback (duration, progress)
{
if (progress_bar.image.GetWidth () != Math.Int (progress_bar.original_image.GetWidth () * progress))
{
progress_bar.image = progress_bar.original_image.Scale(progress_bar.original_image.GetWidth(progress_bar.original_image) * progress, progress_bar.original_image.GetHeight());
progress_bar.sprite.SetImage (progress_bar.image);
}
}
Plymouth.SetBootProgressFunction(progress_callback);
}
if (Plymouth.GetMode () == "shutdown")
{
# background
if( Window.GetWidth()/Window.GetHeight() > 1.5 )
{
logo.raw = Image("shutdown16x9.png");
}
else
{
logo.raw = Image("shutdown4x3.png");
}
logo.image = imglogo( logo.raw, Window.GetWidth()/logo.raw.GetWidth(), Window.GetHeight()/logo.raw.GetHeight());
logo.sprite = Sprite(logo.image);
logo.sprite.SetPosition(0, 0, 0);
}
#----------------------------------------- Dialog --------------------------------
status = "normal";
fun dialog_setup()
{
local.box;
local.lock;
local.entry;
box.image = Image("box.png");
lock.image = Image("lock.png");
entry.image = Image("entry.png");
box.sprite = Sprite(box.image);
box.x = Window.GetX() + Window.GetWidth() / 2 - box.image.GetWidth ()/2;
box.y = Window.GetY() + Window.GetHeight() / 2 - box.image.GetHeight()/2;
box.z = 10000;
box.sprite.SetPosition(box.x, box.y, box.z);
lock.sprite = Sprite(lock.image);
lock.x = box.x + box.image.GetWidth()/2 - (lock.image.GetWidth() + entry.image.GetWidth()) / 2;
lock.y = box.y + box.image.GetHeight()/2 - lock.image.GetHeight()/2;
lock.z = box.z + 1;
lock.sprite.SetPosition(lock.x, lock.y, lock.z);
entry.sprite = Sprite(entry.image);
entry.x = lock.x + lock.image.GetWidth();
entry.y = box.y + box.image.GetHeight()/2 - entry.image.GetHeight()/2;
entry.z = box.z + 1;
entry.sprite.SetPosition(entry.x, entry.y, entry.z);
global.dialog.box = box;
global.dialog.lock = lock;
global.dialog.entry = entry;
global.dialog.bullet_image = Image("bullet.png");
dialog_opacity (1);
}
fun dialog_opacity(opacity)
{
dialog.box.sprite.SetOpacity (opacity);
dialog.lock.sprite.SetOpacity (opacity);
dialog.entry.sprite.SetOpacity (opacity);
for (index = 0; dialog.bullet[index]; index++)
{
dialog.bullet[index].sprite.SetOpacity(opacity);
}
}
fun display_normal_callback ()
{
global.status = "normal";
if (global.dialog)
dialog_opacity (0);
}
fun display_password_callback (prompt, bullets)
{
global.status = "password";
if (!global.dialog)
dialog_setup();
else
dialog_opacity(1);
for (index = 0; dialog.bullet[index] || index < bullets; 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].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);
}
}
Plymouth.SetDisplayNormalFunction(display_normal_callback);
Plymouth.SetDisplayPasswordFunction(display_password_callback);
#----------------------------------------- Quit --------------------------------
fun quit_callback ()
{
logo.sprite.SetOpacity (1);
}
Plymouth.SetQuitFunction(quit_callback);
#----------------------------------------- Message --------------------------------
message_sprites = [];
message_sprite_count = 0;
message_sprite_y = 10;
fun display_message_callback (text)
{
my_image = Image.Text(text, 1, 1, 1);
message_sprites[message_sprite_count] = Sprite(my_image);
message_sprites[message_sprite_count].SetPosition(10, message_sprite_y, 10000);
message_sprites[message_sprite_count].text = text;
message_sprite_count++;
message_sprite_y += my_image.GetHeight();
}
fun hide_message_callback (text)
{
for (i = 0; i < message_sprite_count; i++)
{
if (message_sprites[i].text == text)
message_sprites[i] = NULL;
}
}
Plymouth.SetDisplayMessageFunction (display_message_callback);
Plymouth.SetHideMessageFunction (hide_message_callback);

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 KiB

Loading…
Cancel
Save