herbstluftwm - FreeBSD 12.2 - 環境構築

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

1. 概要

 「ArcoLinux 20.07.5」で「herbstluftwm」を扱おうとするので、「FreeBSD」でも扱ってみます。  下記のデスクトップ環境を構築する手順を記述します。  ここまでの時点で、システムインストールと「VirtualBox Guest Additions」の設定は終わっているものとします。  ぞれぞれのインストール・設定に関しては 「FreeBSD - デスクトップ環境構築 - 共通事項 - システムインストール」 「FreeBSD - デスクトップ環境構築 - 共通事項 - VirtualBox Guest Additions」  をご参照ください。
 項目   内容   備考 
ホスト Windows10 Version 2004
VitualBox Version 6.1.16
ゲスト FreeBSD 12.2 RELEASE
ログインマネージャ SDDM

2. インストール


pkg install -y xorg numlockx ja-font-migmix
pkg install -y sddm sddm-freebsd-black-theme hal cursor-neutral-white-theme
pkg install -y herbstluftwm bash
 「herbstluftwm」は、「bash」がないと動きません。  インストール時のメッセージに書いてあります。

Message from herbstluftwm-0.8.3:

--
You need to specify your own autostart file with -c or place it in this path:
/usr/local/etc/xdg/etc/xdg/herbstluftwm/autostart

Keep in mind that most of the scripts are written in bash syntax.
 2020年11月17日の時点で、下記のバージョンでした。

herbstluftwm-0.8.3
Name           : herbstluftwm
Version        : 0.8.3
Installed on   : Tue Nov 17 16:17:46 2020 JST
Origin         : x11-wm/herbstluftwm
Architecture   : FreeBSD:12:amd64
Prefix         : /usr/local
Categories     : x11-wm
Licenses       : BSD2CLAUSE
Maintainer     : uzsolt@uzsolt.hu
WWW            : http://herbstluftwm.org/
Comment        : Manual tiling window manager for X11
Options        :
        DOCS           : on
        EXAMPLES       : on
Shared Libs required:
        libX11.so.6
        libXrandr.so.2
        libXinerama.so.1
        libXext.so.6
Annotations    :
        FreeBSD_version: 1201000
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 1.45MiB
Description    :
herbstluftwm is a manual tiling window manager for X11 using Xlib and Glib.
Its main features can be described with:

  - The layout is based on splitting frames into subframes which can be
    split again or can be filled with windows (similar to i3 or musca)

  - Tags (or workspaces, or virtual desktops) can be added/removed at
    runtime.  Each tag contains an own layout

  - Exactly one tag is viewed on each monitor.  The tags are monitor
    independent (similar to xmonad)

  - It is configured at runtime via IPC calls from herbstclient.  So the
    configuration file is just a script which is run on startup.  (Similar
    to wmii or musca)

WWW: http://herbstluftwm.org/
 2020年9月4日に、「FreeBSD 11.4 RELEASE」へインストールしたときと変わりありません。

3. SDDM カスタマイズ

 ログイン画面の解像度を「1366x768」とし、キーボードレイアウトを「jp.106」にします。  「root」ユーザで

cat << EOF >>  /usr/local/share/sddm/scripts/Xsetup

xrandr --output VGA-0 --mode 1366x768 --rate 60
setxkbmap -layout jp
EOF
 ログイン画面のテーマとカーソルを変更します。  「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. .desktop ファイルの作成

 他のタイル型デスクトップと異なり、「herbstluftwm」は、インストール時点で

/usr/local/share/xsessions/herbstluftwm.desktop
 が作成されていますので、「.desktop」を作成する必要はありません。

5. ユーザ用初期化ファイルの作成

 「root」ユーザで

cat << EOF >> /usr/share/skel/dot.xsession
#!/bin/sh
# set locale
export LC_ALL=ja_JP.UTF-8
export LANGUAGE=ja_JP.UTF-8
export LANG=ja_JP.UTF-8
#
setxkbmap -layout jp
numlockx &
#xsetroot -cursor_name left_ptr
/usr/local/bin/VBoxClient-all
EOF
chmod +x /usr/share/skel/dot.xsession
 「EOF」の前の行は、「VirtualBox」の「Client」でのみの設定です。  既存のログインユーザで、まず、セッション開始の手順をスケルトンよりコピー。

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

mkdir -pv ~/.config/herbstluftwm/
cp /usr/local/etc/xdg/herbstluftwm/* ~/.config/herbstluftwm/.

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

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

sysrc polkitd_enable=YES
sysrc dbus_enable=YES
sysrc hald_enable=YES
sysrc sddm_enable=YES
 起動します。

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

ハイスピードプラン【usus ウズウズ】