萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 作業系統 >  >> Linux 教學

Ubuntu 更換登入畫面背景圖片完整教學 (dconf-editor + lightdm)

厭倦 Ubuntu 預設登入背景?透過 dconf-editor 修改 lightdm 使用者的 unity-greeter 設定,即可使用任意個人圖片作為登入背景。本文提供完整步驟與圖形化操作指引。

dconf-editor 設定介面

前置準備

  1. 安裝 dconf-editor:
    sudo apt-get install dconf-editor
  2. 準備背景圖片,記下**絕對路徑** (如 /home/user/Pictures/login_bg.jpg)

操作步驟

1. 切換至 root 並授權 lightdm 存取 X Server


sudo -i
xhost +SI:localuser:lightdm

2. 切換至 lightdm 使用者啟動 dconf-editor


su lightdm -s /bin/bash
dconf-editor

3. 修改 unity-greeter 背景設定

在 dconf-editor 左側樹狀結構導航至:


com → canonical → unity-greeter

右側修改以下鍵值:

  • background:輸入圖片絕對路徑 (如 /home/user/Pictures/login_bg.jpg)
  • draw-grid:取消勾選 (關閉網格線,背景更純淨)

修改後的登入畫面

4. 重開機驗證


reboot

常見問題排查

問題解決
背景不顯示/顯示錯誤圖示確認路徑正確、檔案權限可讀 (lightdm 需讀取權限)、格式支援 (JPG/PNG)
dconf-editor 找不到 unity-greeterUbuntu 版本差異:新版可能用 com.ubuntu.unity-greeter 或 com.canonical.unity-greeter
權限錯誤確保 xhost +SI:localuser:lightdm 在 root 下執行成功

替代方案:直接編輯設定檔 (無需 dconf-editor)


sudo vim /etc/lightdm/lightdm-gtk-greeter.conf
# [greeter]
# background=/home/user/Pictures/login_bg.jpg

適用於 LightDM GTK Greeter (Xubuntu、Lubuntu 等),Unity Greeter 請用 dconf 方式。

進階:動態輪播背景

編寫腳本定期修改 dconf 鍵值並重啟 lightdm,或使用 variety 等工具管理輪播。

幾分鐘設定,讓每次開機登入都能看到心儀畫面,心情大好開啟工作一天。

copyright © 萬盛學電腦網 all rights reserved