sway - FreeBSD 13.3 RELEASE - 環境構築

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

1. 概要

 「FreeBSD 12.4 RELEASE」の「sway」では、「jgmenu」も「OctoPkg」も起動てきませんでした。  なので「FreeBSD 12.4 RELEASE」では、記事は書きませんでした。  「FreeBSD 13.3 RELEASE」では、正常に動くのか、気がかりですが、やってみます。  下記のデスクトップ環境を構築する手順を記述します。
 種別   リソース・設定   備考 
ホスト Windows11 23H2
仮想環境 VirtualBox 7.0.14
ゲスト FreeBSD 13.3 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」ユーザ権限で。  「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-devel wf-shell wcm drm-510-kmod wdisplays foot
 「FreeBSD 13.2 RELEASE」のときにうまくいった組み合わせにしています。  備考に末尾のインストール実行時のメッセージとバージョン情報を記録しておきます。

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
 うまく設定できていれば、ログイン画面が表示されます。  ユーザ名・パスワードを入力してログインします。  ここで気をつけなければならないのが・・・。  以前はログインの選択肢に「SWay(Wayland)」「Wayfire(Wayland)」(「sway」をインストールするとインストールされるようです)「User Session」の3つがありました。  結局、上の2つは、ログインに失敗するので、「User Session」でログインしていたのですが。  今回は、「User Session」のみになりました。
「sway FreeBSD 13.3」-「ログイン画面」

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日の時点で、下記のバージョンでした。

$ sway --version
sway version 1.8.1

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

Message from libthai-0.1.29:

--
===>   NOTICE:

The libthai port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing
=====
Message from seatd-0.8.0:

--
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 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-16.1_1:

--
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.8.0_2:

--
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.8.1_2:

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

Experimental features:
- HiDPI support for X11 applications. For instructions see
  https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2064#note_1139855
=====
Message from foot-1.16.2_1:

--
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@:\
        :is=\E[!p\E[4l\E>:rs=\E[!p\E[4l\E>:\
        :te=\E[?1049l\E[23;0;0t:ti=\E[?1049h\E[22;0;0t:\
        :ts=\E]2;:vb=\E]555\E\\:tc=xterm-256color:
=====
Message from drm-510-kmod-5.10.163_8:

--
The drm-510-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.
earthcar(アースカー)
マイニングベース
JETBOY
世界最大級のオンライン英会話EF English Live
Star Naming Gift