sway - FreeBSD 13.0 RELEASE - 環境構築

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

1. 概要

 下記のデスクトップ環境を構築する手順を記述します。
 項目   内容   備考 
ホスト Windows10 Version 21H2
VitualBox Version 6.1.32
ゲスト FreeBSD 13.0 RELEASE
CPU 2 コア
メモリ 4 GB
HDD 160GB
ログインマネージャ SDDM
グラフィックスコントローラ VBoxVGA 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」ユーザ権限で。

mkdir -pv /usr/share/skel

sh
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」でログインします。
「sway FreeBSD 13.0」-「ログイン画面」

6. 備考


pkg install -y xwayland sway wf-shell wcm drm-fbsd13-kmod wdisplays
 インストール時に下記のログが表示されました。

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 may be affected by https://github.com/aritger/eglstreams-kms-example/issues/7
=====
Message from libinotify-20180201_2:

--
Libinotify functionality on FreeBSD is missing support for

  - detecting a file being moved into or out of a directory within the
    same filesystem
  - certain modifications to a symbolic link (rather than the
    file it points to.)

in addition to the known limitations on all platforms using kqueue(2)
where various open and close notifications are unimplemented.

This means the following regression tests will fail:

Directory notifications:
   IN_MOVED_FROM
   IN_MOVED_TO

Open/close notifications:
   IN_OPEN
   IN_CLOSE_NOWRITE
   IN_CLOSE_WRITE

Symbolic Link notifications:
   IN_DONT_FOLLOW
   IN_ATTRIB
   IN_MOVE_SELF
   IN_DELETE_SELF

Kernel patches to address the missing directory and symbolic link
notifications are available from:

https://github.com/libinotify-kqueue/libinotify-kqueue/tree/master/patches

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.2_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.g20220128:

--
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.
 2022年3月9日の時点で、「sway」のバージョンは、下記の通りでした。

$ sway-1.7
Name           : sway
Version        : 1.7
Installed on   : Wed Mar  9 11:26:45 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/
 2022年3月9日、今回が初めてのインストールです(いや、インストールにチャレンジしたことは、前にもあるのですが、今回やっと動かせそうです)。
earthcar(アースカー)
世界最大級のオンライン英会話EF English Live
健康サポート特集
それがだいじWi-Fi
JETBOY