Installing XFCE & LightDM on FreeBSD

I like to use a GUI. I like to see what I am doing, and while I am now comfortable with a command line, I like to mindlessly click eye candy to do the work that I do. The Raspberry Pi is not a powerful computer, and the 3B+ is a few generations old now, so I needed to choose a light weight option. The FreeBSD handbook, has 6 suggested desktop environments, and after looking for light weight options, I chose XFCE.

Installing XFCE

I will be installing the X Window System, on the RPi. I tried to experiment with Wayland, but I could not get it to work. To install XFCE, you need to install X Windows, XFCE and its goodies. This is done by entering the string of commands below. The command will execute the arguments in order until it is done. It will prompt you for your password and then it will execute the command. Don’t panic, you will get a ton of lines scrolling by as the pkg command executes and installs the software package. When you are done it will return you to the command prompt.

Configuring XFCE

Log in to the account you wish to use XFCE on. Per the FreeBSD handbook, you want to edit the filesystem table found at /etc/fstab, to have the /proc share mounted at startup. You do this by using nano, and entering your password.

At the end of the filesystem table, you want to add the following:

# Device                Mountpoint      FStype  Options         Dump    Pass#
proc                    /proc           procfs  rw              0       0

The # sign is a comment symbol, and everything following it will be commented out and ignored. It is there to just be a header to the table. The file should look like this.

When you are done, type CTRL+X, followed by 'Y' for YES, and ENTER to save the file.

Now you must enable the dbus, which allows for communication between applications. This is done in the /etc/rc.conf file . This file controls what programs or scripts are executed at system boot, as well as system variables used in the boot process. The easy way to do this is to use the sysrc command, but you can also do by editing the file using nano. We will show you how to do this using sysrc, and verify using nano. Enter the following command on your command line.

Use nano to open the /etc/rc.conf file, since you didn’t use sudo, it can only read the file, and not edit it.

The opened file will look like this, and you can use the down arrow key to search for the bus_enable line and it should equal "YES".

Next we want to install the display manager LightDM. This is done so you get a login screen, when you start your desktop environment. Use pkg to install it, and the greeter which is the login screen.

Next you want to use sysrc to enable lightdm.

Verify using nano as shown earlier, and scrolling down to the lightdm_enable line and verifying it equals "YES"

Finally you can setup XFCE to start when you call for it. In order to do this, you must edit the X Window System initialization file, found in your account home folder. You can edit it by using nano as follows:

Then add . /usr/local/etc/xdg/xfce4/xinitrc to the bottom of the file, and save. This will allow you to start the X Window System, but using the startx command.

The easier way to do this is to use the echo command and use the redirect command > to add it to .xinitrc This is done as follows:

You can access the desktop environment by typing startx or just reboot to have it start automatically.

Comment

Comments are closed.