From 7d0e87d9ea524778a39ca45835dd3e9ff70ba95e Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Mon, 9 Jan 2023 18:28:15 +0000 Subject: [PATCH] Update 5 files - /home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl - /home/.chezmoiscripts/ubuntu/run_onchange_before_10-install-ubuntu-dependencies.tmpl - /home/.chezmoiscripts/_universal/run_onchange_before_10-remove-bloatware.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_85-remove-shortcuts.tmpl - /home/.chezmoidata.yaml --- home/.chezmoidata.yaml | 15 ++++++++++++- ...n_onchange_before_10-remove-bloatware.tmpl | 20 ++++++++++++++++++ ...efore_10-install-ubuntu-dependencies.tmpl} | 0 ...un_onchange_after_85-remove-shortcuts.tmpl | 21 +++++++++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 home/.chezmoiscripts/_universal/run_onchange_before_10-remove-bloatware.tmpl rename home/.chezmoiscripts/ubuntu/{run_onchange_before_10_install-ubuntu-dependencies.tmpl => run_onchange_before_10-install-ubuntu-dependencies.tmpl} (100%) create mode 100644 home/.chezmoiscripts/universal/run_onchange_after_85-remove-shortcuts.tmpl diff --git a/home/.chezmoidata.yaml b/home/.chezmoidata.yaml index 8aa973a6..e4855c4b 100644 --- a/home/.chezmoidata.yaml +++ b/home/.chezmoidata.yaml @@ -23,6 +23,18 @@ config: gpg: https://raw.githubusercontent.com/drduh/config/master/gpg.conf fonts: main: Montserrat Bold +removeLinuxPackages: + - aisleriot + - gnome-mahjongg + - gnome-mines + - gnome-sudoku + - rhythmbox +removeLinuxShortcuts: + - cmake_cmake-gui.desktop + - display-im6.q16.desktop + - flutter_openurl.desktop + - htop.desktop + - scvim.desktop softwareGroups: Android: &Android - scrcpy @@ -511,7 +523,8 @@ softwareGroups: Productivity-Desktop: &Productivity-Desktop - libreoffice - microsoft-office - - microsoft-todo + # Deprecated in favor of Google Tasks + # - microsoft-todo Python: &Python - poetry - python diff --git a/home/.chezmoiscripts/_universal/run_onchange_before_10-remove-bloatware.tmpl b/home/.chezmoiscripts/_universal/run_onchange_before_10-remove-bloatware.tmpl new file mode 100644 index 00000000..033bc4ba --- /dev/null +++ b/home/.chezmoiscripts/_universal/run_onchange_before_10-remove-bloatware.tmpl @@ -0,0 +1,20 @@ +{{- if eq .host.distro.family "linux" -}} +#!/usr/bin/env bash + +{{- $removePackages := splitList " " .removeLinuxPackages }} + +### Remove bloatware packages defined in .chezmoidata.yaml +for PKG in {{ $removePackages }}; do + if command -v apt-get > /dev/null; then + if dpkg -l "$PKG" | grep "$PKG"; then + sudo apt-get remove -y "$PKG" + fi + elif command -v dnf > /dev/null; then + if + elif command -v yum > /dev/null; then + elif command -v pacman > /dev/null; then + if pacman -Qs "$PKG" > /dev/null; then + sudo pacman -R "$PKG" + fi + fi +done \ No newline at end of file diff --git a/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl b/home/.chezmoiscripts/ubuntu/run_onchange_before_10-install-ubuntu-dependencies.tmpl similarity index 100% rename from home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl rename to home/.chezmoiscripts/ubuntu/run_onchange_before_10-install-ubuntu-dependencies.tmpl diff --git a/home/.chezmoiscripts/universal/run_onchange_after_85-remove-shortcuts.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_85-remove-shortcuts.tmpl new file mode 100644 index 00000000..d1e2eff0 --- /dev/null +++ b/home/.chezmoiscripts/universal/run_onchange_after_85-remove-shortcuts.tmpl @@ -0,0 +1,21 @@ +{{- if eq .host.distro.family "linux" -}} +#!/usr/bin/env bash + +{{ $removeShortcuts := splitList " " .removeLinuxShortcuts }} +# shortcuts to remove: {{ $removeShortcuts }} + +### Remove unnecessary desktop shortcuts +for DESKTOP_ICON in {{ $removeShortcuts }}; do + for SHORTCUT_FOLDER in {{ .host.home }}/.local/share/applications {{ .host.home }}/.local/share/applications/wine/Programs; do + if [ -f "$SHORTCUT_FOLDER/$DESKTOP_ICON" ]; then + rm -f "$SHORTCUT_FOLDER/$DESKTOP_ICON" + fi + done + for SHORTCUT_FOLDER in /usr/share/applications /usr/local/share/applications /var/lib/snapd/desktop/applications; do + if [ -f "$SHORTCUT_FOLDER/$DESKTOP_ICON" ]; then + sudo rm -f "$SHORTCUT_FOLDER/$DESKTOP_ICON" + fi + done +done + +{{- end -}}