Other Desktop environments installation script

Hello everyone,

I would like to offer, for those who might be interested, an automatic desktop environment installation script (probably yet another one) with bsddialog (GUI).
Indeed, I regularly use a script to test hardware and install the desktop environments I need on FreeBSD, so I decided to share it.

The script is only 21kB, it's written in very basic shell script (to remain easily understandable), and allows deploying all the desktop environments presented in the handbook, to choose from a collection of common desktop applications (including Ubuntu version of Chrome - for those who watch Netflix) and to automatically install and activate important utilities and features (USB devices automount, webcam activation, etc.).

The script requires you to provide a user (who will be allowed to log in to their desktop environment). You can create this user directly within the script. You can also rerun the script as many times as needed to add multiple users authorized to log in.

It does not detect any hardware of your computer, but offers to install the GPU configuration based on your choice (Intel Iris Xe, old Intel, Nvidia 535, AMD, or nothing - for virtual machines).
The script covers the most common cases, especially with a Nvidia graphics card placed on the PCI bus 1:0:0 by default (as is often the case on laptops).

Finally, it offers to automatically install VirtualBox or BVCP (or both).

Each configuration is functional immediately after running the script, and you can reboot directly into your desktop environment.
If this is not the case, it means your graphic configuration requires additional adjustments, but on the vast majority of computers I have tested, it works correctly.

It is preferable to run it right after a fresh installation of FreeBSD 14 (on real hardware, or as a guest on virtualbox...)

May it be of use to someone!

Of course, if some would like to see other applications in the choice offered, I can certainly add them!

Here is the link to the git created for the occasion:
https://git.asdf.cafe/majekla/freebsd/src/branch/master/freebsd-desktop.sh

1.png
2.png
3.png
4.png
 
Regarding the compatible computers that I often test, here is a short list for now concerning the choice of the graphics card in the script.

Laptops

- Intel Iris Xe
Chuwi Corebook X

- Intel (before Iris Xe)
Chuwi Larkbox Pro (Intel J4125)
Lenovo Thinkpad T470 (i5-7300U)

- NVIDIA
Dell Precision 7560 (Xeon W-11855M + NVIDIA RTX A4000)

- Intel (before Iris Xe) or NVIDIA (you have the choice)
Dell Precision 7520 (i7-7920HQ + NVIDIA Quadro P3000)
Dell Precision 7720 (i7-7820HQ + NVIDIA Quadro P3000)


Mini-PC

- Intel (before Iris Xe)
Fujitsu Esprimo Q920 (i5-4590T)
Dell Optiplex 7040 (i5-6500T)
Lenovo ThinkCenter M93p USDT Tiny Quad Core (i5-4590T)
Ace Magician JK06 (Jasper Lake N5100)
Chuwi Larkbox Pro (Intel J4125)

For virtual machines hosted on VirtualBox, the choice is that of 'Virtual Machine'.
The driver is already integrated in the xorg package (in other words, nothing happens when you choose 'Virtual Machine').
 
no.
I wrote the script following the handbook and added what I usually do.
The primary goal of this script was to remain as basic as possible, but to have something that works quickly.
desktop-installer seems to be an incredible software.. I tried it several times but I never succeeded in setting a desktop with it, so I don't use it.
 
Nice. I've been "rolling my own" on FreeBSD for a long time so don't use things like this but I do appreciate the effort needed.
One thing about desktop-installer is the detection of video drivers. Figure out the hardware, figure out what drivers to install is a lot of work but a lot of result.
One of the biggest things for desktop environments is "what do we install by default".
Get that right and the rest is easy.
 
The idea here is not at all to compare it to desktop-installer, which is a "huge" CLI application.

The script is easy to read and to modify/customize.
Thus, we know what is installed "by default".

Unlike for the softwares, I did not offer the option to customize the selection of usual utilities so as not to make the process too complex for beginners.
The webcams will be functional, and USB devices will also automount.

However, I can make changes if my opinion is not widely shared in this regard.
 
Thanks for sharing your script!

I have my own personal installation and configuration script but it's always interesting to see how other people do it ... perhaps I get some good ideas for my own script ...
 
I added auto-detection of the BusID for NVIDIA graphics.
Just to prove me wrong, this morning I tested a server for which the NVIDIA card was on BusID 33 :-D.. Even though for most laptops, it's 1.. there, it didn't work.. So I added 3 lines to the script to automatically retrieve the info. It should work.
 
  • Like
Reactions: mer
Oh, good catch! Thank you.
I am unmasked. :-D.

I sometimes copy and paste between various scripts of mine... and sometimes I forget to translate :-D..It's fixed now. Thank you.
 
Long time FreeBSD fan here. First post. Looking to get a T470 laptop set up with FreeBSD.

What do people recommend for desktop environments based on specific workloads? For example, what’s best for basic browsing? What’s best for gaming?

Would stock FreeBSD be better, or should one try a distribution geared toward desktop environments?

Etc…
 
The choice of a desktop environment is often a personal decision (more than a rational choice. For example, LXQT is very lightweight).

My personal preference always goes to XFCE, but if you're more comfortable with Gnome or KDE (which is very comprehensive on FreeBSD, especially with KDE Connect for smartphones), you'll have more options.

The FreeBSD installer does not offer a desktop environment installation; you have to do it yourself using command line after the first system boot (once installed).
However, it's not complicated. The Handbook documentation is very well done, and you can use this script or the desktop-installer package to automatically deploy your desktop environment.

If you're looking for a FreeBSD-based distribution with a ready-to-go desktop environment, you might want to check out NomadBSD, helloSystem etc... there are actually a few of them.

If you use the script, use the Intel (older than Iris Xe) graphics choice with your laptop (I also have a T470).
 
The choice of a desktop environment is often a personal decision (more than a rational choice. For example, LXQT is very lightweight).

My personal preference always goes to XFCE, but if you're more comfortable with Gnome or KDE (which is very comprehensive on FreeBSD, especially with KDE Connect for smartphones), you'll have more options.

The FreeBSD installer does not offer a desktop environment installation; you have to do it yourself using command line after the first system boot (once installed).
However, it's not complicated. The Handbook documentation is very well done, and you can use this script or the desktop-installer package to automatically deploy your desktop environment.

If you're looking for a FreeBSD-based distribution with a ready-to-go desktop environment, you might want to check out NomadBSD, helloSystem etc... there are actually a few of them.

If you use the script, use the Intel (older than Iris Xe) graphics choice with your laptop (I also have a T470).
Thank you. I'm trying GhostBSD currently. Wine seems to work as well for my basic windows needs.
 
New script update for freebsd-desktop.sh

Additions:
- An initial internet connection test has been added.
- It now also checks for the existence of the user of the entered future desktop environment, as well as for any potential new user, with a loop.
- The script now automatically manages the detection and configuration of Intel Iris Xe, Intel HD/UHD Graphics, VirtualBox/Bhyve, NVIDIA (provided your card is compatible with the current default version in the repository - 535. I will do custom configurations later for nvidia graphics if I have time).
If 2 graphics cards are detected (for example, an integrated processor graphics unit + an NVIDIA), the script offers a choice of which one to use (I have not yet been able to test this part but it should work).
If no graphics cards are detected automatically, then the manual selection menu is displayed as before.
- The choice of locales has also been added (especially for the translation of GNOME/LXQT/XFCE... or the keyboard layout for Xorg. I'm still stuck on the keyboard in GNOME (in gdm, it's settled) which I can't set to anything but QWERTY without going through the graphical settings. If anyone knows how, I'm all ears.)
- The installation of utilities is sped up in case some are already installed on the system (especially when re-running the script).
- Several checks have been added to avoid sending the same information twice to /boot/loader.conf or other files.

Notes:
Currently, vscode and youtube-dl have disappeared from the quaterly repository, so selecting them in the application menu is pointless.

It remains a basic script in which each operation is a function, and where the entire sequence is located at the bottom of the script.

I test the script on about ten different machines each time, but of course, this is just a small sample (especially with all existing graphics cards).
I hope, however, that it covers a good part of the current machines. At least, it covers mine!

Testing will be greatly appreciated!

 
Thanks for sharing your script.
I like that it is really easy to customize your script for personal preferences and prejudices.
Very simple to "stir and sweeten to taste".
Here's some possibly useful feedback. Please, this is not criticism.
1. Installation of firefox package fails. Perhaps should be firefox-esr package.
2. Selection of nvidia automagically installs the latest nvidia-driver-550 package.
There's 5 nvidia-driver packages, and the latest flavour won't work with older hardwares.
I prefer to select nvidia-driver-470 from a simple list.
3. Kernel sources ? [Edit. Probably best to include when installing FBSD from dvd/usb whatever.]
My $0.02 only. GST included.
 
Thank you for this feedback (the first one, or almost).

I originally wrote the script for my own personal use, and I simply published it just in case…It works on all my machines, but of course, detecting the exact version of the graphics card requires a lot more than just the trick of reading a few lines in “pciconf -lv,” especially since I don’t have an unlimited stock of computers to test.

For a long time, I thought about removing this part and replacing it with a simple prompt like: “Do you want an NVIDIA GPU ?", then "Choose your version of the NVIDIA driver you want”
Because in the end, for my personal needs, I don’t really need auto-detection for my own hardware (which I already know).

Regarding Firefox, the package is sometimes available under that name, sometimes not (notably when there are some temporary build errors).
I can add a simple check for that.

As for the sources, I didn’t include that option because you can select it when you install FreeBSD.
I did not think it would be important to ask for it again.
But it only takes three lines to add.
Several other aspects come down to personal choices (sudo, wheel, operator, webcamd, etc.).
Of course, an experienced user won’t configure anything like that and will prefer to control everything meticulously.

Defining the boundary between the preferences of an experienced user and those of a less experienced one isn’t the simplest task.
The script is just a base. As you wrote it, you can customize it quickly and easily according to your needs.
That was the main goal.

If I have time this weekend, I’ll make a few changes and simplify the process for graphics cards.
 
I have uploaded a new version of the script.
I may need to test it more.
Now you can select your nvidia driver version + firefox-esr if firefox is not available.
I'm working on a new new version for manual selection.
 
I used this today on my test rig (Lenovo M910q Tiny) and it worked great from a fresh 14.2 install. I tested MATE and XFCE (with zfs rollback in between). This might be my new favourite desktop installer. Thank you.
 
Looks amazing. Will try at my next opportunity.

Issues:
  • Add a commented header to this script so if someone comes across it and wants to find a newer version, they can either contact you, find the website where you will post updates, and understand the license you have for it.
  • Add more choices for desktop environments/window managers and their minimal versions such as CDE, IceWM, Blackbox, CWM, etc...
  • Maybe add a choice for if the user wants sudo or doas, rather than assume.
  • xf86-video-amdgpu, xorg needs an instruction to use amdgpu rather than modesetting
  • Give a choice between the full xorg and wayland meta packages
  • You have the user added to video during KDE, but it's something that should happen no matter which DE/WM, so refactor that out.
  • procfs mounting has be deprecated for years, hasn't it?
Looking for further improvements!
 
Back
Top