How to setup FreeBSD with a riced desktop — part 2 — Xfce
This is the second part of the tutorial. In this part we’re going to install Xfce and rice it a bit. You can look further down in the tutorial at the screenshots in order to determine if you like the results.
Table of contents
Xfce is a lightweight and very customizable desktop environment. It is currently based on both GTK 2 and GTK 3. It provides a window manager, a file manager, a desktop and panel, and a bunch of other applications. The current version of Xfce is version 4.
To install Xfce use the meta-package called xfce . In this case I’m also going to install the goodies package as it provides some extra plugins and some useful utilities, and I’m going to install the Xfce mixer package too. Take a look at the different packages that gets pulled in to see if you can do without some of them. In case you want less bloat you can just manually install the packages you want to be a part of your Xfce installation.
Before we can start using Xfce we need to install Xorg:
Remember to also install the driver for your graphics card. Take a look at the FreeBSD wiki to determine what you need.
I’m using a Broadwell processors so I install the drm-kmod module:
Then in order to enable the module:
Ensure that all users requiring graphics are members of the "video" group.
I reboot the machine here.
Then we need to create the .xinitrc file so we can use startx . Insert the following:
With this setup we can now login to the machine and simply type x , which is an alias to the startx command that will run the startxfce4 command.
If you prefer, you can install a graphical login manager.
Start Xfce by typing x .
The first thing I do after Xfce has started up is to change the keyboard layout.
You can do that by going to Applications — Settings — Keyboard. Then choose Layout and remove the checkmark at Use system defaults. Then in Keyboard layout, choose Add and then choose your keyboard layout. You can remove the English layout if you don’t need to switch between them.
The next thing I do is to disable the lock screen part of the screensaver. I don’t want the screensaver to automatically lock the screen if I haven’t typed anything for a while. If I want to lock the screen, I do that manually.
We can disable the lock screen by going to Applications — Settings — Screensaver. Then go to the Lock Screen pane and disable the feature.
Since we’re going to use a riced version of Xfce we’re going to change some things further.
Go to the desktop and right click somewhere on the background and choose Desktop settings. Then go to Icons and remove all the checkmark from the Default Icons in the bottom. Close the Desktop settings.
Then right click at the top panel and choose Panel Preferences. Make sure that "Panel 1" is the one in the box, then click on the minus sign. This will remove the top panel. We don’t want that.
You can still access all the applications by right clicking somewhere on the desktop and then choose Applications at the bottom of the menu.
Then right click at any of the icons in the bottom panel and choose Panel — Panel Preferences. Then click on Appearance and change the style to Solid color. Then click on the color and click on the plus sign in order to add a custom color. At the bottom there is a slider, pull that all the way to the left. This makes the panel transparent.
Use the browser to download a suitable wallpaper. You can change the wallpaper by right clicking somewhere on the desktop and then choose Desktop Settings. Then use the Folder to choose the folder where you have stored the wallpaper.
Now we’re going to change the icon theme.
You can use any icon theme you like, but I prefer the Moka icon theme.
In my case I create a hidden .icons folder where I place the icons. If you want to make them accessible system wide, you need to place them somewhere else of course. Open a terminal and do the following:
Next, right click the bottom panel and choose Panel Preferences, then click on Items.
In my case I like to have only the most used applications in the panel so I’ll remove the Directory Menu, Show Desktop, the separators, and all the launchers except for the Xfce terminal. You remove each item by selecting it and then clicking the minus sign.
The items appear in the order the are placed in the panel. The item in the top is the one all the way to the left in the panel.
Now we’re left with only the Xfce terminal launcher. Select the launcher and click the small icon with the wrench on it. It’s the Edit option.
A new menu appears with a General tap and a Advanced tap. In the General tap click the small notepad looking icon on the icon list to the right. This will open the Edit Launcher where you can change the icon.
Click the icon. In the Select an icon click Select icon from (at the top) and choose Image Files. Then go to your home folder. If you have selected to put the icons into a hidden folder you need to press "CTRL+h" in order for the hidden files to appear. Select the folder where you have decided to put the Moka icons.
Then go to "Moka" and choose the icon size that suit your needs. In my case I like the "96×96" sized icons.
Once you have selected the folder with the size you want you’ll see a list of categories. The nice thing about the icon selection tool is that it has a preview.
For the terminal choose apps , then scroll down to xfce-terminal.png .
You can also type the name of the icon if you have an idea what it’s called. If you type "terminal", a list of terminal icons is selected.
When you have selected the "xfce-terminal" click OK and Save.
Now you can add more applications by clicking the plus sign in the Items section of the Panel Preferences. Don’t choose any of the build-in applications as you cannot change the icons for those.
For each application you want to appear on the panel choose Launcher.
For this tutorial I choose one for Firefox, Claws-mail, Hexchat, Thunar (the Xfce filemanager), Gimp, FileZilla, and Evince.
Then select each launcher, one at the time, and press the icon with the wrench in order to manually set it up.
When you have selected a launcher you need to click the plus sign in order to add an application. The Add New Item appears and you can now search for the application you want to add.
When you have added an application you need to click the notepad icon in order to change the icon. Repeat the steps you did with the Xfce terminal application and change each launcher icon to match an icon from the Moka theme.
If you have managed to get through all the steps without any hiccups, your desktop should now look something like this:
Normally I would just leave Xfce with the above setup as I really like the minimalistic approach, but in this tutorial I’m going to add Conky to the mix.
Conky is very configurable and it is able to monitor many system variables and resources.
You can find multiple Conky scripts on the Conky wiki page.
On the Arch Linux forum there is a thread dating back to 2007 and all the way up to 2019 (as of writing) where many people share their setup. You need to get one of the later postings if you want a script that works with the new Lua configuration in Conky.
In this case I’ll use a simple setup.
Add the file .conkyrc in your home folder and insert the following:
Then we need to make sure that Conky starts when we start Xfce. Right click somewhere on the desktop and click on Applications — Settings — Session and Startup. Then click on the Application Autostart pane and click on the + Add button.
Set Name to "Conky", set Command to "conky", and set Trigger to "on login". Then click on OK and Close.
Right click somewhere on the desktop and click on Applications — Log out — Log out. Leave the checkmark in Save session for future logins.
Then start Xfce again.
Your desktop should now look something like this:
I’m running this on a virtual machine for the tutorial which is why the size of the harddrive is only 93GB.
In the past Conky could sometimes get messed up, displaying two versions of itself, one a bit further to the right on top of the other, if you experience something like that you need to create a small shell script with a delay and then change the Session and Startup to start the shell script rather than Conky directly.
I used to create a script called .conky_start.sh , which I placed in my home folder, with this:
This will delay the start of Conky by five seconds and solve the problem. Depending on how fast your desktop starts up, you can lower or raise the sleep value.
With Xfce you have many settings, tools, and themes to choose from and it can be customized further if you like.
Please remember that this is just one way you can "rice" Xfce on FreeBSD. The Internet is filled with examples that you can use for inspiration.
As mentioned I no longer use Xfce, but it served my purpose very well in the past.
This was the Xfce setup. In the next part of the tutorial I’m going to install Xorg and i3 and then "rice" the window manager.
If you have any comments or corrections please feel free to email them to me. Also, if you found this content useful consider supporting me on Patreon