2. インストール
「root」ユーザで
pkg install -y xorg ja-font-migmix
pkg install -y sddm sddm-freebsd-black-theme hal cursor-neutral-white-theme
pkg install -y x11-wm/xfce4 xfce4-screenshooter-plugin xfce4-whiskermenu-plugin
2020年6月18日時点の XFCE のバージョンは、下記の通りでした。
$ pkg info xfce4-wm
xfce4-wm-4.14.0_1
Name : xfce4-wm
Version : 4.14.0_1
Installed on : Thu Jun 18 14:40:44 2020 JST
Origin : x11-wm/xfce4-wm
Architecture : FreeBSD:11:amd64
Prefix : /usr/local
Categories : xfce x11-wm
Licenses : GPLv2
Maintainer : xfce@FreeBSD.org
WWW : https://xfce.org/
Comment : Xfce's window manager
Options :
NLS : on
STARTUP : on
Shared Libs required:
libXext.so.6
libpango-1.0.so.0
libcairo.so.2
libepoxy.so.0
libgtk-3.so.0
libICE.so.6
libcairo-gobject.so.2
libatk-1.0.so.0
libxfce4ui-2.so.0
libxfconf-0.so.3
libSM.so.6
libXcomposite.so.1
libgdk_pixbuf-2.0.so.0
libgio-2.0.so.0
libXfixes.so.3
libX11.so.6
libglib-2.0.so.0
libwnck-3.so.0
libgobject-2.0.so.0
libxfce4kbd-private-3.so.0
libXpresent.so.1
libXrender.so.1
libstartup-notification-1.so.0
libXdamage.so.1
libxfce4util.so.7
libintl.so.8
libXrandr.so.2
libXi.so.6
libgdk-3.so.0
libXinerama.so.1
libpangocairo-1.0.so.0
Annotations :
FreeBSD_version: 1103000
repo_type : binary
repository : FreeBSD
Flat size : 1.97MiB
Description :
The Xfce 4 window manager manages the placement of application windows
on the screen, provides window decorations, and manages work-
spaces or virtual desktops.
WWW: https://xfce.org/
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. シャットダウンユーザの設定
一般ユーザからもシャットダウンできるようにします。
逆に、一般ユーザからシャットダウンさせないようにするにはこの手順を行わないでください。
「XFCE - Why does Mate system menu not have the Shutdown and Restart items? | The FreeBSD Forums」を参考にさせていただきました。
/usr/local/etc/polkit-1/rules.d/50-default.rules
を編集します。
「root」ユーザで
cat << EOF >> /usr/local/etc/polkit-1/rules.d/50-default.rules
polkit.addRule(function (action, subject)
{
if ((action.id == "org.freedesktop.consolekit.system.restart" ||
action.id == "org.freedesktop.consolekit.system.stop") &&
subject.isInGroup("wheel"))
{
return polkit.Result.YES;
}
});
EOF
「wheel」の箇所に、再起動・シャットダウンを許可したいユーザの所属する、グループ名を記述します。
わたしは、サスペンドを使いませんので、省略しています。
サスペンドを許可するには、「subject.isInGroup("wheel"))」の前に続けて、「|| action.id == "org.freedesktop.consolekit.system.suspend"」を追加します。
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
EOF
chmod +x /usr/share/skel/dot.xsession
既存のログインユーザで
cp /usr/share/skel/dot.xsession ~/.xsession
6. /etc/rc.conf 編集
前項までインストール・設定したものを有効にします。
cat - << EOF >> /etc/rc.conf
polkitd_enable="YES"
dbus_enable="YES"
hald_enable="YES"
sddm_enable="YES"
EOF
7. ログインマネージャ起動
「root」ユーザで
service dbus start
service hald start
service sddm start
うまく設定できていれば、ログイン画面が表示されます。
ユーザ名・パスワードを入力してログインします。