sway - FreeBSD 14.3 RELEASE - 環境構築


 クラウディア


1. 概要
2. インストール
3. SDDM カスタマイズ
4. ユーザ用初期化ファイルの作成
5. ログインマネージャ起動
6. 備考

1. 概要

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

 ここまでの時点で、システムインストールと「VirtualBox Guest Additions」の設定は終わっているものとします。
 ぞれぞれのインストール・設定に関しては

	「FreeBSD - デスクトップ環境構築 - 共通事項 - システムインストール」
	「FreeBSD - デスクトップ環境構築 - 共通事項 - VirtualBox Guest Additions」

 をご参照ください。

2. インストール

 「root」ユーザ権限で。  「XWindow」の環境、「sddm」ログインマネージャ、「polkitd」、「sway」の順にインストールします。

pkg install -y xorg ja-font-migmix numlockx

pkg install -y sddm sddm-freebsd-black-theme cursor-neutral-white-theme

pkg install -y consolekit2 polkit

pkg install -y sway xwayland wf-shell wcm drm-61-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 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

mkdir -pv /usr/share/skel

cat << 'EOF' >> /usr/share/skel/dot.xinitrc
#!/bin/sh

export DESKTOP=sway
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
 うまく設定できていれば、ログイン画面が表示されます。  ユーザ名・パスワードを入力してログインします。

 「FreeBSD 13.5 RELEASE」の途中から「sddm」の起動時に、下記のメッセージが出て、「sddm-freebsd-black-theme」が効かなくなっています。


[10:35:46.135] (II) DAEMON: Loading theme configuration from "/usr/local/share/sddm/themes/sddm-freebsd-black-theme/theme.conf"
[10:35:46.136] (WW) DAEMON: The theme at "/usr/local/share/sddm/themes/sddm-freebsd-black-theme" requires missing "/usr/local/bin/sddm-greeter" . Using fallback theme.

6. 備考

 バージョンの推移です。 ・2022年 3月 9日 「FreeBSD 13.0 RELEASE」 「1.7」 ・2022年 5月31日 「FreeBSD 13.1 RELEASE」 「1.7」 ・2023年 5月25日 「FreeBSD 13.2 RELEASE」 「1.8.1」 ・2024年 2月 1日 「FreeBSD 14.0 RELEASE」 「1.8.1」 ・2024年 4月 1日 「FreeBSD 13.3 RELEASE」 「1.8.1」 ・2024年 6月20日 「FreeBSD 14.1 RELEASE」 「1.9」 ・2024年10月23日 「FreeBSD 13.4 RELEASE」 「1.9」 ・2024年12月25日 「FreeBSD 14.2 RELEASE」 「1.9」 ・2025年 5月20日 「FreeBSD 13.5 RELEASE」 「1.10.1」  2025年5月20日の時点で、下記のバージョンでした。

$ sway --version
sway version 1.11

pkg install -y sway xwayland wf-shell wcm drm-61-kmod wdisplays foot
 インストール時に下記のログが表示されました。  長いですが。一応、メモとして残しておきます。

Generating GTK icon cache for /usr/local/share/icons/hicolor
=====
Message from drm-61-kmod-6.1.128.1403000_5:

--
The drm-61-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.

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.

Please note that this package was built for FreeBSD 14.3.
If this is not your current running version, please rebuild
it from ports to prevent panics when loading the module.
=====
Message from seatd-0.9.1:

--
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

Known issues:
- Garbage on console due to missing K_OFF, see
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272095
=====
Message from pulseaudio-17.0_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.9.0_2:

--
Additional packages recommended for new users:
- wf-shell (default background/launcher/panel)
- wcm (GUI settings)
- wayfire-plugins-extra
=====
Message from sway-1.11:

--
Notes:
- sway(1) can use mac_priority(4) to avoid stutter during high load

AbemaTV 無料体験
ネットオークションの相場、統計、価格比較といえばオークファン
earthcar(アースカー)
薬屋の独り言