ここまでの時点で、システムインストールと「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 herbstluftwm bash
「herbstluftwm」は、「bash」がないと動きません。
インストール時のメッセージに書いてあります。
Message from herbstluftwm-0.9.4:
--
You need to specify your own autostart file with -c or place it in this path:
/usr/local/etc/xdg/etc/xdg/herbstluftwm/autostart
Keep in mind that most of the scripts are written in bash syntax.
2020年9月4日「FreeBSD 11.4 RELEASE」へのインストール時、2020年11月17日「FreeBSD 12.2 RELEASE」へのインストール時が「0.8.3」でした。
2021年6月29日「FreeBSD 13.0 RELEASE」へインストール時、2021年12月24日「FreeBSD 12.2 RELEASE」へのインストール時が「0.9.2」でした。
2022年5月26日「FreeBSD 13.1 RELEASE」のインストール時は、下記のバージョンでした。
$ pkg info herbstluftwm
herbstluftwm-0.9.4
Name : herbstluftwm
Version : 0.9.4
Installed on : Thu May 26 18:06:20 2022 JST
Origin : x11-wm/herbstluftwm
Architecture : FreeBSD:13:amd64
Prefix : /usr/local
Categories : x11-wm
Licenses : BSD2CLAUSE
Maintainer : uzsolt@uzsolt.hu
WWW : http://herbstluftwm.org/
Comment : Manual tiling window manager for X11
Options :
DOCS : on
EXAMPLES : on
Shared Libs required:
libX11.so.6
libXrender.so.1
libXrandr.so.2
libfreetype.so.6
libXext.so.6
libXft.so.2
libXinerama.so.1
libXfixes.so.3
Annotations :
FreeBSD_version: 1300139
repo_type : binary
repository : FreeBSD
Flat size : 1.97MiB
Description :
herbstluftwm is a manual tiling window manager for X11 using Xlib and Glib.
Its main features can be described with:
- The layout is based on splitting frames into subframes which can be
split again or can be filled with windows (similar to i3 or musca)
- Tags (or workspaces, or virtual desktops) can be added/removed at
runtime. Each tag contains an own layout
- Exactly one tag is viewed on each monitor. The tags are monitor
independent (similar to xmonad)
- It is configured at runtime via IPC calls from herbstclient. So the
configuration file is just a script which is run on startup. (Similar
to wmii or musca)
WWW: http://herbstluftwm.org/
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. 初期化ファイル作成
他のタイル型デスクトップと異なり、「herbstluftwm」は、インストール時点で
/usr/local/share/xsessions/herbstluftwm.desktop
が作成されています。
「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 &
/usr/local/bin/VBoxClient-all
EOF
exit
chmod +x /usr/share/skel/dot.xsession
「EOF」の前の行は、「VirtualBox」の「Client」でのみの設定です。
既存のログインユーザで、まず、セッション開始の手順をスケルトンよりコピー。
cp /usr/share/skel/dot.xsession ~/.xsession
ログインユーザ用の起動時のスクリプトをシステムファイルからコピーします。
ログインユーザで。
mkdir -pv ~/.config/herbstluftwm/
cp /usr/local/etc/xdg/herbstluftwm/* ~/.config/herbstluftwm/.
5. ログインマネージャ起動
前項までインストール・設定したものを有効にします。
「root」ユーザ権限で。
sysrc polkitd_enable=YES
sysrc dbus_enable=YES
sysrc sddm_enable=YES
起動します。
service dbus start
service sddm start
うまく設定できていれば、ログイン画面が表示されます。
ユーザ名・パスワードを入力してログインします。