- 1. 概要
- 2. インストール
- 3. SDDM カスタマイズ
- 4. ユーザ用初期化ファイルの作成
- 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. インストール
「root」ユーザ権限で。
pkg install -y xorg ja-font-migmix numlockx
pkg install -y sddm sddm-freebsd-black-theme cursor-neutral-white-theme
pkg install -y sway xwayland-devel wf-shell wcm drm-fbsd13-kmod wdisplays foot
もしかしたら、末尾の行には、不要なものがあるかもしれません。
備考に末尾のインストール実行時のメッセージとバージョン情報を記録しておきます。
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
mkdir -pv /usr/share/skel
cat << 'EOF' >> /usr/share/skel/dot.xinitrc
#!/bin/sh
LANG=ja_JP.UTF-8
exec sway
EOF
exit
既存のログインユーザで。
cp /usr/share/skel/dot.xinitrc ~/.xinitrc
さらにログインユーザで、「sway」のコンフィグレーションファイルを作成。
mkdir -pv ~/.config/sway/config.d
cp /usr/local/etc/sway/config ~/.config/sway/.
5. ログインマネージャ起動
前項までインストール・設定したものを有効にします。
「root」ユーザ権限で。
sysrc polkitd_enable=YES
sysrc dbus_enable=YES
sysrc sddm_enable=YES
起動します。
service dbus start
service sddm start
うまく設定できていれば、ログイン画面が表示されます。
ユーザ名・パスワードを入力してログインします。
ここで気をつけなければならないのが・・・。
実はログインの選択肢に「SWay(Wayland)」「Wayfire(Wayland)」(「sway」をインストールするとインストールされるようです)「User Session」の3つがあります。
上の2つは、ログインに失敗するので、「User Session」でログインします。

6. 備考
pkg install -y xwayland sway wf-shell wcm drm-fbsd13-kmod wdisplays
インストール時に下記のログが表示されました。
Message from trousers-0.3.14_3:
--
To run tcsd automatically, add the following line to /etc/rc.conf:
tcsd_enable="YES"
You might want to edit /usr/local/etc/tcsd.conf to reflect your setup.
If you want to use tcsd with software TPM emulator, use the following
configuration in /etc/rc.conf:
tcsd_enable="YES"
tcsd_mode="emulator"
tpmd_enable="YES"
To use TPM, add your_account to '_tss' group like following:
# pw groupmod _tss -m your_account
=====
Message from seatd-0.6.4:
--
libseat is used to get DRM master and input devices for non-root users.
On Wayland this is only necessary when starting a compositor under KMS
console (e.g., /dev/ttyv0 backed by /dev/dri/card0). Nested sessions like
"Wayland on X11" or "Wayland on Wayland" don't need extra configuration.
By default libseat tries to find the first working backend. To override
set LIBSEAT_BACKEND via environ(7). Available backends and try order:
* "seatd" - seatd-launch(1) or seatd rc.d(8) service
* "consolekit2" - ck-launch-session(1) or pam_ck_connector(8)
"seatd" backend requires membership in "video" group to be allowed to
use setuid bit in seatd-launch(1) or connect to seatd(1) socket.
# pw groupmod video -m <user>
$ exit # log out to refresh group permissions
For example, to start a wlroots-based compositor replace "sway" with
your compositor (e.g., "hikari", "wayfire", "labwc", "river") then run
$ seatd-launch sway
Alternatively, configure and run seatd(1) as system service
# sysrc seatd_enable=YES
# service seatd start
$ sway
To use ConsoleKit2 run
# pkg install consolekit2 basu
# sysrc -x seatd_enable
# service seatd stop
# sysrc dbus_enable=YES
# service dbus start
$ ck-launch-session sway
where "ck-launch-session" can be dropped after
# echo "session optional pam_ck_connector.so" >>/etc/pam.d/system
$ exit # log out to re-trigger PAM
=====
Message from wlroots-0.15.1:
--
Known issues:
- NVIDIA option (aka wlroots-eglstreams) requires nvidia-drm.ko from nvidia-driver,
see https://github.com/aritger/eglstreams-kms-example/issues/7
=====
Message from libinotify-20211018:
--
You might want to consider increasing the kern.maxfiles tunable if you plan
to use this library for applications that need to monitor activity of a lot
of files.
=====
Message from pulseaudio-14.2_3:
--
Pulseaudio tries to determine default values for FreeBSD OSS driver at first
start, based on /dev/sndstat output. The hw.snd.default_unit sysctl may affect
these values, but restart of the Pulseaudio might be needed to rescan it again,
e.g. 'pacmd exit'.
Pulseaudio has separate input and output configure lines. You can change them
with using following commands:
To change the default sink (output):
# pacmd set-default-sink 3
To change the default source (input):
# pacmd set-default-source 3
This can also be set in /usr/local/etc/pulse/default.pa
Replace the number '3' with the new default you want to set.
The audio/freedesktop-sound-theme is needed if the default sound files
are uncommented in the /usr/local/etc/pulse/default.pa file.
=====
Message from wayfire-0.7.3:
--
Additional packages recommended for new users:
- wf-shell (default background/launcher/panel)
- wcm (GUI settings)
- wayfire-plugins-extra
Experimental features:
- HiDPI support for X11 applications. For instructions see
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2064#note_1139855
Instead of ~/.config/sway/config edit ~/.config/wayfire.ini either via
wcm (General -> Core -> XWayland scale + General -> Autostart) or manually:
[core]
xwayland_scale = 2
[autostart]
xsettingsd = xsettingsd
=====
Message from sway-1.7:
--
Experimental features:
- HiDPI support for X11 applications. For instructions see
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2064#note_1139855
=====
Message from drm-fbsd13-kmod-5.4.144.g20220223:
--
The drm-fbsd13-kmod port can be enabled for amdgpu (for AMD GPUs starting
with the HD7000 series / Tahiti) or i915kms (for Intel APUs starting with
HD3000 / Sandy Bridge) through kld_list in /etc/rc.conf. radeonkms for older
AMD GPUs can be loaded and there are some positive reports if EFI boot is NOT
enabled (similar to amdgpu).
For amdgpu: kld_list="amdgpu"
For Intel: kld_list="i915kms"
For radeonkms: kld_list="radeonkms"
Please ensure that all users requiring graphics are members of the
"video" group.
=====
Message from foot-1.11.0:
--
Some features require adjusting termcap(5) e.g.,
$ export TERMCAP="${TERM}:bw:hs:ds=\E]2;\E\\:fs=\E\\:kb=\177:ts=\E]2;:vb=\E]555\E\\:tc=${TERM}:"
or providing a separate entry for "foot --term=foot" e.g.,
$ cat >>/etc/termcap
foot|foot terminal emulator:\
:bw:hs:\
:it#8:\
:IC=\E[%d@:K2@:SF=\E[%dS:SR=\E[%dT:bt=\E[Z:ds=\E]2;\E\\:\
:ec=\E[%dX:fs=\E\\:kb=\177:mb=\E[5m:me=\E[0m:mh=\E[2m:nw@:\
:te=\E[?1049l\E[23;0;0t:ti=\E[?1049h\E[22;0;0t:\
:ts=\E]2;:vb=\E]555\E\\:tc=xterm-256color:
2022年3月 9日時点で、「FreeBSD 3.0 RELEASE」へインストールしたときは「sway-1.7」でした。
2022年5月31日時点で、「FreeBSD 3.1 RELEASE」へインストールしたときは、下記の通りでした。
さすがに、時間がたっていないので、変化ありませんね。
$ pkg info sway
sway-1.7
Name : sway
Version : 1.7
Installed on : Tue May 31 19:29:18 2022 JST
Origin : x11-wm/sway
Architecture : FreeBSD:13:amd64
Prefix : /usr/local
Categories : x11-wm
Licenses : MIT
Maintainer : jbeich@FreeBSD.org
WWW : https://swaywm.org/
Comment : i3-compatible Wayland compositor
Options :
BASU : on
MANPAGES : on
PIXBUF : on
X11 : on
Shared Libs required:
libpcre.so.1
libglib-2.0.so.0
libgobject-2.0.so.0
libpango-1.0.so.0
libudev.so.0
libpixman-1.so.0
libwayland-client.so.0
libinput.so.10
libcairo.so.2
libjson-c.so.5
libevdev.so.2
libbasu.so.0
libwayland-server.so.0
libxkbcommon.so.0
libwlroots.so.10
libxcb.so.1
libgdk_pixbuf-2.0.so.0
libGLESv2.so.2
libwayland-cursor.so.0
libpangocairo-1.0.so.0
Annotations :
FreeBSD_version: 1300139
repo_type : binary
repository : FreeBSD
Flat size : 5.54MiB
Description :
Sway is a tiling Wayland compositor and a drop-in replacement for the
i3 window manager for X11. It works with your existing i3 configuration
and supports most of i3's features, plus a few extras.
WWW: https://swaywm.org/
|