setup.sh - Workstation Setup Script Documentation¶
The setup.sh script in linux-environment-automation bootstraps a Linux workstation: it installs a toolstack, adds software repositories, removes unused apps, installs helper scripts, and sets up the shell and terminal. An interactive menu lets you choose exactly which steps run, and the script is safe to run more than once.
Target Systems & Requirements¶
- Supported Distributions: Red Hat-based systems (Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux) with
dnfordnf5, and Arch Linux withpacman. - Privileges: Run it with
sudofrom your normal user account. It refuses to run as root directly, because shell and desktop settings go to your own home folder. - Supported Desktop Environments (DEs): KDE Plasma, GNOME, COSMIC.
How It Works¶
1. Initialization and Detection¶
- Root Check: Exits unless it is run with
sudofrom a regular user. - Logging: Writes a timestamped log to
/var/log/workstation-setup-<date>-<time>.log. - System Profiling: Reads
/etc/os-releaseand checks running processes to identify the distribution, version, package manager (dnf5,dnf, orpacman) and the active desktop environment. - Menu Setup: Installs
whiptail(newtorlibnewt) if it is missing.
2. Interactive Selection¶
A whiptail checklist lets you toggle these modules on or off. The KDE wallpaper step is pre-selected only on KDE.
PREREQS: Prerequisites & Repositories¶
- Installs base utilities (
curl,flatpak, Go,git,wget,unzip,fontconfig). - On DNF systems, tunes
/etc/dnf/dnf.confby setting only the keys it needs (installonly_limit,max_parallel_downloads, and others). Your other settings are kept, and a dated backup is saved next to the file. - Adds the Brave Browser, Sublime Text and Tailscale repositories, each skipped if already configured.
- On Arch, Brave and Sublime Text are skipped because they are AUR-only.
CORE: Core Toolstack¶
- Installs Brave, Firefox, Sublime Text, Podman, btop, VLC, Nmap, Fastfetch, Tailscale, Alacritty and Dolphin (plus Spectacle on KDE).
- Installs everything in one batch, then retries one at a time if the batch fails. Packages not available in your repositories are reported instead of attempted.
- Enables the
tailscaledservice; runsudo tailscale upafterwards to log in.
DEBLOAT: Desktop Environment Debloat¶
- Removes common unused apps (such as Thunderbird and LibreOffice) plus a list tailored to the detected desktop (for example KMail on KDE, GNOME Tour on GNOME).
- Only removes packages that are actually installed, then cleans up orphaned dependencies.
FLATPAKS: Flatpak Installations¶
- Adds Flathub and installs LM Studio, Podman Desktop, Zenmap and Trayscale.
- If the Trayscale Flatpak fails, builds it with Go instead.
GITHUB: Scripts from linux-environment-automation¶
- Downloads the linux-environment-automation repository.
- The
updatecommand: asks which update script to install as/usr/local/bin/update, with the one for your distribution pre-selected. It warns you if an older/usr/local/sbin/updateexists that could run instead. - Tool scripts: a checklist of the scripts in
utils/,maintenance/andsecurity/(includingsecurity/clamav/andsecurity/hardening/), none pre-selected. Each one is installed into/usr/local/binwithout its.shor.pyextension.
TERM: Shell Aliases & Terminal Themes¶
- Writes aliases (
ll,c,uforsudo update, and others) and a plain prompt to~/.bashrc.d/workstation-aliases.sh. Your existing~/.bashrcis kept. If it doesn't already load~/.bashrc.d, a loader is added once, with a dated backup. - Applies a "Pure White on Black" color scheme to every Konsole profile, creating a default profile if there is none.
- Installs the JetBrainsMono Nerd Font and writes an
alacritty.tomlwith padding, opacity and colors. Any existing config is backed up first.
DESKTOP: KDE Plasma Wallpaper Setup¶
- Only runs when KDE Plasma is detected.
- Downloads the wallpapers repository, lets you pick an image, copies it to
~/Pictures/Wallpapers, and applies it.
3. Summary¶
When it finishes, the script lists anything that failed and where the full log is. It exits with an error code if any step failed.
Usage¶
- Clone the repository and read the script before running it:
git clone https://github.com/77777kaz77777/linux-environment-automation.git
cd linux-environment-automation
less provisioning/setup.sh
- Run it with
sudofrom your normal user account:
- Follow the on-screen menus.
- Open a new terminal, or run
source ~/.bashrc, to use the new aliases.