spectrwm - FreeBSD 13.1 - 環境構築

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

1. 概要

 下記のデスクトップ環境を構築する手順を記述します。
 種別   リソース・設定   備考 
ホスト Windows10 21H2
仮想環境 VirtualBox 6.1.34
ゲスト FreeBSD 13.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. インストール


pkg install -y xorg numlockx ja-font-migmix
pkg install -y sddm sddm-freebsd-black-theme cursor-neutral-white-theme
pkg install -y spectrwm
 2020年 9月 4日「FreeBSD 11.4 RELEASE」へインストールしたとき、「spectrwm-3.4.1」でした。  2020年11月18日「FreeBSD 12.2 RELEASE」へインストールしたとき、「spectrwm-3.4.1」でした。  2021年 7月 5日「FreeBSD 13.0 RELEASE」へインストールしたとき、「spectrwm-3.4.1」でした。  2022年 1月 6日「FreeBSD 12.3 RELEASE」へインストールしたとき、「spectrwm-3.4.1」でした。  2022年5月30日の時点で、下記のバージョンでした。  メンテナンスされていないのかしら?

$ pkg info spectrwm
spectrwm-3.4.1
Name           : spectrwm
Version        : 3.4.1
Installed on   : Mon May 30 11:18:37 2022 JST
Origin         : x11-wm/spectrwm
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : x11-wm
Licenses       : ISCL
Maintainer     : zeising@FreeBSD.org
WWW            : https://github.com/conformal/spectrwm
Comment        : Small, dynamic tiling window manager for X11
Options        :
        EXAMPLES       : on
Shared Libs required:
        libxcb-util.so.1
        libX11-xcb.so.1
        libX11.so.6
        libXft.so.2
        libXcursor.so.1
        libxcb-icccm.so.4
        libxcb-randr.so.0
        libxcb.so.1
        libxcb-xtest.so.0
        libxcb-keysyms.so.1
        libxcb-xinput.so.0
Annotations    :
        FreeBSD_version: 1300139
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 224KiB
Description    :
Spectrwm (previously known as scrotwm) is a small dynamic tiling window
manager for X11.  It tries to stay out of the way so that valuable screen
real estate can be used for much more important stuff.  It has sane
defaults and does not require one to learn a language to do any
configuration.  It was written by hackers for hackers and it strives to be
small, compact and fast.

It was largely inspired by xmonad and dwm.  Both are fine products but suffer
from things like: crazy-unportable-language-syndrome, silly defaults,
asymmetrical window layout, "how hard can it be?" and good old NIH.
Nevertheless dwm was a phenomenal resource and many good ideas and code was
borrowed from it.  On the other hand xmonad has great defaults, key bindings
and xinerama support but is crippled by not being written in C.

WWW: https://github.com/conformal/spectrwm

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 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 ファイルの作成

 ログイン時に有効となるよう、「.desktop」ファイルを作成します。  「root」ユーザ権限で。

mkdir -pv /usr/local/share/xsessions

sh
cat << 'EOF' >> /usr/local/share/xsessions/spectrwm.desktop
[Desktop Entry]
Name=spectrwm
Comment=A lightweight window manager for the X Windowing System
Exec=spectrwm
Terminal=false
TryExec=spectrwm
Type=Application
EOF
exit

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
exit

sh
cat << 'EOF' >> /usr/share/skel/dot.xsession
#!/bin/sh
#
setxkbmap -layout jp
numlockx on
/usr/local/bin/VBoxClient-all
EOF
exit

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

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

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

 前項までインストール・設定したものを有効にします。  「root」ユーザ権限で。

sysrc polkitd_enable=YES
sysrc dbus_enable=YES
sysrc sddm_enable=YES
 起動します。

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

earthcar(アースカー)
Star Naming Gift