ここまでの時点で、システムインストールと「VirtualBox Guest Additions」の設定は終わっているものとします。
ぞれぞれのインストール・設定に関しては、
「FreeBSD - デスクトップ環境構築 - 共通事項 - システムインストール」
「FreeBSD - デスクトップ環境構築 - 共通事項 - VirtualBox Guest Additions」
をご参照ください。
2. インストール
「root」ユーザ権限で。
pkg install -y xorg ja-font-migmix numlockx
pkg install -y sddm sddm-freebsd-black-theme cursor-neutral-white-theme
pkg install -y fvwm3
最後の行の「fvwm」のインストールは、すぐに終わります。
2022年4月11日時点で、「FreeBSD 13.0 RELEASE」へインストールしたとき、2022年6月2日、「FreeBSD 13.0 RELEASE」へインストールしたときは「fvwm3-1.0.4_1」でした。
2023年1月5日の時点で、「fvwm」のバージョンは、下記の通りでした。
$ pkg info fvwm3
fvwm3-1.0.5_1
Name : fvwm3
Version : 1.0.5_1
Installed on : Thu Jan 5 13:35:04 2023 JST
Origin : x11-wm/fvwm3
Architecture : FreeBSD:12:amd64
Prefix : /usr/local
Categories : x11-wm
Licenses : GPLv2
Maintainer : zirias@FreeBSD.org
WWW : https://www.fvwm.org/
Comment : F? Virtual Window Manager
Options :
FRIBIDI : on
GO : on
ICONS : off
ICONV : on
MANPAGES : on
NLS : on
PERL : on
PNG : on
SVG : off
XCURSOR : on
XPM : off
Shared Libs required:
libpng16.so.16
libintl.so.8
libiconv.so.2
libfribidi.so.0
libfreetype.so.6
libfontconfig.so.1
libevent-2.1.so.7
libXrender.so.1
libXrandr.so.2
libXft.so.2
libXext.so.6
libXcursor.so.1
libX11.so.6
libSM.so.6
libICE.so.6
Annotations :
FreeBSD_version: 1203000
cpe : cpe:2.3:a:fvwm:fvwm:1.0.5:::::freebsd12:x64:1
repo_type : binary
repository : FreeBSD
Flat size : 7.79MiB
Description :
Fvwm3 is a multiple large virtual desktop window manager, originally (a
looooong time ago!) derived from twm.
The successor to fvwm2.
Fvwm3 is intended to have a small memory footprint but a rich feature set, be
extremely customizable and extendible, and have a high degree of Motif mwm
compatibility.
WWW: https://www.fvwm.org/
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 theme used in the greeter
CursorTheme=breeze_cursors
を下記へ変更します。
[Theme]
# Current theme name
Current=sddm-freebsd-black-theme
# Cursor theme used in the greeter
CursorTheme=Neutral++_White
4. ユーザ用初期化ファイルの作成
「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.xinitrc
#!/bin/sh
#
/usr/local/bin/VBoxClient-all
#
setxkbmap -layout jp
numlockx on
export DESKTOP=fvwm
exec fvwm3
EOF
chmod +x /usr/share/skel/dot.xinitrc
exit
既存のログインユーザで
cp /usr/share/skel/dot.xinitrc ~/.xinitrc
5. /etc/rc.conf 編集
前項までインストール・設定したものを有効にします。
sysrc dbus_enable=YES
sysrc sddm_enable=YES
6. ログインマネージャ起動
「root」ユーザで
service dbus start
service sddm start
うまく設定できていれば、ログイン画面が表示されます。
ユーザ名・パスワードを入力してログインします。