install.fairie/home/.chezmoiscripts/universal/run_onchange_before_10-remove-bloatware.sh.tmpl
Brian Zalewski 0ce5a3c77b Update 21 files
- /home/.chezmoiscripts/universal/run_onchange_after_85-remove-shortcuts.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_95-bootstrap-zsh-plugins.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_98-cleanup.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_99-restart-gnome.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_08-install-zx.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_09-node-version.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_10-remove-bloatware.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_11-install-docker.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_85-remove-shortcuts.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_95-bootstrap-zsh-plugins.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_98-cleanup.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_99-restart-gnome.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_08-install-zx.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_09-install-go.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_09-node-version.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_10-remove-bloatware.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_11-install-docker.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.sh.tmpl
2023-04-12 03:57:02 +00:00

48 lines
1.8 KiB
Cheetah

{{- if eq .host.distro.family "linux" -}}
#!/usr/bin/env bash
# @file Linux Bloatware Removal
# @brief Removes Linux bloatware defined in `.removeLinuxPackages` of the `home/.chezmoidata.yaml` file
# @description
# This script removes some of the software deemed to be "bloatware" by cycling through the values defined in
# `.removeLinuxPackages` of the `home/.chezmoidata.yaml` file.
{{ includeTemplate "universal/profile-before" }}
{{ includeTemplate "universal/logg-before" }}
{{- $removePackages := join " " .removeLinuxPackages }}
### Remove bloatware packages defined in .chezmoidata.yaml
for PKG in {{ $removePackages }}; do
if command -v apk > /dev/null; then
if apk list "$PKG" | grep "$PKG" > /dev/null; then
sudo apk delete "$PKG"
fi
elif command -v apt-get > /dev/null; then
if dpkg -l "$PKG" | grep -E '^ii' > /dev/null; then
sudo apt-get remove -y "$PKG"
logg success 'Removed `'"$PKG"'` via apt-get'
fi
elif command -v dnf > /dev/null; then
if rpm -qa | grep "$PKG" > /dev/null; then
sudo dnf remove -y "$PKG"
logg success 'Removed `'"$PKG"'` via dnf'
fi
elif command -v yum > /dev/null; then
if rpm -qa | grep "$PKG" > /dev/null; then
sudo yum remove -y "$PKG"
logg success 'Removed `'"$PKG"'` via yum'
fi
elif command -v pacman > /dev/null; then
if pacman -Qs "$PKG" > /dev/null; then
sudo pacman -R "$PKG"
logg success 'Removed `'"$PKG"'` via pacman'
fi
elif command -v zypper > /dev/null; then
if rpm -qa | grep "$PKG" > /dev/null; then
sudo zypper remove -y "$PKG"
logg success 'Removed `'"$PKG"'` via zypper'
fi
fi
done
{{- end }}