設定 - GDM
概要
GDMは、グラフィカルログインおよびユーザ認証を提供するディスプレイマネージャである。
ディスプレイマネージャは、ユーザにログイン画面を表示して、ユーザがユーザ名とパスワードの有効な組み合わせを正常に入力する時、セッションが開始される。
GDMの他に、XDM、SDDM、LightDM等のディスプレイマネージャが存在する。
ここでは、最新のGDM3について記載する。
GDMの設定
ログイン画面の背景画像
※注意
GNOME 3.16からGNOME Shellのテーマは、バイナリ形式のファイル(gresource)に保存される。
また、GNOME Shellがアップデートされた場合、当変更が元の設定に戻ることに注意すること。
まず、既存のGNOME Shellテーマを、ホームディレクトリ等に抽出する。
vi ~/Extract.sh
#!/usr/bin/env sh
gst=/usr/share/gnome-shell/gnome-shell-theme.gresource
workdir=${HOME}/shell-theme
for r in `gresource list $gst`; do
r=${r#\/org\/gnome\/shell/}
if [ ! -d $workdir/${r%/*} ]; then
mkdir -p $workdir/${r%/*}
fi
done
for r in `gresource list $gst`; do
gresource extract $gst $r >$workdir/${r#\/org\/gnome\/shell/}
done
上記のシェルスクリプトに実行権限を付加して、実行する。
chmod u+x ~/Extract.sh ~/Extract.sh
ディレクトリが生成されるので、そのディレクトリに移動する。(抽出されたテーマファイルが存在する)
生成されたディレクトリのトップディレクトリに、任意の背景画像をコピーする。
次に、生成されたディレクトリのトップディレクトリに、以下の内容のファイルを作成する。
<背景画像のファイル名>には、使用する背景画像のファイル名に置き換えること。
vi gnome-shell-theme.gresource.xml
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/shell/theme">
<file>calendar-arrow-left.svg</file>
<file>calendar-arrow-right.svg</file>
<file>calendar-today.svg</file>
<file>checkbox-focused.svg</file>
<file>checkbox-off-focused.svg</file>
<file>checkbox-off.svg</file>
<file>checkbox.svg</file>
<file>close.svg</file>
<file>close-window-active.svg</file>
<file>close-window-hover.svg</file>
<file>close-window.svg</file>
<file>corner-ripple-ltr.png</file>
<file>corner-ripple-rtl.png</file>
<file>dash-placeholder.svg</file>
<file>filter-selected-ltr.svg</file>
<file>filter-selected-rtl.svg</file>
<file>gnome-shell.css</file>
<file>gnome-shell-high-contrast.css</file>
<file>icons/message-indicator-symbolic.svg</file>
<file>key-enter.svg</file>
<file>key-hide.svg</file>
<file>key-layout.svg</file>
<file>key-shift-latched-uppercase.svg</file>
<file>key-shift.svg</file>
<file>key-shift-uppercase.svg</file>
<file>logged-in-indicator.svg</file>
<file>no-events.svg</file>
<file>no-notifications.svg</file>
<file><背景画像のファイル名></file>
<file>pad-osd.css</file>
<file>page-indicator-active.svg</file>
<file>page-indicator-checked.svg</file>
<file>page-indicator-hover.svg</file>
<file>page-indicator-inactive.svg</file>
<file>process-working.svg</file>
<file>running-indicator.svg</file>
<file>source-button-border.svg</file>
<file>summary-counter.svg</file>
<file>toggle-off-hc.svg</file>
<file>toggle-off-intl.svg</file>
<file>toggle-off-us.svg</file>
<file>toggle-on-hc.svg</file>
<file>toggle-on-intl.svg</file>
<file>toggle-on-us.svg</file>
<file>ws-switch-arrow-down.png</file>
<file>ws-switch-arrow-up.png</file>
</gresource>
</gresources>
次に、生成されたディレクトリ内にあるgnome-shell.cssファイルを開いて、#lockDialogGroupの定義を以下のように変更する。
background-size
は、GDMが使用する解像度に設定する。
これは、必ずしも画像の解像度である必要はない。
#lockDialogGroup {
background: #2e3436 url(<背景画像のファイル名>);
background-size: <GDMが使用する解像度の横ピクセル数>px <GDMが使用する解像度の縦のピクセル数>px;
background-repeat: no-repeat;
}
最後に、テーマをコンパイルする。
glib-compile-resources gnome-shell-theme.gresource.xml
生成されたgnome-shell-theme.gresourceファイルを、/usr/share/gnome-shellディレクトリにコピーする。
sudo cp gnome-shell-theme.gresource /usr/share/gnome-shell
GDMを再起動して、背景画像が変更されているかどうかを確認する。
ログアウトでは変更されないことに注意する。
※備考
デスクトップ環境によっては、~/.config/monitors.xmlに表示設定を保存している。
GDMにも同様のファイルが、/var/lib/gdm/.config/monitors.xmlに格納されている。
もし、~/.config/monitors.xmlファイルの設定(解像度、リフレッシュレート、向き、スケーリング、プライマリ等)をGDMで使用する場合は、以下のように設定する。
sudo cp ~/.config/monitors.xml /var/lib/gdm3/.config/ sudo chown gdm:gdm /var/lib/gdm/.config/monitors.xml
例えば、monitors.xmlファイルにおいて、画面の回転と拡大縮小に関連する部分は、以下の通りである。
<monitors version="2">
<configuration>
<logicalmonitor>
...
<scale>2</scale>
...
<transform>
<rotation>right</rotation>
<flipped>no</flipped>
</transform>
...
</logicalmonitor>
</configuration>
</monitors>
設定を有効化するには、PCを再起動、または、ログアウトする。