更改登录屏幕的背景

我安装了Ubuntu Studio 15.10,然后:

sudo apt-get install ubuntu-desktop 

现在在登录屏幕上,我有默认的褐色Ubuntu默认背景。

  • 我以root身份尝试了这个:

     sudo xhost +SI:localuser:lightdm sudo su lightdm -s /bin/bash gsettings set com.canonical.unity-greeter background /usr/share/backgrounds/Tranquil_by_Pat_David.jpg 

    但这并没有改变任何事情。

  • 同时以用户lightdm启动unity-control-center并更改背景也没有效果。

  • 我还检查了/usr/share/backgrounds/Tranquil_by_Pat_David.jpg的全局可读权限。

更改默认的unity-greeter背景的正确方法是重写glib-2.0模式,如Lightdm Ubuntu Wiki中所指定的

步骤如下:

  1. 使用以下内容创建/usr/share/glib-2.0/schemas/10_unity_greeter_background.gschema.override文件:

     [com.canonical.unity-greeter] draw-user-backgrounds=false background='/foo/wallpaper.png' 
  2. 运行sudo glib-compile-schemas /usr/share/glib-2.0/schemas

  3. 重启或登录TTY2(通过按Ctrl + Alt + F2访问)并运行sudo service lightdm restart

这已在我的Ubuntu 14.04上测试过

更新:2015年11月17日

我已经整理了一个脚本,简化了更改欢迎背景的过程。 它已经在最终forms上测试了两个版本的Ubuntu,14.04 LTS(实际物理机)和15.10(虚拟机)它可以在我的GitHub中找到

似乎所有的gsettings在Ubuntu 15.10中都没有效果,(可能是因为我首先使用xfce4安装了Ubuntu Studio)。

我通过将此行添加到/etc/lightdm/lightdm-gtk-greeter.conf来解决它:

 background=/usr/share/backgrounds/Tranquil_by_Pat_David.jpg 

或者在一个sudo命令中:

 sudo su -c 'echo "background=/usr/share/backgrounds/Tranquil_by_Pat_David.jpg">>/etc/lightdm/lightdm-gtk-greeter.conf' 

非编码方式是使用Ubuntu Tweak。 仍然可以按照本答案中列出的方法使用。