Setting Up Lumina with slim in Japanese and Watching YouTube and DVDs on FreeBSD
This post covers installing Lumina and xdm on a fresh i386 install. It also covers installing Japanese fonts and a Japanese IME. The final test is watching DVDs and YouTube videos- what a computer needs to do for my wife and kids to consider it useful.
Software Versions
$ date -u "+%Y-%m-%d %H:%M:%S +0000"
2016-10-01 23:28:23 +0000
$ uname -vm
FreeBSD 11.0-RC3 #0 r305786: Wed Sep 14 04:19:22 UTC 2016 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386
Install Lumina Desktop and slim
First, do a minimal install of FreeBSD and login as root.
Make your unprivileged user a member of the wheel group. This will allow you to conveniently shutdown the computer.
pw groupmod wheel -m username
NOTE: Consider increasing FETCH_TIMEOUT and/or FETCH_RETRY in /usr/local/etc/pkg.conf if you are getting timeouts when installing packages.
/usr/local/etc/pkg.conf partial listing
FETCH_RETRY=5
FETCH_TIMEOUT=90
I use vim to edit files, so that gets installed first.
pkg install vim
lumina and slim need to be installed. The localized lumina-i18n pulls in lumina and xorg.
pkg install lumina-i18n slim
Enable slim and dbus in /etc/rc.conf. slim needs dbus to start Lumina. hald is not strictly necessary, but it tends to be enabled when running xorg. Also, if you use a mouse, make sure moused is enabled in /etc/rc.conf.
/etc/rc.conf partial listing
# xorg
slim_enable="YES"
dbus_enable="YES"
hald_enable="YES"
moused_enable="YES"
Consider enabling sshd just in case something goes horribly wrong when configuring xorg.
/etc/rc.conf partial listing
sshd_enable="YES"
Generate xorg.conf.
Xorg -configure
cp ~/xorg.conf.new /etc/X11/xorg.conf
Add the Load "freetype"
to the “Module” section of /etc/X11/xorg.conf.
/etc/X11/xorg.conf partial listing
Section "Module"
Load "glx"
Load "freetype"
EndSection
Add the FontPath "/usr/local/share/fonts/dejavu/"
to the “Files” section of /etc/X11/xorg.conf.
/etc/X11/xorg.conf partial listing
Section "Files"
ModulePath "/usr/local/lib/xorg/modules"
FontPath "/usr/local/share/fonts/misc/"
FontPath "/usr/local/share/fonts/TTF/"
FontPath "/usr/local/share/fonts/OTF/"
FontPath "/usr/local/share/fonts/Type1/"
FontPath "/usr/local/share/fonts/100dpi/"
FontPath "/usr/local/share/fonts/75dpi/"
FontPath "/usr/local/share/fonts/dejavu/"
EndSection
Japanese Fonts and IME
Install the Japanese fonts and IME.
pkg install japanese/font-std japanese/scim-anthy
Create the following .xinitrc for new users.
/usr/share/skel/dot.xinitrc complete listing
#!/bin/sh
# set locale
export LC_ALL=ja_JP.UTF-8
export LANGUAGE=ja_JP.UTF-8
export LANG=ja_JP.UTF-8
# set input method
export XMODIFIERS='@im=SCIM'
# execute scim as a daemon
scim -d
# key board layout
setxkbmap -layout jp
# startx
exec $1
Copy the above .xinitrc to your home directory.
USERNAME=username
cp /usr/share/skel/dot.xinitrc /home/${USERNAME}/.xinitrc
After starting xorg, consider running scim-setup to configure scim for the IME. By default, switch between kanji and romaji input with Ctrl-[SPACE].
YouTube
As root, install chromium or your broswer of choice.
pkg install chromium
As an unprivileged user start chrome and watch a YouTube video.
chrome https://www.youtube.com/watch?v=CynsucGqMtI
DVDs
First, install vlc as root.
pkg install vlc
Also install libdvdcss. The following should work.
pkg install libdvdcss
When I tried, the package was not available, so I had to build the port.
# fetch ports tree
portsnap fetch extract
# install multimedia/libdvdcss port
cd /usr/ports/multimedia/libdvdcss
make config recursive
make install clean
Add the following line to /etc/sysctl.conf.
/etc/sysctl.conf partial listing
vfs.usermount=1
Verify the device name with camcontrol. It is usually /dev/cd0.
camcontrol devlist
Next, modify /etc/sysctl.conf to make the CDROM/DVDROM mountable by unprivileged users. Use the device from the previous step.
/etc/devfs.conf partial listing
## Allow members of the operator to mount the cdrom
own /dev/cd0 root:operator
perm /dev/cd0 0660
Add your unprivileged user to the operator group.
pw groupmod operator -m username
Reboot.
shutdown -r now
You should be able to mount and unmount the DVDs as your unprivileged user now.
CDROM=/dev/cd0
mkdir -p ~/media/cdrom
mount -t cd9660 "${CDROM}" ~/media/cdrom
umount ~/media/cdrom
As an your unprivileged user, insert a DVD and play it with VLC.
CDROM=/dev/cd0
vlc dvd://
References:
- FreeBSD Handbook, The X Display Manager
- FreeBSD Handbook, Using Fonts in Xorg
- FreeBSD Handbook, Browsers
- FreeBSD Handbook, Video Playback
- FreeBSD, デスクトップ環境構築/Lumina/インストール
- FreeBSD で遊ぼうのこーな
- FreeBSD, デスクトップ環境の構築(Mate 1.12.0 on FreeBSD 10
- FreeBSD, 日本語入力環境を構築する(scim/anthy)
- FreeBSD, 日本語環境をscim-anthyで設定しました。
- FreeBSD での DVD の再生やバックアップなど
- pkg, Operation timed out
- VLC, Documentation:Command line
- VLC, DVD won’t play in VLC or MPlayer
- VLC, What are the file system of CD and DVD?
- xdm, What is “.xsession” for?
- xdm, xorg-xdm uses the depreceated xsm as default session management
- xorg, How to get a desktop on DragonFly