我正在做一个自定义发行版,并有一个关于Ubuntu的问题,在启动时显示了5个点。
Ubuntu-Logo-Script文件夹中的/lib/plymouth/themes/ubuntutext有一个单词Ubuntu,在这5个进展点下面。是否有可能移除进度条形点,取而代之的是褪色的Ubuntu徽标,该徽标将逐渐变成完整的颜色?

发布于 2012-06-07 13:15:00
我已经创建了您想要的主题与褪色的Ubuntu标志(此外,我增加了一个Ubuntu徽标动画。希望你喜欢:-P )

转到http://www.youtube.com/watch?v=zPo50gM3txU
我已经把它上传到了Mediafire云这里。
从上面的链接下载,保存在桌面上,然后一个一个地发出这些命令。如果您在16.04或更高版本,请在命令中将/lib/plymouth/themes替换为/usr/share/plymouth/themes。
cd ~/Desktop/
tar -xf ubuntufaded.tar
sudo cp -r ubuntu-faded-screen '/lib/plymouth/themes'
sudo rm '/lib/plymouth/themes/default.plymouth'
sudo ln -s '/lib/plymouth/themes/ubuntu-faded-screen/ubuntu-faded-screen.plymouth' '/lib/plymouth/themes/default.plymouth'
sudo update-initramfs -usudo apt-get install plymouth-x11) sudo plymouthd --debug --debug-file=/tmp/plymouth-debug-out ; sudo plymouth --show-splash ; for ((I=0;I<10;I++)); do sleep 1 ; sudo plymouth --update=event$I ; done ; sudo plymouth --quit普利茅斯脚本语言非常类似于C或JavaScript。如果您了解这些语言,那么自己创建普利茅斯脚本将非常容易。
让我们从操作符、循环、注释等基础开始,支持三种类型的注释。
# comment like in bash
// single line comment like in C
/* block comments */语句以分号结尾。
foo = 10;语句块可以用花括号创建。
{
foo = 10;
z = foo + foo;
}支持的运算符是+、-、*、/、%。速记作业也支持+=, -=, *=,等。一元运算符也被支持,例如。
foo *= ++z;+是用来连接的。
foo = "Jun" + 7; # here foo is "Jun7"比较运算符示例:
x = (3 >= 1); # assign 1 to x because it's true
y = ("foo" == "bar"); # assign 0 to y because it's false有条件操作和循环:
if (foo > 4)
{
foo--;
z = 1;
}
else
z = 0;
while (foo--)
z *= foo;还支持&&、||、!。
if ( foo > 0 && foo <4 )对于许多读者来说,这可能是新的:散列,类似于数组。哈希可以通过使用dot或[ ]括号访问其内容来创建。
foo.a = 5;
x = foo["a"] ; # x equals to 5使用fun关键字来定义函数。
fun animator (param1, param2, param3)
{
if (param1 == param2)
return param2;
else
return param3;
}若要创建新图像,请将主题目录中的图像的文件名授予Image()。记住,只支持.png文件。例如:
background = Image ("black.png"); 要显示文本消息,必须创建文本的Image。(这可能让你大吃一惊。)例如:
text_message_image = Image.Text("I love Ubuntu");可以使用GetWidth()和GetHeight()找到宽度和高度;例如:
image_area = background.GetWidth() * background.GetHeight();可以旋转或更改图像的大小;例如:
down_image = logo_image.Rotate (3.1415); # Image can be Rotated. Parameter to Rotate is the angle in radians
fat_image = background.Scale ( background.GetWidth() * 4 , background.GetHeight () ) # make the image four times the width使用Sprite在屏幕上放置Image。
创建一个Sprite:
first_sprite = Sprite ();
first_sprite.SetImage (background);或者通过向构造函数提供图像,
first_sprite = Sprite (background);如何将不同的精灵设置到屏幕上的不同位置(x,y,z):
first_sprite.SetX (300); # put at x=300
first_sprite.SetY (200); # put at y=200
background.SetZ(-20);
foreground.SetZ(50);或者您可以使用SetPosition()一次性设置所有内容:
first_sprite.Setposition(300, 200, 50) # put at x=300, y=200, z=50变化中的不透明度:
faded_sprite.SetOpacity (0.3);
invisible_sprite.SetOpacity (0);所用的一些杂项方法是:
Window.GetWidth();
Window.GetHeight();
Window.SetBackgroundTopColor (0.5, 0, 0); # RGB values between 0 to 1.
Window.SetBackgroundBottomColor (0.4, 0.3, 0.6);
Plymouth.GetMode(); # returns a string of one of: "boot", "shutdown", "suspend", "resume" or unknown.
etc.Plymouth.SetRefreshFunction (function); # Calling Plymouth.SetRefreshFunction with a function will set that function to be called up to 50 times every second
Plymouth.SetBootProgressFunction(); # function is called with two numbers, time spent booting so far and the progress (between 0 and 1)
Plymouth.SetRootMountedFunction(); # function is called when a new root is mounted
Plymouth.SetKeyboardInputFunction(); # function is called with a string containing a new character entered on the keyboard
Plymouth.SetUpdateStatusFunction(); # function is called with the new boot status string
Plymouth.SetDisplayPasswordFunction(); # function is called when the display should display a password dialogue. First param is prompt string, the second is the number of bullets.
Plymouth.SetDisplayQuestionFunction(); # function is called when the display should display a question dialogue. First param is prompt string, the second is the entry contents.
Plymouth.SetDisplayNormalFunction(); # function is called when the display should return to normal
Plymouth.SetMessageFunction(); # function is called when new message should be displayed. First arg is message to display.Math.Abs()
Math.Min()
Math.Pi()
Math.Cos()
Math.Random()
Math.Int()
etc.从我上传的主题中打开.script文件,并尝试理解它所做的事情。一个非常棒的指南可以找到这里。
我相信你会学到的。这并不难。如果你需要帮助,请告诉我。
希望它能帮你自己创造一个。
回答罗山·乔治的评论:Is it possible to replace the purple colour with an image as background in the default Plymouth theme names "ubuntu-logo" ?
background = Image ("your-image.png");
sprite = Sprite (background.Scale (Window.GetWidth(), Window.GetHeight()));
sprite.SetX (0); # put at x=0
sprite.SetY (0); # put at y=0您可能需要添加sprite.SetZ (-10);
你应该把
Window.SetBackgroundTopColor (p, q, r);
Window.SetBackgroundBottomColor (a, b, c);其中p, q, r, a, b, c是一些值。
更多链接
发布于 2012-06-05 13:07:28
使用普利茅斯经理来改变这一点。您可以从从这里到洗衣板获得它,或者运行下面的命令。
wget https://launchpad.net/plymouth-manager/trunk/stable/+download/plymouth-manager_1.5.0-1_all.deb
sudo dpkg -i plymouth-manager_1.5.0-1_all.deb 在此之后,您需要使用以下命令启动plymouth-manager:
sudo plymouth-manager如果您想自己执行“魔术”命令(编写您自己的plymouth配置文件),并且您想在准备就绪时应用它,则如下所示:
sudo update-alternatives --config default.plymouth && sudo update-initramfs -u发布于 2012-06-05 04:12:44
我已经用GRUB定制软件更改了GRUB屏幕。但是如果你想改变普利茅斯的屏幕,那就不一样了。
这个软件的所有东西都在/lib/plymouth/themes目录中,而这个软件的所有动画都在/lib/plymouth/themes/ubuntu-logo/ubuntu-logo.script文件中。
如果您想要根据您的喜好修改普利茅斯,您所需要的只是在ubuntu-logo文件夹上。
不需要任何外部软件的帮助,你可以自己完成它,但是你必须理解编程。
此外,您还可以在Ubuntu存储库中找到这样做的工具,但是您需要学习如何创建普利茅斯主题。
祝好运!
https://askubuntu.com/questions/143330
复制相似问题