Plymouth script Gallery

Show your artwork
Forum rules
No support questions here please

Plymouth script Gallery

Postby Zorba on Thu Jan 09, 2014 5:29 am

This thread is dedicated to plymouth artwork. Please share your plymouth scripts and help us make Linux Mint look better.

This is my current plymouth theme script (Minty-Pistachio):

Code: Select all
for (i=0; i<10; i++){
  spec[i].image = Image("spec" + (i % 3) + ".png");
  spec[i].sprite = Sprite(spec[i].image);
  spec[i].sprite.SetOpacity (0.0);
  }

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 (0.0);
logo.sprite.SetZ (10000);
progress = 0.0;

fun refresh (){
  inc = progress;
 
  logo.sprite.SetOpacity (MathClamp((inc-0.7)/0.2, 0, 1));
 
  if (inc<0.8){
    for (i=0; i<10; i++){
      spec[i].sprite.SetX (Window.GetWidth()  / 2 - spec[i].image.GetWidth()  / 2 + Math.Sin(i*i+(inc*100+i*17)/10) * (0.8-inc)*Window.GetWidth()*0.3);
      spec[i].sprite.SetY (Window.GetHeight() / 2 - spec[i].image.GetHeight() / 2 + Math.Cos(i*i+(inc*100+i*5)/7) * (0.8-inc)*Window.GetHeight()*0.3);
      spec[i].sprite.SetZ (0);
      spec[i].sprite.SetOpacity (inc/0.8);
      }
    }
  else {
    for (i=0; i<10; i++)
      spec[i].sprite.SetOpacity (Math.Clamp((0.9-inc)/0.1, 0, 1));
    }
 
  }

Plymouth.SetRefreshFunction (refresh);

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

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.GetWidth()  / 2 - box.image.GetWidth ()/2;
    box.y = 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);

#----------------------------------------- Progress Bar --------------------------------

progress_box.image = Image("progress_box.png");
progress_box.sprite = Sprite(progress_box.image);

progress_box.x = Window.GetWidth()  / 2 -    progress_box.image.GetWidth()  / 2;
progress_box.y = Window.GetHeight() * 0.75 - 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.GetWidth()  / 2 -        progress_bar.original_image.GetWidth() / 2;
progress_bar.y = Window.GetHeight() / 2 * 1.5  - 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)
  {
    progress = (progress * 100) / 27.0;
    global.progress = 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);

#----------------------------------------- Quit --------------------------------

fun quit_callback ()
{
  logo.sprite.SetOpacity (1);
}

Plymouth.SetQuitFunction(quit_callback);

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

message_sprite = Sprite();
message_sprite.SetPosition(10, 10, 10000);

fun message_callback (text)
{
  my_image = Image.Text(text, 1, 1, 1);
  message_sprite.SetImage(my_image);
}

Plymouth.SetMessageFunction(message_callback);



Minty-Pistachio plymouth theme http://gnome-look.org/content/show.php?content=162830

Image

Image
Image
User avatar
Zorba
Level 8
Level 8
 
Posts: 2279
Joined: Tue May 29, 2012 10:12 pm
Location: Tunisia

Linux Mint is funded by ads and donations.
 

Re: Plymouth script Gallery

Postby austin.texas on Thu Jan 09, 2014 7:30 am

Very interesting, Brahim
It is hard to add to what you have already published http://community.linuxmint.com/tutorial/view/1149
It already covers a lot.
Mint 17 Cinnamon (64 bit), Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Microsoft-free environment since 1996

To help Linux Mint with a donation, please visit http://www.linuxmint.com/donors.php
User avatar
austin.texas
Level 9
Level 9
 
Posts: 2811
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home


Return to Other artwork

Who is online

Users browsing this forum: philer and 1 guest