cwm - FreeBSD 14.1 RELEASE - 環境構築

 クラウディア
1. 概要
2. インストール
3. SDDM カスタマイズ
4. 初期化ファイル作成
5. /etc/rc.conf 編集
6. ログインマネージャ起動

1. 概要

 下記のデスクトップ環境を構築する手順を記述します。
 種別   リソース・設定   備考 
ホスト Windows11 23H2
仮想環境 VirtualBox 7.0.18
ゲスト FreeBSD 14.1 RELEASE
ログインマネージャ SDDM
仮想システムタイプ BSD
仮想システムバージョン FreeBSD (64bit)
ハードディスク 180 GB
メモリ 4 GB
CPU 2コア
グラフィックスコントローラ VBoxSVGA 128MB 3D Disable

 ここまでの時点で、システムインストールと「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 cwm
 最後の行の「cwm」のインストールは、一瞬で終わります。  バージョンの推移です。 ・2022年 4月11日 「FreeBSD 13.0 RELEASE」 「cwm-6.7」 ・2022年 5月31日 「FreeBSD 13.1 RELEASE」 「cwm-6.7」 ・2022年12月26日 「FreeBSD 12.4 RELEASE」 「cwm-7.1」 ・2023年 4月24日 「FreeBSD 13.2 RELEASE」 「cwm-7.1」 ・2023年12月20日 「FreeBSD 14.0 RELEASE」 「cwm-7.1」 ・2024年 3月 8日 「FreeBSD 13.3 RELEASE」 「cwm-7.4」  2024年6月6日の時点で下記のバージョンでした。

$ pkg info cwm
cwm-7.4_1
Name           : cwm
Version        : 7.4_1
Installed on   : Thu Jun  6 18:07:55 2024 JST
Origin         : x11-wm/cwm
Architecture   : FreeBSD:14:amd64
Prefix         : /usr/local
Categories     : x11-wm
Licenses       : ISCL
Maintainer     : eduardo@FreeBSD.org
WWW            : https://github.com/leahneukirchen/cwm
Comment        : Minimalistic window manager for X11 based on evilwm
Shared Libs required:
        libXrandr.so.2
        libXft.so.2
        libX11.so.6
Annotations    :
        FreeBSD_version: 1400097
        build_timestamp: 2024-04-10T03:08:58+0000
        built_by       : poudriere-git-3.4.1-1-g1e9f97d6
        port_checkout_unclean: no
        port_git_hash  : b3aa1ea86
        ports_top_checkout_unclean: no
        ports_top_git_hash: c5cd82114
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 99.4KiB
Description    :
cwm is a window manager for X11 initially inspired by evilwm. cwm has several
novel features, including the ability to search for windows. it features a
very simple and attractive aesthetic.

3. SDDM カスタマイズ

 ログイン画面の解像度を「1366x768」とし、キーボードレイアウトを「jp.106」にします。  「root」ユーザで

cat << EOF >>  /usr/local/share/sddm/scripts/Xsetup

xrandr --output VGA-0 --mode 1366x768 --rate 60
setxkbmap -layout jp
EOF
 ログイン画面のテーマとカーソルを変更します。  「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. 初期化ファイル作成

 「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

exec cwm
EOF

cat << 'EOF' >> /usr/share/skel/dot.xprofile
#!/bin/sh
#
setxkbmap -layout jp
numlock on
xsetroot -cursor_name left_ptr

/usr/local/bin/VBoxClient-all
EOF
exit

chmod +x /usr/share/skel/dot.xsession
 既存のログインユーザで

cp /usr/share/skel/dot.xsession ~/.xsession
cp /usr/share/skel/dot.xprofile ~/.xprofile

5. /etc/rc.conf 編集

 前項までインストール・設定したものを有効にします。

sysrc dbus_enable=YES
sysrc sddm_enable=YES

6. ログインマネージャ起動

 「root」ユーザで

service dbus start
service sddm start
 うまく設定できていれば、ログイン画面が表示されます。  ユーザ名・パスワードを入力してログインします。
「cwm FreeBSD 14.1」-「ログイン画面」

earthcar(アースカー)
ネットオークションの相場、統計、価格比較といえばオークファン