0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

gnome のデフォルトデスクトップ壁紙を変更する

Last updated at Posted at 2024-07-01

壁紙を変えるのは Gnome 設定の外観で変更するのだけれど、
image.png

非設定のユーザに適用される壁紙だとか、新規ユーザだとかの壁紙を変えるにはどうしたらいいかな?

いろんな情報を試したけれど全然うまくいかないので、調べてみました。

環境

  • Debian 12.5 Gnome デスクトップ

gnome の Debian メタパッケージをリバースエンジニアリング

Debian の Gnome パッケージはこれかな?

# dpkg-deb -I task-gnome-desktop_3.75_all.deb     
 new Debian package, version 2.0.
 size 1184 bytes: control archive=660 bytes.
     650 bytes,    14 lines      control
      81 bytes,     1 lines      md5sums
 Package: task-gnome-desktop
 Source: tasksel
 Version: 3.75
 Architecture: all
 Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
 Installed-Size: 9
 Depends: tasksel (= 3.75), task-desktop, gnome-core
 Recommends: gnome, synaptic, libreoffice-gnome, libreoffice-writer, libreoffice-calc, libreoffice-impress, libreoffice-help-en-us, mythes-en-us, hunspell-en-us, hyphen-en-us, network-manager-gnome
 Section: tasks
 Priority: optional
 Description: GNOME
  This task package is used to install the Debian desktop, featuring
  the GNOME desktop environment, and with other packages that Debian users
  expect to have available on the desktop.

これを設定してインストールされるものは以下の通り。

  • Depends:
    • tasksel (= 3.75)
    • task-desktop
    • gnome-core
  • Recommends:
    • gnome
    • synaptic
    • libreoffice-gnome
    • libreoffice-writer,
    • libreoffice-calc
    • libreoffice-impress
    • libreoffice-help-en-us
    • mythes-en-us
    • hunspell-en-us
    • hyphen-en-us
    • network-manager-gnome

これらのうちのどれかにデフォルト壁紙設定があるのだろう。

gnome はこれかな。
https://packages.debian.org/bookworm/gnome

gnome-core はこれ。、
https://packages.debian.org/bookworm/gnome-core

emerard theme

パッケージ情報からたどっていくと、ここに行き着いた。

emerard-theme が、デフォルトの壁紙が設定されているテーマらしい。

それが設定されているファイルを探すと以下があった。

/usr/share/desktop-base/active-theme/wallpaper/gnome-background.xml 

中身がこのようになっていました。

<background>
  <static>
    <duration>8640000.0</duration>
    <file>
      <size width="1280" height="800">/usr/share/desktop-base/emerald-theme/wallpaper/contents/images/1280x800.svg</size>
      <size width="1280" height="1024">/usr/share/desktop-base/emerald-theme/wallpaper/contents/images/1280x1024.svg</size>
      <size width="1600" height="1200">/usr/share/desktop-base/emerald-theme/wallpaper/contents/images/1600x1200.svg</size>
      <size width="1920" height="1080">/usr/share/desktop-base/emerald-theme/wallpaper/contents/images/1920x1080.svg</size>
      <size width="1920" height="1200">/usr/share/desktop-base/emerald-theme/wallpaper/contents/images/1920x1200.svg</size>
      <size width="2560" height="1440">/usr/share/desktop-base/emerald-theme/wallpaper/contents/images/2560x1440.svg</size>
      <size width="2560" height="1600">/usr/share/desktop-base/emerald-theme/wallpaper/contents/images/2560x1600.svg</size>
      <size width="3200" height="1800">/usr/share/desktop-base/emerald-theme/wallpaper/contents/images/3200x1800.svg</size>
      <size width="3200" height="2000">/usr/share/desktop-base/emerald-theme/wallpaper/contents/images/3200x2000.svg</size>
      <size width="3840" height="2160">/usr/share/desktop-base/emerald-theme/wallpaper/contents/images/3840x2160.svg</size>
      <size width="5120" height="2880">/usr/share/desktop-base/emerald-theme/wallpaper/contents/images/5120x2880.svg</size>
    </file>
  </static>
</background>

設定変更

/usr/share/desktop-base/active-theme は実際には以下のようにリンクになっている。


lrwxrwxrwx   1 root root   31 Jun 30 14:32 active-theme -> /etc/alternatives/desktop-theme

それじゃ /etc/alternatives/desktop-theme は何かというと

lrwxrwxrwx 1 root root 37 Jun 30 14:32 /etc/alternatives/desktop-theme -> /usr/share/desktop-base/emerald-theme

結局一回りして /usr/share/desktop-base の中のコンテンツになります。

/etc/alternatives/desktop-theme の実体は /usr/share/desktop-base/emerald-theme/ となっていますが、これを別のテーマにリンクしたらどうなるかな?

# rm /etc/alternatives/desktop-theme
# ln -s /usr/share/desktop-base/joy-theme /etc/alternatives/desktop-theme

壁紙が変わりました。

image.png

独自の壁紙テーマを作る

/usr/share/desktop-base/cosmicray-theme を適当なテーマからコピーして作ることにします。

解像度をたくさん用意するのはメンドクサイので、調べたら以下の代表2つぐらいに簡略化しても大丈夫ぽいです。

<background>
  <static>
    <duration>8640000.0</duration>
    <file>
      <size width="1280" height="1024">/usr/share/desktop-base/cosmicray-theme/wallpaper/contents/images/1280x1024.svg</size>
      <size width="1920" height="1080">/usr/share/desktop-base/cosmicray-theme/wallpaper/contents/images/1920x1080.svg</size>
    </file>
  </static>
</background>

うまくいきました。

image.png

以下はいろいろ試したけれどダメだった例。

gdm-tools で設定しようとしましたがうまくいきませんでした。

$ git clone --depth=1 https://github.com/realmazharhussain/gdm-tools.git
$ cd gdm-tools
$ set-gdm-theme backup update
$ set-gdm-theme list
$ set-gdm-theme set -b /usr/share/backgrounds/wallpaper01.jpg

再起動したけれども、変更は反映されませんでした。

以下も試してみましたがうまくいきませんでした。
https://zacks.eu/gnome-customization-on-debian-complete-guide/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?