Ros*_*ge 62 customization plymouth logo custom-distributions
我正在制作自定义发行版,并且对启动时显示的 5 个点的 Ubuntu 徽标有疑问。
所述Ubuntu-Logo-Script的在/lib/plymouth/themes/ubuntutext文件夹具有字Ubuntu和其5进展“点”的下方。是否可以删除进度条点,而是用褪色的 Ubuntu 徽标替换它,逐渐着色到完整?

Rah*_*ara 140
我已经用褪色的 Ubuntu 徽标创建了您想要的主题(此外,我还添加了 Ubuntu 徽标的动画。希望您喜欢它 :-P )
截屏

想看现场直播吗?
转至http://www.youtube.com/watch?v=zPo50gM3txU
哪里可以买到这个主题?
我把它上传到主人MediaFire云在这里。
你如何安装它?
从上面的链接下载,保存在你的桌面上,然后一一发出这些命令。请更换/lib/plymouth/themes使用/usr/share/plymouth/themes中的命令,如果您是在16.04或更高版本。
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 -u
Run Code Online (Sandbox Code Playgroud)
如何检查?
复制下面的整个命令并将其粘贴到终端中,然后按 Enter。(你也许会需要安装一个软件包:sudo 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 */
Run Code Online (Sandbox Code Playgroud)
语句以分号结束,例如
foo = 10;
Run Code Online (Sandbox Code Playgroud)
语句块可以用大括号创建,例如
{
foo = 10;
z = foo + foo;
}
Run Code Online (Sandbox Code Playgroud)
支持的运算符是+, -, *, /, %。还支持速记赋值运算符+=, -=, *=,等。还支持一元运算符,例如
foo *= ++z;
Run Code Online (Sandbox Code Playgroud)
+ 用于连接,例如
foo = "Jun" + 7; # here foo is "Jun7"
Run Code Online (Sandbox Code Playgroud)
比较运算符示例:
x = (3 >= 1); # assign 1 to x because it's true
y = ("foo" == "bar"); # assign 0 to y because it's false
Run Code Online (Sandbox Code Playgroud)
条件操作和循环:
if (foo > 4)
{
foo--;
z = 1;
}
else
z = 0;
while (foo--)
z *= foo;
Run Code Online (Sandbox Code Playgroud)
&&, ||,!也支持。
if ( foo > 0 && foo <4 )
Run Code Online (Sandbox Code Playgroud)
这对许多读者来说可能是新的:散列,类似于数组。可以通过使用dot或[ ]括号访问其内容来创建哈希,例如
foo.a = 5;
x = foo["a"] ; # x equals to 5
Run Code Online (Sandbox Code Playgroud)
使用fun关键字来定义函数,例如
fun animator (param1, param2, param3)
{
if (param1 == param2)
return param2;
else
return param3;
}
Run Code Online (Sandbox Code Playgroud)
要创建新图像,请将主题目录中图像的文件名指定为Image(). 请记住,仅支持 .png 文件。例如:
background = Image ("black.png");
Run Code Online (Sandbox Code Playgroud)
要显示文本消息,您必须创建一个Image文本。(这可能会让您感到惊讶。)例如:
text_message_image = Image.Text("I love Ubuntu");
Run Code Online (Sandbox Code Playgroud)
可以使用GetWidth()和找到宽度和高度GetHeight();例如:
image_area = background.GetWidth() * background.GetHeight();
Run Code Online (Sandbox Code Playgroud)
可以旋转或更改图像的大小;例如:
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
Run Code Online (Sandbox Code Playgroud)
用于在屏幕上Sprite放置一个Image。
创建一个Sprite:
first_sprite = Sprite ();
first_sprite.SetImage (background);
Run Code Online (Sandbox Code Playgroud)
或者通过向其构造函数提供图像,
first_sprite = Sprite (background);
Run Code Online (Sandbox Code Playgroud)
如何将不同的精灵设置到屏幕上的不同位置 (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);
Run Code Online (Sandbox Code Playgroud)
或者您可以使用以下命令一次性设置所有内容SetPosition():
first_sprite.Setposition(300, 200, 50) # put at x=300, y=200, z=50
Run Code Online (Sandbox Code Playgroud)
改变不透明度:
faded_sprite.SetOpacity (0.3);
invisible_sprite.SetOpacity (0);
Run Code Online (Sandbox Code Playgroud)
使用的一些杂项方法是:
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.
Run Code Online (Sandbox Code Playgroud)
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.
Run Code Online (Sandbox Code Playgroud)
Math.Abs()
Math.Min()
Math.Pi()
Math.Cos()
Math.Random()
Math.Int()
etc.
Run Code Online (Sandbox Code Playgroud)
.script从我上传的主题打开文件并尝试了解它的作用。可以在此处找到出色的指南 。
我相信你会学到这个。这并不难。如果您需要任何帮助,请告诉我。
希望它可以帮助您自己创建一个。
回答 Roshan George 的评论:
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
Run Code Online (Sandbox Code Playgroud)
您可能需要添加 sprite.SetZ (-10);
你应该删除
Window.SetBackgroundTopColor (p, q, r);
Window.SetBackgroundBottomColor (a, b, c);
Run Code Online (Sandbox Code Playgroud)
哪里p, q, r, a, b, c有一些值。
更多链接
| 归档时间: |
|
| 查看次数: |
87969 次 |
| 最近记录: |