参考从这个帖子下载下来的mytheme示例:
===========================
http://brej.org/blog/?cat=16
===========================
注意Plymouth不支持’\‘转义回车符,所以如果有很长很长的一行,那就写很长很长的一行吧!
以下是qilang-tech.script的内容,主要是修改它:
===========================
progress_box.x = Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2;
progress_box.y = Window.GetHeight() * 0.7 - 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() * 0.7 - 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);
fun quit_callback()
{
}
Plymouth.SetQuitFunction(quit_ballback);
===========================
懒得写注释了,其实看函数的名字就明白了~~~
主要功能是,1.设置一张漂亮的背景图片,2.放置一个漂亮的logo,3.放置一个显示开机进度的条(由box和bar两张图片组合)。
Plymouth的调试就到此为止,Good Luck!
NOTE:
如果执行下面的命令:
plymouth-set-default-theme qilang-tech
出现提示:
/usr/lib/plymouth/script.so does not exist
就需要执行:
yum install plymouth-plugin-script
文章评论(0条评论)
登录后参与讨论