ここまでの時点で、システムインストールと「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 icewm
2020年11月 2日に「FreeBSD 12.2 RELEASE 」へインストールした時点で、バージョンは「icewm-1.8.3_1」でした。
2021年 4月23日に「FreeBSD 13.0 RELEASE」へインストールした時点で、バージョンは「icewm-2.3.1」でした。
2021年12月24日に「FreeBSD 12.3 RELEASE」へインストールした時点で、バージョンは、「icewm-2.7.0」でした。
2022年6月3日に「FreeBSD 12.3 RELEASE」へインストールした時点で、バージョンは下記のとおりでした。
頻繁にメンテナンスされているようです。
老舗にはいる部類であるかと思うのに、すごいです。
$ pkg info icewm
icewm-2.9.6
Name : icewm
Version : 2.9.6
Installed on : Fri Jun 3 10:37:39 2022 JST
Origin : x11-wm/icewm
Architecture : FreeBSD:13:amd64
Prefix : /usr/local
Categories : x11-wm
Licenses : LGPL20
Maintainer : portmaster@bsdforge.com
WWW : https://ice-wm.org/
Comment : Window manager designed for speed and usability
Options :
BEASTIE : on
DOCS : on
IMLIB2 : on
NLS : on
SVG : off
XFT : on
XINERAMA : on
XRANDR : on
Shared Libs required:
libXpm.so.4
libglib-2.0.so.0
libgobject-2.0.so.0
libXrender.so.1
libfreetype.so.6
libfribidi.so.0
libX11.so.6
libXext.so.6
libXdamage.so.1
libICE.so.6
libsndfile.so.1
libXft.so.2
libintl.so.8
libSM.so.6
libXrandr.so.2
libiconv.so.2
libfontconfig.so.1
libImlib2.so.1
libXcomposite.so.1
libgio-2.0.so.0
libXinerama.so.1
libXfixes.so.3
Annotations :
FreeBSD_version: 1300139
repo_type : binary
repository : FreeBSD
Flat size : 5.46MiB
Description :
IceWM is a window manager for the X Window System. The goal of IceWM
is speed, simplicity, and not getting in the user's way. It comes with
a taskbar with pager, global and per-window keybindings, a dynamic menu
system, a simple session manager, and a system tray. It is standards
compliant, very configurable, themeable, and well documented.
WWW: https://ice-wm.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. セッションファイル
インストール時点で、実は「.desktop」ファイルが作成されています。
/usr/local/share/xsessions/icewm-session.desktop
/usr/local/share/xsessions/icewm.desktop
しかし、残念ながら、パスがとおっていないので、「SDDM」のログイン候補に表示されません。
馬鹿な話であります。
はなから作るか、パスのあるところにシンボリックリンクをはるか、ちと考えましたが、結局、セッションファイルを編集することにしました。
「icewm-session.desktop」の方でないと、壁紙の面倒まで見てくれませんので、そちらを編集します。
「root」ユーザ権限で。
vi /usr/local/share/xsessions/icewm-session.desktop
Icon=icewm
TryExec=/usr/bin/icewm-session
Exec=/usr/bin/icewm-session
NoDisplay=false
62、63行の「/usr/bin/icewm-session」を「icewm-session」へ変更します。
「/usr/local/bin/icewm-session」と書こうかとも思ったのですが。
「FreeBSD」の場合、通常
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
までは、パスが通っていますからね。
しかし、「IceWM」を移植なさった方は、なんで、わざわざ、間違った方へ書いちゃったんでしょうね。
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. ログインマネージャ起動
「root」ユーザ権限で。
前項までインストール・設定したものを有効にします。
sysrc dbus_enable=YES
sysrc sddm_enable=YES
起動します。
service dbus start
service sddm start
うまく設定できていれば、ログイン画面が表示されます。
ユーザ名・パスワードを入力してログインします。