ここまでの時点で、システムインストールと「VirtualBox Guest Additions」の設定は終わっているものとします。
ぞれぞれのインストール・設定に関しては、
「FreeBSD - デスクトップ環境構築 - 共通事項 - システムインストール」
「FreeBSD - デスクトップ環境構築 - 共通事項 - VirtualBox Guest Additions」
をご参照ください。
2. インストール
「root」ユーザで
pkg install -y xorg ja-font-migmix
pkg install -y sddm sddm-freebsd-black-theme cursor-neutral-white-theme
pkg install -y icewm
バージョンの推移です。
・2020年11月 2日 「1.8.3_1」
・2021年 4月23日 「2.3.1」
・2021年12月24日 「2.7.0」
・2023年 1月 6日 「FreeBSD 12.4 RELEASE」 「2.9.9」
・2023年 5月17日 「FreeBSD 13.2 RELEASE」 「3.3.2」
・2024年 1月25日 「FreeBSD 14.0 RELEASE」 「3.3.4」
2024年3月15日、「FreeBSD 13.3 RELEASE」へインストールした時点で、バージョンは下記のとおりです。
$ icewm --version
IceWM 3.4.5, Copyright 1997-2012 Marko Macek, 2001 Mathias Hasselmann.
3. SDDM カスタマイズ
ログイン画面の解像度を「1366x768」とし、キーボードレイアウトを「jp.106」にします。
「root」ユーザで
sh
cat << 'EOF' >> /usr/local/share/sddm/scripts/Xsetup
xrandr --output VGA-0 --mode 1366x768 --rate 60
setxkbmap -layout jp
EOF
exit
ログイン画面のテーマとカーソルを変更します。
「root」ユーザのまま
sddm --example-config > /usr/local/etc/sddm.conf
vi /usr/local/etc/sddm.conf
[Theme]
# Current theme name
Current=breeze
# Cursor size used in the greeter
CursorSize=
# Cursor theme used in the greeter
CursorTheme=breeze_cursors
を下記へ変更します。
[Theme]
# Current theme name
Current=sddm-freebsd-black-theme
# Cursor size used in the greeter
CursorSize=
# Cursor theme used in the greeter
CursorTheme=Neutral++_White
4. セッションファイル作成
インストール時点で、実は「.desktop」ファイルが作成されています。
/usr/local/share/xsessions/icewm-session.desktop
/usr/local/share/xsessions/icewm.desktop
「FreeBSD 13.1 RELEASE」「icewm 2.9.6」のときは、パスを間違えていたのでログインできませんでしたが、現在は修正されていますので、そのまま使用できます。
5. ユーザ用初期化ファイルの作成
「root」ユーザ権限で。
sh
cat << 'EOF' >> /etc/profile
export LC_ALL="ja_JP.UTF-8"
export LANGUAGE="ja_JP.UTF-8"
export LANG="ja_JP.UTF-8"
EOF
cat << 'EOF' >> /etc/csh.cshrc
setenv LC_ALL "ja_JP.UTF-8"
setenv LANGUAGE "ja_JP.UTF-8"
setenv LANG "ja_JP.UTF-8"
EOF
cat << 'EOF' >> /usr/share/skel/dot.xsession
#!/bin/sh
#
/usr/local/bin/VBoxClient-all
#
setxkbmap -layout jp
numlockx on
EOF
chmod +x /usr/share/skel/dot.xsession
exit
既存のログインユーザで
cp /usr/share/skel/dot.xsession ~/.xsession
6. /etc/rc.conf 編集
「root」ユーザ権限で。
前項までインストール・設定したものを有効にします。
sysrc dbus_enable=YES
sysrc sddm_enable=YES
起動します。
service dbus start
service sddm start
うまく設定できていれば、ログイン画面が表示されます。
「IceWM」と「IceWM Session」があります。
「IceWM Session」の方が、壁紙の面倒までみてくれますので、わたしは「IceWM Session」の方でログインすることにしています。
ユーザ名・パスワードを入力してログインします。