AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1315767
Accepted
user227495
user227495
Asked: 2021-02-12 22:49:24 +0800 CST2021-02-12 22:49:24 +0800 CST 2021-02-12 22:49:24 +0800 CST

在 20.04 中更改默认的 Plymouth Spinner

  • 772

是否可以使用我们自己的图像更改登录期间显示的默认 20.04 Plymouth 3 曲线微调器动画/旋转?

更新:根据 UnKNOWn 评论中的说明

可能的微调器更换,256x256px,易于使用

在此处输入图像描述

添加了 GIF

在此处输入图像描述

20.04
  • 1 1 个回答
  • 2087 Views

1 个回答

  • Voted
  1. Best Answer
    UnKNOWn
    2021-02-14T00:45:56+08:002021-02-14T00:45:56+08:00

    在默认安装的 Ubuntu 20.04 中,bgrt使用 Plymouth 主题。

    /usr/share/plymouth/themes/bgrt/bgrt.plymouth

    此主题具有以下(仅部分内容)文件中的内容/usr/share/plymouth/themes/bgrt/bgrt.plymouth

    [Plymouth Theme]
    Name=BGRT
    Description=Jimmac's spinner theme using the ACPI BGRT graphics as background
    ModuleName=two-step
    

    该行ModuleName=two-step有一些硬编码,与其他使用脚本的普利茅斯主题相反。

    来自另一个普利茅斯主题的一些内容

    [Plymouth Theme]
    Name=Script
    Description=Script example plugin.
    ModuleName=script
    
    [script]
    ImageDir=/usr/share/plymouth/themes/script
    ScriptFile=/usr/share/plymouth/themes/script/script.script
    

    由于您的主要目标是保留 Ubuntu 20.04 附带的默认 Plymouth 主题,因此我们需要专注于MouduleName=two-step

    我试图获取名为“两步”的此模块的配置/指南/规范,但没有成功..

    这个 Ask Ubuntu 帖子https://askubuntu.com/a/85329/739431可能有助于理解名为两步的 Moudule。

    从默认普利茅斯主题 bgrt 的试验和错误/usr/share/plymouth/themes/bgrt/以及上面的 Ask Ubuntu 帖子的帮助下..

    我做了以下步骤让自定义图像作为微调器播放..

    1.使用以下命令复制微调器主题

    sudo cp -r /usr/share/plymouth/themes/spinner /usr/share/plymouth/themes/myplymouththeme
    

    使用以下命令将spinner.playmouth文件重命名为myplymouththeme.plymouth

    sudo mv /usr/share/plymouth/themes/myplymouththeme/spinner.plymouth /usr/share/plymouth/themes/myplymouththeme/myplymouththeme.plymouth
    

    使用以下命令打开文件myplymouththeme.plymouth并根据您的要求编辑内容。

    sudo -H gedit /usr/share/plymouth/themes/myplymouththeme/myplymouththeme.plymouth
    

    一些需要编辑的行..我已经编辑过了。

    ImageDir=/usr/share/plymouth/themes/myplymouththeme
    
    HorizontalAlignment=.5
    VerticalAlignment=.7
    WatermarkHorizontalAlignment=.5
    WatermarkVerticalAlignment=.96
    

    图像目录是不言自明的,因为我们将把我们的图像保存在这个目录中。
    HorAlignment .5 是微调器的中心。
    VerAlignment .7 是从屏幕顶部到底部,您可以减少它以增加水印和微调器之间的间隙。
    水印也与上面的解释类似。

    图像名称似乎有throbber-其编号的前缀,如 throbber-01.png throbber02.png 等。删除所有带有动画*和 throbber* 的图像,然后将您的图像放在上述目录中。似乎它只接受 png 文件作为图像。

    好的,配置完成。。

    要使用此主题,请playmouthd.conf使用以下命令创建一个新文件

    sudo install -D /dev/null /etc/plymouth/plymouthd.conf
    

    并使用以下命令打开文件并添加行..

    sudo -H gedit /etc/plymouth/plymouthd.conf
    

    线条

    [Daemon]
    Theme=myplymouththeme
    ShowDelay=0
    

    您可以使用您喜欢的图像更改 watermark.png(注意默认 watermark.png 图片大小)

    重新启动并查看更改..

    当您在桌面时,您可以通过登录两个 tty 来测试 plymouth 主题

    在一个 tty 中,运行以下命令

    sudo plymouthd --debug --tty=`tty` --no-daemon
    

    在其他 tty 中,运行以下命令

    sudo plymouth --show-splash
    

    当您运行 --show-splash 时,它会自动切换到其他 tty 并显示 plymouth,退出它.. 打开您运行 --show-splash 命令的其他 tty 并运行以下命令

    sudo plymouth --quit
    

    在此处输入图像描述

    在此处输入图像描述

    您可以配置为不显示固件背景,方法是myplymouththeme.plymouth使用以下行编辑文件UseFirmwareBackground=

    [boot-up]
    UseEndAnimation=false
    UseFirmwareBackground=false
    

    在此处输入图像描述

    编辑:

    似乎根据您的需要调整外部脚本很容易。这是从https://www.cinnamon-look.org/p/1471802/调整的 zip 文件https://github.com/PRATAP-KUMAR/LinkOnly/blob/main/peppermint.zip

    要使用薄荷主题,请保留提取的目录peppermint,/usr/share/plymouth/themes/然后编辑 plymouthd.conf 文件。

    sudo -H gedit /etc/plymouth/plymouthd.conf
    

    有以下内容..

    [Daemon]
    Theme=peppermint
    ShowDelay=0
    

    在此处输入图像描述

    重启..

    在此调整一些东西peppermint.script可能会达到您的要求。

    .script 文件中的示例行

    #--------------------------------------Background functions --------------------------
    
    fun centered_spinner(filename) {
        object.image = Image (filename);
        object.sprite = Sprite ();
        object.sprite.SetImage (object.image);
        object.width = object.image.GetWidth ();
        object.height = object.image.GetHeight ();
        object.x = Window.GetX () + Window.GetWidth () / 2 - object.width  / 2; # Edit to Align as per your requirment
        object.y = Window.GetY () + Window.GetHeight () - object.height / 2 - 100; # Edit to Align as per your requirment
        object.sprite.SetX (object.x);
        object.sprite.SetY (object.y);
    
        return object;
    }
    
    fun centered_logo(filename) {
        object.image = Image (filename);
        object.sprite = Sprite ();
        object.sprite.SetImage (object.image);
        object.width = object.image.GetWidth ();
        object.height = object.image.GetHeight ();
        object.x = Window.GetX () + Window.GetWidth () / 2 - object.width  / 2; # Edit to Align as per your requirment
        object.y = Window.GetY () + Window.GetHeight () - object.height / 2 - 40; # Edit to Align as per your requirment
        object.sprite.SetX (object.x);
        object.sprite.SetY (object.y);
    
        return object;
    }
    

    --

    #Animation settings
    spinner.rot.steps = 8; # steps for 1 full rotation
    spinner.rot.delay = 0.05; # timing in secs
    

    --

    #    Window.SetBackgroundTopColor (rt, gt, bt);                  #gradient - darker at the top of screen
        Window.SetBackgroundTopColor (0, 0, 0);                      #no gradient
        Window.SetBackgroundBottomColor (0, 0, 0);
    

    在此处输入图像描述

    • 4

相关问题

  • 如何在 18.04..20.04 上设置本地通配符 (127.0.0.1) 域解析?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve