qtile - FreeBSD 13.2 - 環境構築

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

1. 概要

 下記のデスクトップ環境を構築する手順を記述します。
 項目   内容   備考 
ホスト Windows10 Version 21H2
VitualBox Version 7.0.6
仮想タイプ BSD
仮想バージョン FreeBSD(64bit)
ゲスト FreeBSD 13.2 RELEASE
ログインマネージャ SDDM

 ここまでの時点で、システムインストールと「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 py39-qtile gdk-pixbuf2
 「gdk-pixbuf2」というのを一緒にインストールしないと

Traceback (most recent call last):
  File "/usr/local/bin/qtile", line 33, in <module>
    sys.exit(load_entry_point('qtile==0.18.1', 'console_scripts', 'qtile')())
  File "/usr/local/bin/qtile", line 25, in importlib_load_entry_point
    return next(matches).load()

・・・	略	・・・

  File "/usr/local/lib/python3.9/site-packages/cairocffi/__init__.py", line 45, in dlopen
    raise OSError(error_message)  # pragma: no cover
OSError: no library called "gdk_pixbuf-2.0" was found
no library called "libgdk_pixbuf-2.0-0" was found
cannot load library 'libgdk_pixbuf-2.0.so.0': Shared object "libgdk_pixbuf-2.0.so.0" not found, required by "python3.9"
cannot load library 'libgdk_pixbuf-2.0.0.dylib': Shared object "libgdk_pixbuf-2.0.0.dylib" not found, required by "python3.9"
cannot load library 'libgdk_pixbuf-2.0-0.dll': Shared object "libgdk_pixbuf-2.0-0.dll" not found, required by "python3.9"
 ちゅうて、おちます。  2020年9月4日の時点で、「FreeBSD 11.4 RELEASE」へインストールした時期は、「python」のモジュールのバージョンがあっていないため、モジュールの入れ替えが必要でした。  2020年9月4日「FreeBSD 11.4 RELEASE」へのインストール、2020年11月13日「FreeBSD 12.1 RELEASE」へのインストール、2021年7月1日「FreeBSD 13.0」へのインストール時は、「qtile-0.14.2」でした。  2020年11月13日、「FreeBSD 12.2 RELEASE」へのインストール以降は、パッケージが更新されているようで、上記の手間はかかりませんでした。  2022年 1月 4日、「FreeBSD 12.3 RELEASE」へのインストール時は、パッケージが変わっています。  2022年12月19日、「FreeBSD 12.4 RELEASE」へのインストール時は、「py39-qtile-0.18.1_1」でした。  2023年5月9日の時点で、「qtile」は下記のバージョンでした(前回と同じ)。

$ pkg info py39-qtile
py39-qtile-0.18.1_1
Name           : py39-qtile
Version        : 0.18.1_1
Installed on   : Mon Dec 19 17:13:46 2022 JST
Origin         : x11-wm/qtile
Architecture   : FreeBSD:12:*
Prefix         : /usr/local
Categories     : x11-wm
Licenses       : MIT
Maintainer     : ericbsd@FreeBSD.org
WWW            : http://qtile.org
Comment        : Small, flexible, scriptable tiling window manager written in Python
Options        :
        DOCS           : on
Annotations    :
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 3.20MiB
Description    :
Qtile is simple, small, and extensible. It's easy to write your own layouts,
widgets, and built-in commands.

Qtile is written and configured entirely in Python, which means you can
leverage the full power and flexibility of the language to make it fit your
needs.

WWW: http://qtile.org

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 LANG             ja_JP.UTF-8
setenv LANGUAGE         ja_JP.UTF-8
setenv LANG             ja_JP.UTF-8
EOF
exit
 「.desktop」ファイルは、作成せず、「SDDM」の機能を利用して、「.xinitrc」で起動します。  「root」ユーザ権限で。

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

numlockx &

qtile
EOF
exit

chmod +x /usr/share/skel/dot.xinitrc
 「VBoxClient」の起動は、次ページ以降、自動起動の設定で行います。  既存のログインユーザで、まず、セッション開始の手順をスケルトンよりコピー。

cp /usr/share/skel/dot.xinitrc ~/.xinitrc
 ログインユーザ用の起動時のスクリプトをシステムファイルからコピーします。

mkdir -pv ~/.config/qtile/
cp /usr/local/lib/python3.9/site-packages/libqtile/resources/default_config.py ~/.config/qtile/config.py

5. /etc/rc.conf 編集

 前項までインストール・設定したものを有効にします。  「root」ユーザ権限で。

sysrc dbus_enable=YES
sysrc sddm_enable=YES

6. ログインマネージャ起動

 「root」ユーザ権限で。

service dbus start
service sddm start
 うまく設定できていれば、ログイン画面が表示されます。  ユーザ名・パスワードを入力してログインします。
「qtile FreeBSD 13.2」-「ログイン画面」

ハイスピードプランJETBOY