Other Desktop environments installation script

tennea9 Thankyou for sharing your script. The framework is especially useful.
Since you're currently working on your script, here's some more feedback, in case you think any might be useful.

1. IMHO the kde5 package is way too bloated (why include a pile of games ?).
Rather than kde5, better to start with following packages and work up from there :
plasma5-plasma plasma5-sddm-kcm kdenetwork kdeutils kdeadmin kdenetwork kdenetwork-filesharing kdeutils

2. SDDM Autologin
Code:
# Autologin
auto_login() {
    USER='user'         # adjust this to suit
    if bsddialog --yesno "Autologin $USER ?" 5 25;   then
        cat <<EOF  >> /usr/local/etc/sddm.conf
[Autologin]
User=$USER
Session=plasma
EOF
    echo '/usr/local/etc/sddm.conf updated'
    fi
}

3. Dragonfly DMA
Code:
# Dragonfly
dma() {
    if bsddialog --yesno "Activate Dragonfly DMA ?" 5 28; then
#        pkg install -y dma
        HOSTNAME=`hostname`
        MAILSERVER=$(bsddialog --inputbox "Address of mailserver" 8 29 2>&1 1>/dev/tty)
        if [ -e /etc/dma/dma.conf ]; then
            mv /etc/dma/dma.conf /etc/dma/dma.conf.original
        fi
        cat <<EOF  >  /etc/dma/dma.conf
SMARTHOST $MAILSERVER
MAILNAME  $HOSTNAME
NULLCLIENT
EOF
        cat <<EOF >> /etc/rc.conf
# Disable sendmail
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
EOF
    fi
    cat /etc/dma/dma.conf
    sleep 5
}

Where do you draw the line and yell "enough" ?
 
Last edited:
Script Update.
Being a bit overwhelmed lately, I only had a few minutes to revisit the script.
I've therefore added several small features based on requests:
  • The option to choose between a minimalist or complete version of the desktop environments: Xfce, KDE, and GNOME.
  • An option for autologin with SDDM and LightDM.
  • Added drm-kmod and gpu-firmware-kmod.
  • Some packages no longer exist and have been removed, while others have been added (dma, 1password-client, restic etc.)
  • The functions are now chained
 
Last edited:
Script Update.
Being a bit overwhelmed lately, I only had a few minutes to revisit the script.
I've therefore added several small features based on requests:
  • The option to choose between a minimalist or complete version of the desktop environments: Xfce, KDE, and GNOME.
  • An option for autologin with SDDM and LightDM.
  • Added drm-kmod and gpu-firmware-kmod.
  • Some packages no longer exist and have been removed, while others have been added.
  • I'll look at DMA next week
Thanks, I'll take a look at the update.
 
Here's another tiny but useful function for your nice script.
Code:
cpu_vendor() {
    vendor=$(sysctl -n hw.model 2>/dev/null)
    if echo "$vendor" | grep -qi "intel"; then
        sysrc kld_list+=coretemp
    elif echo "$vendor" | grep -qi "amd"; then
        sysrc kld_list+=amdtemp
    else
        echo "Unknown CPU vendor: $vendor"
        sleep 5
    fi
}
 
New update, with some additional features:
  • The ability to check if packages are missing from the repository before starting. (Due to build issues encountered this week, I've decided to write a function that lists missing packages across all Desktop Environments and informs the user before any problem occurs.)
  • The option to switch repositories (from Quarterly to Latest or vice versa) before starting.
  • The ability to create a boot environment before starting (for ZFS fs)
  • Thanks to bgroper (whom I warmly thank for his idea), monitoring CPU temperature based on the manufacturer (Intel or AMD) is now possible.
  • FVWM and WindowMaker have been added. However, as I don't personally use these environments, please let me know which display managers or basic apps users typically install.

The script organization has slightly changed.
Package lists are now placed at the beginning of the script, allowing me to quickly verify them when performing an update.
Functions remain chained together.
 
The default setups for windowmaker and fvwm should be fine. I hesitate to suggest adding specific dockapps for example. I think the defaults that you get from 'pkg install windowmaker' or 'pkg install fvwm3' should be fine. People can always add their favourite add-ons after installation. As for whether to use sddm or something else for display manager... best left to the user, In my opinion, anyway. Some people still like starting the window manager from the terminal. Thanks for adding them :)
 
I suppose arguably you could add twm as well, for people who want a really minimal X11 environment. I don't use it myself but there may be people out there who do. I think for example openbsd and/or netbsd used to install with twm. Might be worth adding for completeness. Might be useful for people testing X-server development too, I think twm is still the reference wm you get from xorg.
 
I guess since you already have the option of autologin with sddm/lightdm, it would be nice to add fvwm/windowmaker/twm to those so that they are options that can be chosen from the display mgr, if that's possible. I think you can configure the session to run in /usr/local/etc/sddm.conf for example. I expect you've already figured that out. Well done for writing this, by the way :)
 
I've added twm choice (included with Xorg).
Regarding the choice of display managers for Fvwm, WindowMaker, and twm, I'm not sure which one should be preferred.
For auto-login, some options work and others don't... I'll need to look into that again when I have a bit more time.
 
I think if I had to choose one display manager for fvwm/wmaker/twm, I'd probably go for sddm. Apart from anything else, the kde project have chosen to use it so it's a good bet it's going to keep being developed for a good few years to come. I'm using sddm with windowmaker here, it works well.
 
HPpavilion 16 with Intel/Nvidia cards mate successful install. Please keep Nvidia 550 driver selection as an option as that is the driver that worked for the mate desktop. Thanks
 
tennea9 I fully respect your decisions regarding design of your script, but ...
In my use-case, your original fully modular design with the procedures called by a "mainline" section at the end has some useful advantages.
It is much easier to comment out any unwanted procedures. A correctly placed single # key works perfectly.
This is especially useful if wanting to add some feature/s sometime after initial installation. Just comment out the unwanted parts, and re-run the script.
Easier to add any custom procedures, and insert the procedure name into the calling sequence at the desired location.
Adding any custom procedures at the correct place in your chain linked version requires much deeper knowledge of the overall flow.
I'm no coding expert, and these comments simply reflect personal experience (or lack thereof).
BTW, I'm happy to keep using a customised version of your original script, where its easy to manipulate as described above, and also add any new features.
Keep up the good work !
 
I have a bunch of silent (aka fanless) nvidia cards, all the once popular GT210 and GT710.
Here's a copy of my modified nvidia-gpu procedure, in case it be useful.
Notice the extra ServerFlags section needed by GT210 cards.

Code:
#--------------------------------------------------------------------
#    nvidia gpu
#--------------------------------------------------------------------
nvidia-gpu() {
    TMPFILE=$(mktemp)
    bsddialog --backtitle "Select your GPU driver" \
        --title "Installing graphics" \
        --radiolist "Select driver:" 12 80 11 \
        "nvidia-driver-304" "Legacy NVIDIA driver 304" off \
        "nvidia-driver-340" "Legacy NVIDIA driver 340 (eg GT210)" off \
        "nvidia-driver-390" "Legacy NVIDIA driver 390" off \
        "nvidia-driver-470" "Legacy NVIDIA driver 470 (eg GT710)" off \
        "nvidia-driver-550" "Latest NVIDIA driver-550" off 2> "$TMPFILE"
    choice=$(< "$TMPFILE" sed 's/"//g')
    rm -f "$TMPFILE"

    case "$choice" in
        "nvidia-driver-304")
            pkg ins -y nvidia-driver-304
        ;;
        "nvidia-driver-340")
            pkg ins -y nvidia-driver-340
            cat <<EOF >> /usr/local/etc/X11/xorg.conf.d/00-nvidia.conf
Section "ServerFlags"
    Option "IgnoreABI" "1"
EndSection
EOF
        ;;
        "nvidia-driver-390")
            pkg ins -y nvidia-driver-390
        ;;
        "nvidia-driver-470")
            pkg ins -y nvidia-driver-470
        ;;
        "nvidia-driver-550")
            pkg ins -y nvidia-driver-550
        ;;
    esac

    sysrc kld_list="nvidia-modeset"
  
    # BusID detection
    pciconf_output=$(pciconf -lv | grep -B3 'display' | grep -B2 'NVIDIA')
    nvidia_pci_location=$(echo "$pciconf_output" | \
    sed -nE 's/^vgapci[0-9]+@pci([0-9]+:[0-9]+:[0-9]+:[0-9]+).*/PCI:\1/p' | \
    sed 's/0://')

cat <<EOF >> /usr/local/etc/X11/xorg.conf.d/00-nvidia.conf
Section "Device"
Identifier  "Device0"
Driver      "nvidia"
VendorName  "NVIDIA Corporation"
BusID       "$nvidia_pci_location"
EndSection
EOF
}
 
tennea9 you makes me laugh.
"Don't forget to take a loot at /etc/dma/dma.conf"
But FreeBSD is FOSS. There is no loot !
:-D ... I dit not see this one ! Thanks

Functions are now unchained again.
You can change the execution flow as before, at the end.

New add with usual tools function, it's now a menu.

Thanks for your modified function. I'll looK at it soon ;-).
 
Back
Top