- 1. 概要
- 2. インストール
- 3. システム設定
- 4. ログインユーザ用設定
- 5. ログインマネージャ起動
1. 概要
下記のデスクトップ環境を構築する手順を記述します。
システム | | ホスト(Windows 10 1909 amd64)・VirtualBox 6.1.8 上のゲストとして FreeBSD 12.1 RELEASE |
ログインマネージャ | | Slim |
日本語入力 | | fcitx-mozc |
インストーラ入手やオペレーティングシステムのインストールあたりまでは「FreeBSD のOSインストール」を参照してください。
「VirtualBox Guest Additions」は、「FreeBSD - デスクトップ環境構築 - 共通事項」の手順であらかじめインストールしておきます。
2. インストール
pkg install -y xorg ja-font-migmix ja-fcitx-mozc zh-fcitx-configtool
pkg install -y slim slim-themes
pkg install -y hs-xmonad hs-xmonad-contrib hs-xmobar
実は、少し前にいじってみたことがあるのですが、パッケージ名が、「xmonad」から「hs-xmonad」へ、変わったようです。
3. システム設定
以下、「root」ユーザで。
前項までインストール・設定したものを有効にします。
cat - << EOF >> /etc/rc.conf
polkitd_enable="YES"
dbus_enable="YES"
slim_enable="YES"
EOF
ログイン時に有効となるよう、「.desktop」ファイルを作成します。
mkdir -pv /usr/local/share/xsessions
cat - << EOF >> /usr/local/share/xsessions/xmonad.desktop
[Desktop Entry]
Name=xmonad
Comment=A lightweight window manager for the X Windowing System
Exec=xmonad
Terminal=false
TryExec=xmonad
Type=Application
EOF
4. ログインユーザ用設定
ユーザ用初期化ファイルを作成します。
「root」ユーザで
cat - << EOF >> /usr/share/skel/dot.xinitrc
#!/bin/sh
# set locale
export LC_ALL=ja_JP.UTF-8
export LANGUAGE=ja_JP.UTF-8
export LANG=ja_JP.UTF-8
#
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=xim
export XMODIFIERS=@im=fcitx
/usr/local/bin/mozc start
/usr/local/bin/fcitx -r -d
#
setxkbmap -layout jp
/usr/local/bin/VBoxClient-all
#
exec $1
EOF
ログインユーザで、上記で作成したものをユーザ用にコピーします。
cp /usr/share/skel/dot.xinitrc $HOME/.xinitrc
初期の定義ファイルが必要になります。
ログインユーザで
mkdir -pv ~/.xmonad
cp /usr/local/share/examples/cabal/ghc-8.6.5/xmonad-0.15/xmonad.hs ~/.xmonad/.
xmonad --recompile
5. ログインマネージャ起動
前項までの設定が終わったら、デーモン群を起動します。
「root」ユーザで
service dbus start
service slim start
うまく設定できていれば、ログイン画面が表示されます。
ユーザ名・パスワードを入力してログインします。
(2020年5月8日追記、下記のように「Session:xmonad」という表示がない場合は、F1 を1回押下します)

2020年1月7日時点の「xmonad」のバージョンは、下記の通りでした。
> pkg info hs-xmonad
hs-xmonad-0.15_3
Name : hs-xmonad
Version : 0.15_3
Installed on : Thu May 28 14:32:46 2020 JST
Origin : x11-wm/hs-xmonad
Architecture : FreeBSD:12:amd64
Prefix : /usr/local
Categories : haskell x11-wm
Licenses : BSD3CLAUSE
Maintainer : haskell@FreeBSD.org
WWW : https://xmonad.org/
Comment : Tiling window manager
Options :
EXAMPLES : on
Shared Libs required:
libHSbase-4.12.0.0-ghc8.6.5.so
・・・ 略 ・・・
libHSextensible-exceptions-0.1.1.4-KI0dG6kQM84KnSzvR2Yb0-ghc8.6.5.so
Shared Libs provided:
libHSxmonad-0.15-3uLLUlc7HGsG01bk5u4QbD-ghc8.6.5.so
Annotations :
FreeBSD_version: 1201000
repo_type : binary
repository : FreeBSD
Flat size : 6.26MiB
Description :
xmonad is a tiling window manager for X. Windows are arranged
automatically to tile the screen without gaps or overlap, maximising
screen use. All features of the window manager are accessible from the
keyboard: a mouse is strictly optional. xmonad is written and
extensible in Haskell. Custom layout algorithms, and other extensions,
may be written by the user in config files. Layouts are applied
dynamically, and different layouts may be used on each workspace.
Xinerama is fully supported, allowing windows to be tiled on several
screens.
WWW: https://xmonad.org/
|