ubuntu 自定义开机画面

#ubuntu 自定义开机画面

开机动画在 /usr/share/plymouth 文件夹内

下载开机动画

sudo apt-get install plymouth-theme*

选择开机动画

sudo update-alternatives --config default.plymouth

更新开机动画

sudo update-initramfs -u

自定义动画

选定一个动画的特效,在 /usr/share/plymouth/themes/下找到相应的主题,例如:ubuntu-gnome-logo
####1 修改图片
修改此文件夹内的.png图片和ubuntu_gnome_logo.png即可获得相应的自定义效果。
####2 修改脚本
修改脚本 例如
/usr/share/plymouth/themes/ubuntu-logo/ubuntu-logo.script

部分脚本:

#-----------------------------------------------------------------------------
# Previous background colour
# #300a24 --> 0.19, 0.04, 0.14
# New background colour
# #2c001e --> 0.16, 0.00, 0.12
#
# 屏幕顶部 rgb 值 (40.8, 0, 30.6)
Window.SetBackgroundTopColor (0.16, 0.00, 0.12);     # Nice colour on top of the screen fading to

# 屏幕底部 rgb 值 (40.8, 0, 30.6)
Window.SetBackgroundBottomColor (0.16, 0.00, 0.12);  # an equally nice colour on the bottom

bits_per_pixel = Window.GetBitsPerPixel ();
if (bits_per_pixel == 4) {
    logo_filename = "ubuntu-logo16.png";
    progress_dot_off_filename = "progress-dot-off16.png";
    progress_dot_on_filename = "progress-dot-on16.png";
    password_field_filename = "password-field16.png";
    question_field_filename = "password-field16.png";
} else {
    logo_filename = "ubuntu-logo.png";
    progress_dot_off_filename = "progress-dot-off.png";
    progress_dot_on_filename = "progress-dot-on.png";
    password_field_filename = "password-field.png";
    question_field_filename = "password-field.png";
}

logo.image = Image (logo_filename);
logo.sprite = Sprite ();
logo.sprite.SetImage (logo.image);
logo.width = logo.image.GetWidth ();									#图片logo宽度
logo.height = logo.image.GetHeight ();									#图片logo高度
logo.x = Window.GetX () + Window.GetWidth () / 2 - logo.width  / 2;		#图片x坐标
logo.y = Window.GetY () + Window.GetHeight () / 2 - logo.height;		#图片y坐标
logo.z = 1000;															#图片z坐标
logo.sprite.SetX (logo.x);
logo.sprite.SetY (logo.y);
logo.sprite.SetZ (logo.z);
logo.sprite.SetOpacity (1);

# Spacing below the logo - in pixels
logo_spacing = logo.height * 4;											#图片底部间隔

修改完成之后 sudo update-initramfs -u 更新开机动画 ,然后 reboot 查看效果

你可能感兴趣的:(ubuntu)