Desktop environment ยท surgical cleanup
XFCE4
Pick which bundled utilities to remove from a bigger checklist.
Overview
XFCE4 is already lightweight, but this tool's candidate list now covers more ground: a media player, LibreOffice, several panel plugins, a screenshot tool, an image viewer, default games, and common mail/torrent clients. Nothing is removed unless you pick it from the checklist.
Changes
- Scans for, if installed: LibreOffice, Parole, xfce4-dict, the Notes/Sensors/Weather plugins, XFCE4 Screenshooter, Ristretto, Mousepad, GNOME Mines/Sudoku, Aisleriot, Transmission, Thunderbird, Simple Scan, and Shotwell
- Shows a numbered checklist of what's actually installed - you choose which numbers to remove, 'all', or skip entirely
What stays
The XFCE4 panel, window manager, Thunar file manager, and Settings Manager are untouched - only the utilities and plugins you select are removed.
Command
curl -sSL https://debloatme.com/xfce | bash
Script source
#!/usr/bin/env bash
#
# DebloatMe - XFCE4
# https://debloatme.com/xfce
#
# Lets you pick, from a checklist, which bundled utilities to remove
# (Parole, panel plugins, LibreOffice, and a broader list of common
# extras) - nothing is removed unless you select it.
#
# Reads confirmation prompts from /dev/tty so this still works when the
# script is piped straight from curl (curl ... | bash).
#
# Review this script before running it.
set -euo pipefail
echo "== DebloatMe: XFCE4 =="
echo "This removes selected apps from the list below - nothing else changes."
read -r -p "Continue? [y/N] " confirm </dev/tty
if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
echo "Aborted. No changes made."
exit 0
fi
remove_pkg() {
local pkg="$1"
if command -v dpkg >/dev/null 2>&1 && dpkg -s "$pkg" >/dev/null 2>&1; then
sudo apt-get -y purge "$pkg" || true
elif command -v pacman >/dev/null 2>&1 && pacman -Qi "$pkg" >/dev/null 2>&1; then
sudo pacman -Rns --noconfirm "$pkg" || true
elif command -v rpm >/dev/null 2>&1 && rpm -q "$pkg" >/dev/null 2>&1; then
sudo zypper --non-interactive remove "$pkg" 2>/dev/null || sudo dnf -y remove "$pkg" || true
fi
}
is_installed() {
local pkg="$1"
if command -v dpkg >/dev/null 2>&1 && dpkg -s "$pkg" >/dev/null 2>&1; then return 0; fi
if command -v pacman >/dev/null 2>&1 && pacman -Qi "$pkg" >/dev/null 2>&1; then return 0; fi
if command -v rpm >/dev/null 2>&1 && rpm -q "$pkg" >/dev/null 2>&1; then return 0; fi
return 1
}
echo
echo "-> Scanning for optional installed apps..."
candidate_pkgs=()
candidate_labels=()
check_candidate() {
local pkg="$1" label="$2"
if is_installed "$pkg"; then
candidate_pkgs+=("$pkg")
candidate_labels+=("$label")
fi
}
check_candidate "libreoffice" "LibreOffice (full suite)"
check_candidate "parole" "Parole (media player)"
check_candidate "xfce4-dict" "XFCE4 Dictionary plugin"
check_candidate "xfce4-notes-plugin" "XFCE4 Notes plugin"
check_candidate "xfce4-sensors-plugin" "XFCE4 Sensors plugin"
check_candidate "xfce4-weather-plugin" "XFCE4 Weather plugin"
check_candidate "xfce4-screenshooter" "XFCE4 Screenshooter"
check_candidate "ristretto" "Ristretto (image viewer)"
check_candidate "mousepad" "Mousepad (text editor, if you use another)"
check_candidate "gnome-mines" "GNOME Mines"
check_candidate "gnome-sudoku" "GNOME Sudoku"
check_candidate "aisleriot" "Aisleriot (Solitaire)"
check_candidate "transmission-gtk" "Transmission (torrent client)"
check_candidate "thunderbird" "Thunderbird (mail client)"
check_candidate "simple-scan" "Simple Scan"
check_candidate "shotwell" "Shotwell (photo manager)"
if [[ ${#candidate_pkgs[@]} -eq 0 ]]; then
echo " None of the optional apps on the list are installed."
else
echo
echo "Optional apps found on this system:"
for i in "${!candidate_pkgs[@]}"; do
printf " [%d] %s\n" "$((i + 1))" "${candidate_labels[$i]}"
done
echo
read -r -p "Enter numbers to remove (space-separated), 'all', or press Enter to skip: " selection </dev/tty
to_remove=()
if [[ "$selection" == "all" ]]; then
to_remove=("${candidate_pkgs[@]}")
elif [[ -n "$selection" ]]; then
for n in $selection; do
idx=$((n - 1))
if [[ $idx -ge 0 && $idx -lt ${#candidate_pkgs[@]} ]]; then
to_remove+=("${candidate_pkgs[$idx]}")
fi
done
fi
if [[ ${#to_remove[@]} -eq 0 ]]; then
echo " Nothing selected. Skipping."
else
for pkg in "${to_remove[@]}"; do
echo " Removing $pkg"
remove_pkg "$pkg"
done
fi
fi
echo
echo "== Done. XFCE4 remains installed and functional. =="
rm -- "$0" 2>/dev/null || true
Warning
This script modifies your system
If you use the Sensors plugin to monitor system temperatures, selecting it here means you'll need an alternative (e.g. running a sensors CLI tool directly).
- Self-deletion: this script removes its own temporary downloaded copy after it finishes. That's a cleanup step, not a security feature.
- Review the source above before running it, especially on a system you can't easily restore.