LXDE - FreeBSD 11.3 RELEASE - 環境構築

 
1. 概要
2. パッケージインストール
3. シャットダウンユーザの設定
4. /etc/rc.conf 編集
5. ユーザ用初期化ファイルの作成
6. ログインマネージャ起動

1. 概要

 インストーラ入手や OS のインストール、sendmail 無効化と pkg update までは「FreeBSD - デスクトップ環境構築 - 共通事項 - OS インストール - FreeBSD 11.3」を参照してください。  下記のデスクトップ環境を構築する手順を記述します。
システム FreeBSD 11.3 RELEASE(VirtualBox 6.0.10 上の amd64)
ログインマネージャ Slim
日本語入力 fcitx-mozc

 VirtualBox の Guest Additions は「FreeBSD - デスクトップ環境構築 - 共通事項」の手順であらかじめインストールしておきます。

2. パッケージインストール


pkg install xorg
pkg install japanese/font-std ja-fcitx-mozc zh-fcitx-configtool
pkg install x11/slim slim-themes
pkg install x11/lxde-meta
 インストール時に気になったメッセージをメモとしていくつか残しておきます。

Message from py27-setuptools-41.0.1:

*******************************************************************

  Only /usr/local/bin/easy_install-2.7 script has been installed
  since Python 2.7 is not the default Python version.

*******************************************************************
Message from xmlcatmgr-2.2_2:

The following catalogs are installed:

 1) /usr/local/share/sgml/catalog

   The top level catalog for SGML stuff.  It is not changed
   by any ports/packages except textproc/xmlcatmgr.

 2) /usr/local/share/sgml/catalog.ports

   This catalog is for handling SGML stuff installed under
   /usr/local/share/sgml.  It is changed by ports/packages.

 3) /usr/local/share/xml/catalog

   The top level catalog for XML stuff.  It is not changed
   by any ports/packages except textproc/xmlcatmgr.

 4) /usr/local/share/xml/catalog.ports

   This catalog is for handling XML stuff installed under
   /usr/local/share/xml.  It is changed by ports/packages.
Message from freeglut-3.0.0_2:

Joystick support is untested and it is unknown if it works.

Do not hesitate to contact x11@FreeBSD.org if this causes issues.
Message from lxmenu-data-0.1.5:

===>   NOTICE:

The lxmenu-data 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://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port
Message from keybinder-0.3.1_3:

===>   NOTICE:

The keybinder 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://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port
Message from lxde-icon-theme-0.5.1:

===>   NOTICE:

The lxde-icon-theme 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://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port
Message from lxpanel-0.9.3:

===>   NOTICE:

The lxpanel 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://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port
Message from lxhotkey-0.1.0:

===>   NOTICE:

The lxhotkey 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://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port
Message from lxsession-0.5.4:

To be able to shutdown or reboot your system, you'll have to add .rules
files in /usr/local/etc/polkit-1/rules.d directory. Which looks
like this (replace PUTYOURGROUPHERE by your group):

polkit.addRule(function (action, subject) {
  if ((action.id == "org.freedesktop.consolekit.system.restart" ||
      action.id == "org.freedesktop.consolekit.system.stop")
      && subject.isInGroup("PUTYOURGROUPHERE")) {
    return polkit.Result.YES;
  }
});
===>   NOTICE:

The lxsession 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://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port
Message from lxappearance-obconf-0.2.3:

===>   NOTICE:

The lxappearance-obconf 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://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port
Message from lxterminal-0.3.2:

===>   NOTICE:

The lxterminal 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://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port
Message from lxtask-0.1.4_3:

################################################################################

This program will attempt to obtain some system information by accessing files
in linprocfs. You must mount linprocfs filesystem for this to work correctly.
This can be accomplished by adding the following line to your /etc/fstab file:

# Device                Mountpoint              FStype          Options Dump Pass
linprocfs               /compat/linux/proc      linprocfs       rw      0       0

and then, as root, executing the command:

mount linprocfs

################################################################################
===>   NOTICE:

The lxtask 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://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port
Message from lxinput-0.3.5:

3. シャットダウンユーザの設定

 一般ユーザからもシャットダウンできるようにします。  逆に、一般ユーザからシャットダウンさせないようにするにはこの手順を行わないでください。  下記のファイルを作成して

/usr/local/etc/polkit-1/localauthority/50-local.d/org.freedesktop.consolekit.pkla
 以下のように記述します。

[Local restart]
Idendity=unix-group:power
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Local shutdown]
Idendity=unix-group:power
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Local restart - multiple]
Idendity=unix-group:power
Action=org.freedesktop.consolekit.system.restart-multiple-users
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Local shutdown - multiple]
Idendity=unix-group:power
Action=org.freedesktop.consolekit.system.stop-multiple-users
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Suspend Hibernate]
Idendity=unix-group:power
Action=org.freedesktop.upower.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
 電源操作用のグループを作成します。

pw groupadd power

/etc/group
 の power に wheel,operator,power を追加します。

power:*:1002:wheel,operator,power
 group 番号は、タイミングによって異なります。  「wheel,operator,power」を行末に追加しています。

4. /etc/rc.conf 編集

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

/etc/rc.conf
 に以下の行を加えます。

polkitd_enable="YES"
dbus_enable="YES"
slim_enable="YES"

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


~/.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
fcitx -r -d
#
setxkbmap -layout jp
#
exec $1
 新規ユーザのために作成したものを /usr/share/skel にコピーしておきます。

cp /home/ユーザ名/.xinitrc /usr/share/skel/dot.xinitrc

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

 上記までの設定が終わったら、デーモン群を起動します。

service dbus start
service slim start
 うまく設定できていれば、ログイン画面(画像はテーマを fbsd にしています)が表示されます。  同時に GNOME/OpenBox、KDE/OpenBox がインストールされていますので、F1 キーで切り替える必要があります。  切り替えるのが面倒な場合は、他のログインを無効にします。  無効にする手順については「FreeBSD - デスクトップ環境構築 - 共通事項 - ログインマネージャ - Slim」をご参照ください。  ユーザ名・パスワードを入力してログインします。
LXDE - FreeBSD 12.0 - ログイン画面

 デフォルトのデスクトップはこんな感じになっています。

LXDE - FreeBSD 12.0 - デフォルトのデスクトップ

 2019年8月1日時点の LXDE のバージョンは下記の通りでした。


> pkg info lxde-meta
lxde-meta-1.0_8
Name           : lxde-meta
Version        : 1.0_8
Installed on   : Thu Aug  1 07:57:20 2019 JST
Origin         : x11/lxde-meta
Architecture   : FreeBSD:11:*
Prefix         : /usr/local
Categories     : x11
Licenses       :
Maintainer     : ports@FreeBSD.org
WWW            : https://lxde.org/
Comment        : "meta-port" of the LXDE desktop slimmed down for FreeBSD releases
Annotations    :
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 0.00B
Description    :
LXDE is a small and lightweight X11 Desktop

WWW: https://lxde.org/
 
 
カウンタバックグラウンド