ここまでの時点で、システムインストールと「VirtualBox Guest Additions」の設定は終わっているものとします。
ぞれぞれのインストール・設定に関しては
「FreeBSD - デスクトップ環境構築 - 共通事項 - システムインストール」
「FreeBSD - デスクトップ環境構築 - 共通事項 - VirtualBox Guest Additions」
をご参照ください。
2. インストール
pkg install -y xorg numlockx ja-font-migmix
pkg install -y sddm sddm-freebsd-black-theme cursor-neutral-white-theme
pkg install -y consolekit2 polkit
pkg install -y pekwm
最終行の、「PekWM」のインストールは、一瞬で終わります。
2023年2月10日の時点で、「FreeBSD 12.4 RELEASE」へインストールしたときの「PekWM」のバージョンは、下記の通りでした。
同上時点の「PekWM - Wikipedia」の記事は、少し古いようで、最新リリースが、2020年11月1日のバージョン「0.1.18」とのことですが、これは、バージョン「0.2.0,1」です。
$ pkg info pekwm
pekwm-0.2.0,1
Name : pekwm
Version : 0.2.0,1
Installed on : Thu Feb 9 19:37:23 2023 JST
Origin : x11-wm/pekwm
Architecture : FreeBSD:12:amd64
Prefix : /usr/local
Categories : x11-wm
Licenses : GPLv2
Maintainer : natbsd@instinctive.eu
WWW : https://www.pekwm.se/
Comment : Light, Unobtrusive, and configurable windowmanager
Shared Libs required:
libpng16.so.16
libjpeg.so.8
libfreetype.so.6
libXrandr.so.2
libXpm.so.4
libXinerama.so.1
libXft.so.2
libXext.so.6
libX11.so.6
libSM.so.6
libICE.so.6
Annotations :
FreeBSD_version: 1203000
repo_type : binary
repository : FreeBSD
Flat size : 2.44MiB
Description :
The Pek Window Manager is written by Claes Nasten, the code is based
on the aewm++ window manager, but it has evolved enough that it no
longer resembles aewm++ at all.
It has a much expanded feature-set, including window grouping (similar
to ion, pwm, or fluxbox), autoproperties, xinerama, keygrabber that
supports keychains, and much more.
o Lightweight and Unobtrusive, a window manager shouldn't be noticed.
o Very configurable, we all work and think in different ways.
o Automatic properties, for all the lazy people, make things appear as
they should when starting applications.
o Chainable Keygrabber, usability for everyone.
WWW: https://www.pekwm.se/
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=PekWM
exec pekwm
EOF
chmod +x /usr/share/skel/dot.xinitrc
exit
既存のログインユーザで
cp /usr/share/skel/dot.xinitrc ~/.xinitrc
5. ログインマネージャ起動
前項までインストール・設定したものを有効にします。
「root」ユーザ権限で。
(「polkitd_enable」にしているものの、「polkitd」の起動方法がわからない)
sysrc polkitd_enable=YES
sysrc dbus_enable=YES
sysrc sddm_enable=YES
起動。
service dbus start
service sddm start
うまく設定できていれば、ログイン画面が表示されます。
ユーザ名・パスワードを入力してログインします。