From 0dce62eb412a613ee4373cb02302d2f42bf1b7e8 Mon Sep 17 00:00:00 2001 From: Pol Casacuberta Gil Date: Tue, 24 Feb 2026 18:40:05 +0100 Subject: [PATCH 1/8] feat: Update LibreOffice Java to v21, refactor Zsh package manager aliases to functions, add npm global bin to PATH, and relocate Conky configuration. --- .config/zsh/aliases | 13 +++---------- .zshenv | 4 ++++ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.config/zsh/aliases b/.config/zsh/aliases index d9d62097..838b2481 100644 --- a/.config/zsh/aliases +++ b/.config/zsh/aliases @@ -246,19 +246,12 @@ if [[ "$OSTYPE" == "linux"* ]]; then fi if [[ "$DISTRO" == "arch" || "$DISTRO" == "manjaro" ]]; then - flags="-S --noconfirm --needed" - # shellcheck disable=SC2139 - alias \$pac="sudo pacman $flags" - # shellcheck disable=SC2139 - alias \$yay="yay $flags" + \$pac() { sudo pacman -S --noconfirm --needed "$@"; } + \$yay() { yay -S --noconfirm --needed "$@"; } fi if [[ "$DISTRO" == "ubuntu"* ]]; then - # This works, its generally not recomended since now i cannot access variable with the same name, but that does not matter to me - flags="-y" - apt="sudo apt-get $flags install" - # shellcheck disable=SC2139,SC2086 - alias \$apt="$apt" + \$apt() { sudo apt-get -y install "$@"; } fi fi diff --git a/.zshenv b/.zshenv index 6bf9a9ab..ddc2fc1f 100644 --- a/.zshenv +++ b/.zshenv @@ -28,6 +28,10 @@ fi # TO CHECK IF PATH FOR APPS WORK OPEN OKULAR OR QT5 SETTINGS # fi +if [ -d "$HOME/.npm-global/bin" ] ; then + PATH="$HOME/.npm-global/bin:$PATH" +fi + if [ -d "$HOME/.local/scripts/bin" ] ; then PATH="$HOME/.local/scripts/bin:$PATH" fi From 159f05bda1da031717860ebcafd60379b0bf8516 Mon Sep 17 00:00:00 2001 From: Pol Casacuberta Gil Date: Wed, 25 Feb 2026 16:29:10 +0100 Subject: [PATCH 2/8] feat: Relocate Conky configuration, remove and ignore LibreOffice Java settings, and improve Cursor AppImage download logic with a size check. --- .../4/user/config/javasettings_Linux_X86_64.xml | 16 ---------------- .gitignore | 1 + .local/scripts/bootstrap/work_functions | 7 ++++--- 3 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 .config/libreoffice/4/user/config/javasettings_Linux_X86_64.xml diff --git a/.config/libreoffice/4/user/config/javasettings_Linux_X86_64.xml b/.config/libreoffice/4/user/config/javasettings_Linux_X86_64.xml deleted file mode 100644 index 7f6ca74a..00000000 --- a/.config/libreoffice/4/user/config/javasettings_Linux_X86_64.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - -Oracle Corporation -file:///usr/lib/jvm/java-11-openjdk -11.0.20.1 -0 -1 -660069006C0065003A002F002F002F007500730072002F006C00690062002F006A0076006D002F006A006100760061002D00310031002D006F00700065006E006A0064006B002F006C00690062002F007300650072007600650072002F006C00690062006A0076006D002E0073006F000A002F007500730072002F006C00690062002F006A0076006D002F006A006100760061002D00310031002D006F00700065006E006A0064006B002F006C00690062002F0061006D006400360034002F0063006C00690065006E0074003A002F007500730072002F006C00690062002F006A0076006D002F006A006100760061002D00310031002D006F00700065006E006A0064006B002F006C00690062002F0061006D006400360034002F007300650072007600650072003A002F007500730072002F006C00690062002F006A0076006D002F006A006100760061002D00310031002D006F00700065006E006A0064006B002F006C00690062002F0061006D006400360034002F006E00610074006900760065005F0074006800720065006100640073003A002F007500730072002F006C00690062002F006A0076006D002F006A006100760061002D00310031002D006F00700065006E006A0064006B002F006C00690062002F0061006D006400360034000A00 - - diff --git a/.gitignore b/.gitignore index ae581231..5834a794 100644 --- a/.gitignore +++ b/.gitignore @@ -288,6 +288,7 @@ .config/libreoffice/4/user/GraphicsRenderTests.log .config/libreoffice/4/user/autotext/ .config/libreoffice/4/user/basic/ +.config/libreoffice/4/user/config/javasettings_Linux_X86_64.xml .config/libreoffice/4/user/database/ .config/libreoffice/4/user/extensions/ .config/libreoffice/4/user/gallery/ diff --git a/.local/scripts/bootstrap/work_functions b/.local/scripts/bootstrap/work_functions index ed94122d..4d5639ea 100644 --- a/.local/scripts/bootstrap/work_functions +++ b/.local/scripts/bootstrap/work_functions @@ -227,12 +227,13 @@ gui_apps_install() { fi # Cursor (AI IDE — AppImage) - if [ ! -f "$HOME/Applications/cursor.AppImage" ]; then + if [ ! -f "$HOME/Applications/cursor.AppImage" ] || [ "$(stat -c%s "$HOME/Applications/cursor.AppImage")" -lt 1048576 ]; then info "Installing Cursor..." $apt libfuse2 mkdir -p "$HOME/Applications" - curl -fsSL "https://www.cursor.com/api/download?platform=linux-x64&releaseTrack=stable" \ - -o "$HOME/Applications/cursor.AppImage" + local cursor_url + cursor_url=$(curl -fsSL "https://www.cursor.com/api/download?platform=linux-x64&releaseTrack=stable" | jq -r '.downloadUrl') + curl -fsSL "$cursor_url" -o "$HOME/Applications/cursor.AppImage" chmod +x "$HOME/Applications/cursor.AppImage" # Desktop entry cat > "$HOME/.local/share/applications/cursor.desktop" < Date: Wed, 25 Feb 2026 18:18:32 +0100 Subject: [PATCH 3/8] feat: Add uninstall scripts for various operating systems and update Makefile to include new uninstall targets for Arch, Manjaro, Ubuntu, macOS, and work machine configurations. --- .config/{ => iterm2}/conky/conky.conf | 0 .local/scripts/bootstrap/uninstall_arch | 32 ++++ .../bootstrap/uninstall_arch_functions | 151 ++++++++++++++++++ .local/scripts/bootstrap/uninstall_mac | 27 ++++ .../scripts/bootstrap/uninstall_mac_functions | 78 +++++++++ .local/scripts/bootstrap/uninstall_manjaro | 34 ++++ .../bootstrap/uninstall_manjaro_functions | 36 +++++ .local/scripts/bootstrap/uninstall_ubuntu | 32 ++++ .../bootstrap/uninstall_ubuntu_functions | 108 +++++++++++++ .local/scripts/bootstrap/uninstall_work | 30 ++++ .../bootstrap/uninstall_work_functions | 110 +++++++++++++ Makefile | 21 ++- 12 files changed, 658 insertions(+), 1 deletion(-) rename .config/{ => iterm2}/conky/conky.conf (100%) create mode 100755 .local/scripts/bootstrap/uninstall_arch create mode 100644 .local/scripts/bootstrap/uninstall_arch_functions create mode 100755 .local/scripts/bootstrap/uninstall_mac create mode 100644 .local/scripts/bootstrap/uninstall_mac_functions create mode 100755 .local/scripts/bootstrap/uninstall_manjaro create mode 100644 .local/scripts/bootstrap/uninstall_manjaro_functions create mode 100755 .local/scripts/bootstrap/uninstall_ubuntu create mode 100644 .local/scripts/bootstrap/uninstall_ubuntu_functions create mode 100755 .local/scripts/bootstrap/uninstall_work create mode 100755 .local/scripts/bootstrap/uninstall_work_functions diff --git a/.config/conky/conky.conf b/.config/iterm2/conky/conky.conf similarity index 100% rename from .config/conky/conky.conf rename to .config/iterm2/conky/conky.conf diff --git a/.local/scripts/bootstrap/uninstall_arch b/.local/scripts/bootstrap/uninstall_arch new file mode 100755 index 00000000..7f124d59 --- /dev/null +++ b/.local/scripts/bootstrap/uninstall_arch @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# Arch bootstrap UNINSTALL +# Author: https://github.com/cuberhaus +set -euo pipefail + +### VARIABLES +scripts="$HOME/.local/scripts" +source "$scripts/bootstrap/base_functions" +source "$scripts/bootstrap/uninstall_arch_functions" + +### UNINSTALLATION +info "Preparing to uninstall Arch bootstrap dependencies..." + +read -r -p "This will remove base packages, drivers, i3, xmonad, vim plugins, and more. Are you sure? [y/N] " response +if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then + vim_uninstall + i3_uninstall + xmonad_uninstall + arch_uninstall + laptop_uninstall + dwall_uninstall + papirus_uninstall + base_uninstall + + if [ "$(basename "$SHELL")" == "zsh" ]; then + info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" + fi + + info "Uninstallation complete. A system reboot is recommended." +else + info "Uninstallation aborted." +fi diff --git a/.local/scripts/bootstrap/uninstall_arch_functions b/.local/scripts/bootstrap/uninstall_arch_functions new file mode 100644 index 00000000..f34d467f --- /dev/null +++ b/.local/scripts/bootstrap/uninstall_arch_functions @@ -0,0 +1,151 @@ +#! /usr/bin/env bash +# Arch bootstrap UNINSTALL functions +# Author: https://github.com/cuberhaus + +pac_remove="sudo pacman -Rns --noconfirm" +yay_remove="yay -Rns --noconfirm" + +############################################################### +# => Base packages uninstall +############################################################### +base_uninstall() { + info "Uninstalling base packages..." + + $pac_remove cmake opencl-headers bazel cudnn cuda conky \ + adapta-gtk-theme arc-gtk-theme arc-icon-theme \ + bat biber breeze calibre cron dconf-editor dex discord dnsutils \ + dunst eza exfat-utils file-roller firefox fzf gcc gdb \ + gnome-calculator gnome-font-viewer gnome-keyring gtk2 gtk3 \ + gucharmap gvim hardinfo cpu-x htop inotify-tools kcolorchooser \ + kdiff3 kitty kvantum-qt5 laptop-detect \ + libmythes mythes-en mythes-es \ + libreoffice-still libreoffice-still-ca lxappearance ncdu \ + nemo nemo-fileroller nemo-preview nemo-seahorse nemo-share \ + net-tools nilfs-utils nomacs noto-fonts-emoji npm ntfs-3g \ + okular papirus-icon-theme partitionmanager perl-file-mimeinfo \ + playerctl polkit polkit-gnome python python-pipenv python3 \ + qt5ct ranger rclone reflector remmina freerdp libvncserver \ + ruby seahorse speedcrunch stow svn the_silver_searcher \ + thunderbird tmux transmission-gtk trash-cli \ + ttf-dejavu ttf-liberation ttf-droid ttf-ubuntu-font-family ttf-roboto noto-fonts \ + tumbler ffmpegthumbnailer raw-thumbnailer udftools udiskie \ + dolphin udisks2 vlc w3m wget wireshark wmctrl xclip xdg-user-dirs \ + xfce4-clipman-plugin xorg xorg-xinit xss-lock yarn zsh \ + zathura-cb zathura-djvu zathura-pdf-mupdf zathura-ps zathura \ + kalk solaar telegram obsidian virt-viewer || true + + # AUR packages + $yay_remove caffeine-ng florence downgrade balena-etcher-appimage \ + woeusb-ng betterlockscreen google-chrome microsoft-edge-stable-bin \ + libreoffice-extension-languagetool timeshift tomighty ttf-ms-fonts || true + + git config --global --unset credential.helper || true +} + +############################################################### +# => Arch-specific packages uninstall +############################################################### +arch_uninstall() { + info "Uninstalling Arch-specific packages..." + + $pac_remove xorg-xrandr arandr autorandr \ + linux-headers nvidia nvidia-utils xf86-video-intel mesa lib32-mesa \ + lib32-nvidia-utils nvidia-settings \ + cups system-config-printer \ + bluez bluez-utils blueberry \ + lightdm-gtk-greeter lightdm lightdm-gtk-greeter-settings \ + networkmanager nm-connection-editor || true + + $yay_remove pulseaudio-modules-bt || true + + # Disable services (ignore errors if already disabled) + sudo systemctl disable org.cups.cupsd.service 2>/dev/null || true + sudo systemctl disable bluetooth.service 2>/dev/null || true + sudo systemctl disable lightdm.service 2>/dev/null || true + sudo systemctl disable NetworkManager.service 2>/dev/null || true +} + +############################################################### +# => i3 uninstall +############################################################### +i3_uninstall() { + info "Uninstalling i3..." + + $pac_remove acpi awk bc upower feh flameshot i3-gaps i3blocks \ + light picom rofi yad xdotool zenity \ + perl-anyevent-i3 python-dbus || true + + $yay_remove cava kbdd-git || true +} + +############################################################### +# => xmonad uninstall +############################################################### +xmonad_uninstall() { + info "Uninstalling xmonad..." + + $pac_remove dmenu trayer xmobar xmonad-contrib xorg-xmessage || true + + sudo rm -f /etc/pacman.d/hooks/xmonad.hook +} + +############################################################### +# => Vim/neovim uninstall +############################################################### +vim_uninstall() { + info "Uninstalling vim/neovim extras..." + + $pac_remove neovim ctags astyle autopep8 yapf cmake-format shfmt \ + stylish-haskell tidy python-pip || true + + sudo npm uninstall -g neovim js-beautify remark-cli 2>/dev/null || true + sudo gem uninstall neovim 2>/dev/null || true +} + +############################################################### +# => Laptop packages uninstall +############################################################### +laptop_uninstall() { + info "Uninstalling laptop packages..." + + $pac_remove tlp || true + sudo systemctl disable tlp.service 2>/dev/null || true +} + +############################################################### +# => Dynamic wallpapers uninstall +############################################################### +dwall_uninstall() { + info "Removing dynamic wallpapers..." + sudo rm -rf /usr/share/dynamic-wallpaper 2>/dev/null || true + rm -rf "$HOME/.local/share/dynamic-wallpaper" 2>/dev/null || true +} + +############################################################### +# => Papirus folders uninstall +############################################################### +papirus_uninstall() { + info "Removing papirus-folders..." + if [ -x /usr/local/bin/papirus-folders ]; then + wget -qO- https://git.io/papirus-folders-install | env uninstall=true sh || true + fi +} + +############################################################### +# => Emacs uninstall +############################################################### +emacs_uninstall() { + info "Uninstalling Emacs..." + + systemctl --user disable emacs 2>/dev/null || true + + $pac_remove emacs-nativecomp aspell aspell-ca aspell-de aspell-en aspell-es \ + ispell pandoc languagetool mplayer shellcheck python-pipenv prettier \ + ripgrep fd || true + + sudo npm uninstall -g markdownlint textlint 2>/dev/null || true + + rm -rf "$HOME/.emacs.d" 2>/dev/null || true + rm -rf "$HOME/.config/doom-emacs" 2>/dev/null || true + rm -f "$HOME/.config/chemacs/profile" 2>/dev/null || true +} diff --git a/.local/scripts/bootstrap/uninstall_mac b/.local/scripts/bootstrap/uninstall_mac new file mode 100755 index 00000000..8ae9619f --- /dev/null +++ b/.local/scripts/bootstrap/uninstall_mac @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# macOS bootstrap UNINSTALL +# Author: https://github.com/cuberhaus +set -euo pipefail + +### VARIABLES +scripts="$HOME/.local/scripts" +source "$scripts/bootstrap/base_functions" +source "$scripts/bootstrap/uninstall_mac_functions" + +### UNINSTALLATION +info "Preparing to uninstall macOS bootstrap dependencies..." + +read -r -p "This will remove CLI tools, fonts, GUI apps, and vim/neovim via Homebrew. Are you sure? [y/N] " response +if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then + vim_uninstall + gui_apps_uninstall + fonts_uninstall + cli_uninstall + brew_cleanup + + info "Uninstallation complete." + info "To fully remove Homebrew itself, run:" + info " /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)\"" +else + info "Uninstallation aborted." +fi diff --git a/.local/scripts/bootstrap/uninstall_mac_functions b/.local/scripts/bootstrap/uninstall_mac_functions new file mode 100644 index 00000000..5cf62dce --- /dev/null +++ b/.local/scripts/bootstrap/uninstall_mac_functions @@ -0,0 +1,78 @@ +#! /usr/bin/env bash +# macOS bootstrap UNINSTALL functions +# Author: https://github.com/cuberhaus + +############################################################### +# => CLI tools uninstall +############################################################### +cli_uninstall() { + info "Uninstalling CLI tools..." + + local formulae=( + ack astyle bat bison cmake eza flex fzf git go gpg htop llvm mono + ncdu neofetch p7zip pinentry-mac pkg-config ranger w3m rclone + ripgrep smimesign sox stow swig the_silver_searcher unrar wget yarn + ) + + for pkg in "${formulae[@]}"; do + brew uninstall "$pkg" 2>/dev/null || true + done +} + +############################################################### +# => Fonts uninstall +############################################################### +fonts_uninstall() { + info "Uninstalling fonts..." + + local fonts=( + font-fira-code-nerd-font + font-inconsolata-nerd-font + font-iosevka-nerd-font + font-meslo-lg-nerd-font + ) + + for font in "${fonts[@]}"; do + brew uninstall "$font" 2>/dev/null || true + done +} + +############################################################### +# => GUI applications uninstall +############################################################### +gui_apps_uninstall() { + info "Uninstalling GUI applications..." + + local casks=( + caffeine ballast calibre ccleaner discord google-chrome + karabiner-elements kitty mos rectangle spotify sublime-text + texstudio the-unarchiver tomighty transmission visual-studio-code + vlc whatsapp anki notion notion-calendar obsidian todoist + ) + + for cask in "${casks[@]}"; do + brew uninstall --cask "$cask" 2>/dev/null || true + done +} + +############################################################### +# => Vim/neovim uninstall +############################################################### +vim_uninstall() { + info "Uninstalling vim/neovim..." + + brew uninstall macvim 2>/dev/null || true + brew uninstall neovim 2>/dev/null || true + + sudo npm uninstall -g neovim 2>/dev/null || true + python3 -m pip uninstall -y pynvim 2>/dev/null || true + sudo gem uninstall neovim 2>/dev/null || true +} + +############################################################### +# => Homebrew cleanup +############################################################### +brew_cleanup() { + info "Running brew cleanup..." + brew cleanup --prune=all 2>/dev/null || true +} diff --git a/.local/scripts/bootstrap/uninstall_manjaro b/.local/scripts/bootstrap/uninstall_manjaro new file mode 100755 index 00000000..e1930015 --- /dev/null +++ b/.local/scripts/bootstrap/uninstall_manjaro @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# Manjaro bootstrap UNINSTALL +# Author: https://github.com/cuberhaus +set -euo pipefail + +### VARIABLES +scripts="$HOME/.local/scripts" +source "$scripts/bootstrap/base_functions" +source "$scripts/bootstrap/uninstall_arch_functions" +source "$scripts/bootstrap/uninstall_manjaro_functions" + +### UNINSTALLATION +info "Preparing to uninstall Manjaro bootstrap dependencies..." + +read -r -p "This will remove base packages, drivers, i3, xmonad, emacs, snaps, and more. Are you sure? [y/N] " response +if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then + emacs_uninstall + vim_uninstall + manjaro_uninstall + arch_and_manjaro_uninstall + i3_uninstall + xmonad_uninstall + arch_uninstall + laptop_uninstall + base_uninstall + + if [ "$(basename "$SHELL")" == "zsh" ]; then + info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" + fi + + info "Uninstallation complete. A system reboot is recommended." +else + info "Uninstallation aborted." +fi diff --git a/.local/scripts/bootstrap/uninstall_manjaro_functions b/.local/scripts/bootstrap/uninstall_manjaro_functions new file mode 100644 index 00000000..da977b69 --- /dev/null +++ b/.local/scripts/bootstrap/uninstall_manjaro_functions @@ -0,0 +1,36 @@ +#! /usr/bin/env bash +# Manjaro bootstrap UNINSTALL functions +# Author: https://github.com/cuberhaus + +pac_remove="sudo pacman -Rns --noconfirm" +yay_remove="yay -Rns --noconfirm" + +############################################################### +# => Manjaro-specific packages uninstall +############################################################### +manjaro_uninstall() { + info "Uninstalling Manjaro-specific packages..." + + sudo snap remove intellij-idea-ultimate 2>/dev/null || true + sudo snap remove pycharm-professional 2>/dev/null || true + sudo snap remove spotify 2>/dev/null || true + sudo snap remove sublime-merge 2>/dev/null || true + sudo snap remove sublime-text 2>/dev/null || true + sudo snap remove whatsie 2>/dev/null || true + sudo snap remove zotero-snap 2>/dev/null || true + + $pac_remove cinnamon-screensaver manjaro-pipewire || true +} + +############################################################### +# => Arch+Manjaro shared packages uninstall +############################################################### +arch_and_manjaro_uninstall() { + info "Uninstalling shared Arch/Manjaro packages..." + + $pac_remove hplip || true + $yay_remove epson-inkjet-printer-escpr || true + + sudo gpasswd -d "$USER" sambashare 2>/dev/null || true + git config --global --unset credential.helper || true +} diff --git a/.local/scripts/bootstrap/uninstall_ubuntu b/.local/scripts/bootstrap/uninstall_ubuntu new file mode 100755 index 00000000..9c859c5d --- /dev/null +++ b/.local/scripts/bootstrap/uninstall_ubuntu @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# Ubuntu bootstrap UNINSTALL +# Author: https://github.com/cuberhaus +set -euo pipefail + +### VARIABLES +scripts="$HOME/.local/scripts" +source "$scripts/bootstrap/base_functions" +source "$scripts/bootstrap/uninstall_ubuntu_functions" + +### UNINSTALLATION +info "Preparing to uninstall Ubuntu bootstrap dependencies..." + +read -r -p "This will remove dev tools, emacs, snaps, GUI apps, Chrome, and Homebrew. Are you sure? [y/N] " response +if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then + vim_uninstall + emacs_uninstall + snaps_uninstall + chrome_uninstall + ubuntu_gui_uninstall + base_uninstall + brew_uninstall + cleanup + + if [ "$(basename "$SHELL")" == "zsh" ]; then + info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" + fi + + info "Uninstallation complete. A system reboot is recommended." +else + info "Uninstallation aborted." +fi diff --git a/.local/scripts/bootstrap/uninstall_ubuntu_functions b/.local/scripts/bootstrap/uninstall_ubuntu_functions new file mode 100644 index 00000000..c51753ef --- /dev/null +++ b/.local/scripts/bootstrap/uninstall_ubuntu_functions @@ -0,0 +1,108 @@ +#! /usr/bin/env bash +# Ubuntu bootstrap UNINSTALL functions +# Author: https://github.com/cuberhaus + +apt_remove="sudo apt-get remove --purge -y" +apt_autoremove="sudo apt-get autoremove -y" + +############################################################### +# => Base packages uninstall +############################################################### +base_uninstall() { + info "Uninstalling base packages..." + + $apt_remove autoconf automake bat build-essential cmake curl eza file \ + fonts-powerline fzf git gnome-shell htop inkscape laptop-detect \ + libgtk-3-dev ncdu neovim nodejs npm optipng pkg-config python3 \ + python3-pip ranger w3m rclone ruby-dev samba-common-bin sassc \ + silversearcher-ag stow subversion tmux vim-gtk yarn zsh eog sshfs || true + + git config --global --unset credential.helper || true +} + +############################################################### +# => Ubuntu GUI packages uninstall +############################################################### +ubuntu_gui_uninstall() { + info "Uninstalling Ubuntu GUI packages..." + + $apt_remove lxappearance arc-theme audacity calibre \ + cpu-checker qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils \ + gnome-screensaver gparted pavucontrol thunderbird timeshift \ + transmission vlc caffeine dconf-editor r-base || true + + # RStudio + sudo dpkg -r rstudio 2>/dev/null || true +} + +############################################################### +# => Google Chrome uninstall +############################################################### +chrome_uninstall() { + info "Uninstalling Google Chrome..." + $apt_remove google-chrome-stable || true +} + +############################################################### +# => Snaps uninstall +############################################################### +snaps_uninstall() { + info "Uninstalling snaps..." + + sudo snap remove code 2>/dev/null || true + sudo snap remove discord 2>/dev/null || true + sudo snap remove intellij-idea-professional 2>/dev/null || true + sudo snap remove pycharm-professional 2>/dev/null || true + sudo snap remove skype 2>/dev/null || true + sudo snap remove slack 2>/dev/null || true + sudo snap remove spotify 2>/dev/null || true + sudo snap remove sublime-merge 2>/dev/null || true + sudo snap remove sublime-text 2>/dev/null || true + sudo snap remove walc 2>/dev/null || true +} + +############################################################### +# => Emacs uninstall +############################################################### +emacs_uninstall() { + info "Uninstalling Emacs..." + + $apt_remove emacs-gtk tar fd-find clang libtool || true + + rm -rf "$HOME/.emacs.d" 2>/dev/null || true + rm -rf "$HOME/.config/doom-emacs" 2>/dev/null || true + rm -f "$HOME/.config/chemacs/profile" 2>/dev/null || true +} + +############################################################### +# => Vim/neovim uninstall +############################################################### +vim_uninstall() { + info "Uninstalling vim/neovim extras..." + + sudo npm uninstall -g neovim 2>/dev/null || true + python3 -m pip uninstall -y pynvim 2>/dev/null || true + sudo gem uninstall neovim 2>/dev/null || true +} + +############################################################### +# => Homebrew uninstall +############################################################### +brew_uninstall() { + if ! command -v brew &>/dev/null; then + info "Homebrew not found, skipping." + return + fi + + info "Uninstalling Homebrew..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" || true +} + +############################################################### +# => Cleanup +############################################################### +cleanup() { + info "Running apt cleanup..." + sudo apt-get update + $apt_autoremove +} diff --git a/.local/scripts/bootstrap/uninstall_work b/.local/scripts/bootstrap/uninstall_work new file mode 100755 index 00000000..829ea7b4 --- /dev/null +++ b/.local/scripts/bootstrap/uninstall_work @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Work machine bootstrap UNINSTALL (Asus ROG Strix / Ubuntu + NVIDIA) +# Author: https://github.com/cuberhaus +set -euo pipefail + +### VARIABLES +scripts="$HOME/.local/scripts" +source "$scripts/bootstrap/base_functions" +source "$scripts/bootstrap/uninstall_work_functions" + +### UNINSTALLATION +info "Preparing to uninstall work bootstrap dependencies..." + +read -r -p "This will remove development tools, docker, node, python, cursor, and GUI apps. Are you sure? [y/N] " response +if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then + nvidia_uninstall + dev_tools_uninstall + node_uninstall + python_uninstall + docker_uninstall + gui_apps_uninstall + + if [ "$(basename "$SHELL")" == "zsh" ]; then + info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" + fi + + info "Uninstallation complete. A system reboot is recommended." +else + info "Uninstallation aborted." +fi diff --git a/.local/scripts/bootstrap/uninstall_work_functions b/.local/scripts/bootstrap/uninstall_work_functions new file mode 100755 index 00000000..a8b5d1a6 --- /dev/null +++ b/.local/scripts/bootstrap/uninstall_work_functions @@ -0,0 +1,110 @@ +#! /usr/bin/env bash +# Work machine bootstrap UNINSTALL functions +# Author: https://github.com/cuberhaus + +apt_remove="sudo apt-get remove --purge -y" +apt_autoremove="sudo apt-get autoremove -y" + +############################################################### +# => Revert ROG Strix shutdown fix +############################################################### +shutdown_restore() { + # If the script has an uninstall or revert mechanism, use it here. + info "Skipping shutdown_fix reversal as it modifies GRUB and requires manual review." +} + +############################################################### +# => NVIDIA drivers uninstall +############################################################### +nvidia_uninstall() { + info "Uninstalling NVIDIA tools..." + $apt_remove ubuntu-drivers-common nvidia-settings nvidia-prime || true +} + +############################################################### +# => Core dev tools uninstall +############################################################### +dev_tools_uninstall() { + info "Uninstalling dev tools..." + $apt_remove build-essential cmake curl git jq tree wget zsh stow vim-gtk3 neovim \ + bat eza fzf htop ncdu ranger ripgrep fd-find silversearcher-ag w3m shellcheck \ + unzip eog flameshot rclone sshfs + + # Unset global git config + git config --global --unset credential.helper || true +} + +############################################################### +# => Node.js uninstall +############################################################### +node_uninstall() { + info "Uninstalling Node.js and global packages..." + sudo npm uninstall -g cline markdownlint-cli2 || true + $apt_remove nodejs || true + + # Remove NodeSource repo + sudo rm -f /etc/apt/sources.list.d/nodesource.list + sudo rm -f /etc/apt/keyrings/nodesource.gpg +} + +############################################################### +# => Python uninstall +############################################################### +python_uninstall() { + info "Uninstalling Python and pipx packages..." + $apt_remove python3 python3-pip python3-venv pipx || true + + # Uninstall vim-vint + python3 -m pip uninstall -y vim-vint || true + + # Uninstall all pipx packages + if command -v pipx &>/dev/null; then + pipx uninstall-all || true + fi +} + +############################################################### +# => Docker CE uninstall +############################################################### +docker_uninstall() { + info "Uninstalling Docker..." + $apt_remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin || true + + # Remove Docker apt repo and key + sudo rm -f /etc/apt/sources.list.d/docker.list + sudo rm -f /etc/apt/keyrings/docker.gpg + + # Remove user from docker group + sudo gpasswd -d "$USER" docker || true +} + +############################################################### +# => GUI applications uninstall +############################################################### +gui_apps_uninstall() { + info "Uninstalling GUI applications..." + + # apt packages + $apt_remove firefox vlc google-chrome-stable code antigravity warp-terminal libreoffice caffeine libfuse2 || true + + # Snaps + sudo snap remove obsidian || true + sudo snap remove spotify || true + sudo snap remove discord || true + + # Remove VS Code repo + sudo rm -f /etc/apt/sources.list.d/vscode.list + sudo rm -f /etc/apt/keyrings/packages.microsoft.gpg + + # Remove Antigravity repo + sudo rm -f /etc/apt/sources.list.d/antigravity.list + sudo rm -f /etc/apt/keyrings/antigravity-repo-key.gpg + + # Cursor AppImage removal + rm -f "$HOME/Applications/cursor.AppImage" + rm -f "$HOME/.local/share/applications/cursor.desktop" + + # Clean up apt caches + sudo apt-get update + $apt_autoremove +} diff --git a/Makefile b/Makefile index 64b44603..d30fc331 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ STOW := stow STOW_DIR := $(shell pwd) TARGET := $(HOME) -.PHONY: help install uninstall restow dry-run lint check hooks update submodules antigen-update bootstrap-arch bootstrap-manjaro bootstrap-ubuntu bootstrap-mac bootstrap-work +.PHONY: help install uninstall restow dry-run lint check hooks update submodules antigen-update bootstrap-arch bootstrap-manjaro bootstrap-ubuntu bootstrap-mac bootstrap-work uninstall-arch uninstall-manjaro uninstall-ubuntu uninstall-mac uninstall-work help: ## Show this help @grep -E '^[a-zA-Z_-]+:.*##' $(MAKEFILE_LIST) | \ @@ -93,3 +93,22 @@ bootstrap-mac: ## Run macOS bootstrap bootstrap-work: ## Run work machine bootstrap (Ubuntu + NVIDIA) bash .local/scripts/bootstrap/work + +# --------------------------------------------------------------------------- +# Uninstall (OS-specific) +# --------------------------------------------------------------------------- + +uninstall-arch: ## Run Arch uninstaller + bash .local/scripts/bootstrap/uninstall_arch + +uninstall-manjaro: ## Run Manjaro uninstaller + bash .local/scripts/bootstrap/uninstall_manjaro + +uninstall-ubuntu: ## Run Ubuntu uninstaller + bash .local/scripts/bootstrap/uninstall_ubuntu + +uninstall-mac: ## Run macOS uninstaller + bash .local/scripts/bootstrap/uninstall_mac + +uninstall-work: ## Run work machine uninstaller + bash .local/scripts/bootstrap/uninstall_work From ab7aadbc21d5d18684e07a9ff9fe93a3309d4046 Mon Sep 17 00:00:00 2001 From: Pol Casacuberta Gil Date: Wed, 25 Feb 2026 18:28:52 +0100 Subject: [PATCH 4/8] feat: Integrate TUI checklist for uninstallation scripts across Arch, macOS, Manjaro, Ubuntu, and work machine configurations, enhancing user interaction and selection process. --- .local/scripts/bootstrap/uninstall_arch | 34 +++--- .local/scripts/bootstrap/uninstall_mac | 25 ++-- .local/scripts/bootstrap/uninstall_manjaro | 35 +++--- .local/scripts/bootstrap/uninstall_tui | 129 +++++++++++++++++++++ .local/scripts/bootstrap/uninstall_ubuntu | 33 +++--- .local/scripts/bootstrap/uninstall_work | 29 ++--- 6 files changed, 195 insertions(+), 90 deletions(-) create mode 100644 .local/scripts/bootstrap/uninstall_tui diff --git a/.local/scripts/bootstrap/uninstall_arch b/.local/scripts/bootstrap/uninstall_arch index 7f124d59..8dc5d6f0 100755 --- a/.local/scripts/bootstrap/uninstall_arch +++ b/.local/scripts/bootstrap/uninstall_arch @@ -6,27 +6,23 @@ set -euo pipefail ### VARIABLES scripts="$HOME/.local/scripts" source "$scripts/bootstrap/base_functions" +source "$scripts/bootstrap/uninstall_tui" source "$scripts/bootstrap/uninstall_arch_functions" ### UNINSTALLATION -info "Preparing to uninstall Arch bootstrap dependencies..." +run_selected_uninstalls "Arch Uninstaller" \ + base_uninstall "Base packages (cmake, bat, fzf, kitty, vim, ...)" OFF \ + arch_uninstall "Arch drivers & services (NVIDIA, CUPS, Bluetooth)" OFF \ + i3_uninstall "i3 window manager (i3-gaps, i3blocks, rofi, ...)" OFF \ + xmonad_uninstall "xmonad window manager (xmobar, trayer, dmenu)" OFF \ + vim_uninstall "Vim / Neovim extras (ctags, formatters, ...)" OFF \ + laptop_uninstall "Laptop packages (TLP)" OFF \ + dwall_uninstall "Dynamic wallpapers" OFF \ + papirus_uninstall "Papirus folder icons" OFF \ + emacs_uninstall "Emacs & Doom Emacs" OFF -read -r -p "This will remove base packages, drivers, i3, xmonad, vim plugins, and more. Are you sure? [y/N] " response -if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then - vim_uninstall - i3_uninstall - xmonad_uninstall - arch_uninstall - laptop_uninstall - dwall_uninstall - papirus_uninstall - base_uninstall - - if [ "$(basename "$SHELL")" == "zsh" ]; then - info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" - fi - - info "Uninstallation complete. A system reboot is recommended." -else - info "Uninstallation aborted." +if [ "$(basename "$SHELL")" == "zsh" ]; then + info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" fi + +info "Uninstallation complete. A system reboot is recommended." diff --git a/.local/scripts/bootstrap/uninstall_mac b/.local/scripts/bootstrap/uninstall_mac index 8ae9619f..c92c1a8b 100755 --- a/.local/scripts/bootstrap/uninstall_mac +++ b/.local/scripts/bootstrap/uninstall_mac @@ -6,22 +6,17 @@ set -euo pipefail ### VARIABLES scripts="$HOME/.local/scripts" source "$scripts/bootstrap/base_functions" +source "$scripts/bootstrap/uninstall_tui" source "$scripts/bootstrap/uninstall_mac_functions" ### UNINSTALLATION -info "Preparing to uninstall macOS bootstrap dependencies..." +run_selected_uninstalls "macOS Uninstaller" \ + cli_uninstall "CLI tools (bat, fzf, ripgrep, stow, ...)" OFF \ + fonts_uninstall "Nerd Fonts (Fira Code, Iosevka, Meslo, ...)" OFF \ + gui_apps_uninstall "GUI applications (Chrome, Spotify, VS Code, ...)" OFF \ + vim_uninstall "Vim / Neovim (macvim, neovim, plugins)" OFF \ + brew_cleanup "Run brew cleanup" OFF -read -r -p "This will remove CLI tools, fonts, GUI apps, and vim/neovim via Homebrew. Are you sure? [y/N] " response -if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then - vim_uninstall - gui_apps_uninstall - fonts_uninstall - cli_uninstall - brew_cleanup - - info "Uninstallation complete." - info "To fully remove Homebrew itself, run:" - info " /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)\"" -else - info "Uninstallation aborted." -fi +info "Uninstallation complete." +info "To fully remove Homebrew itself, run:" +info " /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)\"" diff --git a/.local/scripts/bootstrap/uninstall_manjaro b/.local/scripts/bootstrap/uninstall_manjaro index e1930015..319c187f 100755 --- a/.local/scripts/bootstrap/uninstall_manjaro +++ b/.local/scripts/bootstrap/uninstall_manjaro @@ -6,29 +6,24 @@ set -euo pipefail ### VARIABLES scripts="$HOME/.local/scripts" source "$scripts/bootstrap/base_functions" +source "$scripts/bootstrap/uninstall_tui" source "$scripts/bootstrap/uninstall_arch_functions" source "$scripts/bootstrap/uninstall_manjaro_functions" ### UNINSTALLATION -info "Preparing to uninstall Manjaro bootstrap dependencies..." +run_selected_uninstalls "Manjaro Uninstaller" \ + base_uninstall "Base packages (cmake, bat, fzf, kitty, vim, ...)" OFF \ + arch_uninstall "Arch drivers & services (NVIDIA, CUPS, Bluetooth)" OFF \ + arch_and_manjaro_uninstall "Shared Arch/Manjaro (printers, Samba)" OFF \ + manjaro_uninstall "Manjaro snaps & packages (IDEs, Spotify, ...)" OFF \ + i3_uninstall "i3 window manager (i3-gaps, i3blocks, rofi, ...)" OFF \ + xmonad_uninstall "xmonad window manager (xmobar, trayer, dmenu)" OFF \ + vim_uninstall "Vim / Neovim extras (ctags, formatters, ...)" OFF \ + emacs_uninstall "Emacs & Doom Emacs" OFF \ + laptop_uninstall "Laptop packages (TLP)" OFF -read -r -p "This will remove base packages, drivers, i3, xmonad, emacs, snaps, and more. Are you sure? [y/N] " response -if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then - emacs_uninstall - vim_uninstall - manjaro_uninstall - arch_and_manjaro_uninstall - i3_uninstall - xmonad_uninstall - arch_uninstall - laptop_uninstall - base_uninstall - - if [ "$(basename "$SHELL")" == "zsh" ]; then - info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" - fi - - info "Uninstallation complete. A system reboot is recommended." -else - info "Uninstallation aborted." +if [ "$(basename "$SHELL")" == "zsh" ]; then + info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" fi + +info "Uninstallation complete. A system reboot is recommended." diff --git a/.local/scripts/bootstrap/uninstall_tui b/.local/scripts/bootstrap/uninstall_tui new file mode 100644 index 00000000..9512a6ff --- /dev/null +++ b/.local/scripts/bootstrap/uninstall_tui @@ -0,0 +1,129 @@ +#! /usr/bin/env bash +# TUI checklist helper for uninstall scripts +# Tries whiptail, then dialog, then a plain-text fallback. +# Author: https://github.com/cuberhaus + +# show_checklist TITLE TAG1 DESC1 ON/OFF TAG2 DESC2 ON/OFF ... +# Displays a checkbox list and prints the selected tags (space-separated) +# to stdout. Returns 1 if the user cancels. +show_checklist() { + local title="$1"; shift + local -a items=("$@") + local count=$(( ${#items[@]} / 3 )) + local height=$(( count + 8 )) + (( height < 15 )) && height=15 + (( height > 24 )) && height=24 + + if command -v whiptail &>/dev/null; then + _checklist_whiptail "$title" "$height" "$count" "${items[@]}" + elif command -v dialog &>/dev/null; then + _checklist_dialog "$title" "$height" "$count" "${items[@]}" + else + _checklist_text "$title" "${items[@]}" + fi +} + +_checklist_whiptail() { + local title="$1" height="$2" count="$3"; shift 3 + local result + result=$(whiptail --title "$title" \ + --checklist "Use SPACE to toggle, ENTER to confirm:" \ + "$height" 76 "$count" "$@" 3>&1 1>&2 2>&3) || return 1 + echo "$result" | tr -d '"' +} + +_checklist_dialog() { + local title="$1" height="$2" count="$3"; shift 3 + # dialog expects on/off in lowercase + local -a fixed=() + for arg in "$@"; do + case "$arg" in + ON) fixed+=("on") ;; + OFF) fixed+=("off") ;; + *) fixed+=("$arg") ;; + esac + done + local tmpfile + tmpfile=$(mktemp) + dialog --title "$title" \ + --checklist "Use SPACE to toggle, ENTER to confirm:" \ + "$height" 76 "$count" "${fixed[@]}" 2>"$tmpfile" + local rc=$? + local result + result=$(<"$tmpfile") + rm -f "$tmpfile" + (( rc != 0 )) && return 1 + echo "$result" | tr -d '"' +} + +_checklist_text() { + local title="$1"; shift + local -a tags=() descs=() defaults=() + while (( $# >= 3 )); do + tags+=("$1"); descs+=("$2"); defaults+=("$3") + shift 3 + done + + echo "" >&2 + echo "=== $title ===" >&2 + echo "" >&2 + local j + for (( j = 0; j < ${#tags[@]}; j++ )); do + local marker=" " + [[ "${defaults[$j]}" == "ON" ]] && marker="*" + printf " [%s] %d) %s\n" "$marker" $(( j + 1 )) "${descs[$j]}" >&2 + done + echo "" >&2 + echo "Enter numbers to uninstall (space-separated), 'all' for [*] defaults, or 'q' to cancel:" >&2 + read -r selection + + [[ "$selection" == "q" || "$selection" == "Q" ]] && return 1 + + local -a selected=() + if [[ "$selection" == "all" || -z "$selection" ]]; then + for (( j = 0; j < ${#tags[@]}; j++ )); do + [[ "${defaults[$j]}" == "ON" ]] && selected+=("${tags[$j]}") + done + else + for num in $selection; do + local idx=$(( num - 1 )) + if (( idx >= 0 && idx < ${#tags[@]} )); then + selected+=("${tags[$idx]}") + fi + done + fi + echo "${selected[*]}" +} + +# run_selected_uninstalls TITLE TAG1 DESC1 ON/OFF TAG2 DESC2 ON/OFF ... +# Shows the checklist, asks for final confirmation, then calls each +# selected tag as a bash function. +run_selected_uninstalls() { + local title="$1"; shift + local choices + choices=$(show_checklist "$title" "$@") || { + info "Uninstallation aborted." + exit 0 + } + + if [[ -z "$choices" ]]; then + info "Nothing selected. Exiting." + exit 0 + fi + + info "Selected: $choices" + echo "" + read -r -p "Proceed with uninstallation? [y/N] " confirm + if [[ ! "$confirm" =~ ^([yY][eE][sS]|[yY])$ ]]; then + info "Uninstallation aborted." + exit 0 + fi + + for func in $choices; do + if declare -f "$func" &>/dev/null; then + "$func" + else + warn "Unknown component: $func — skipping." + fi + done +} diff --git a/.local/scripts/bootstrap/uninstall_ubuntu b/.local/scripts/bootstrap/uninstall_ubuntu index 9c859c5d..deee2d33 100755 --- a/.local/scripts/bootstrap/uninstall_ubuntu +++ b/.local/scripts/bootstrap/uninstall_ubuntu @@ -6,27 +6,22 @@ set -euo pipefail ### VARIABLES scripts="$HOME/.local/scripts" source "$scripts/bootstrap/base_functions" +source "$scripts/bootstrap/uninstall_tui" source "$scripts/bootstrap/uninstall_ubuntu_functions" ### UNINSTALLATION -info "Preparing to uninstall Ubuntu bootstrap dependencies..." +run_selected_uninstalls "Ubuntu Uninstaller" \ + base_uninstall "Base packages (build-essential, git, zsh, ...)" OFF \ + ubuntu_gui_uninstall "Ubuntu GUI apps (calibre, VLC, RStudio, ...)" OFF \ + chrome_uninstall "Google Chrome" OFF \ + snaps_uninstall "Snap packages (VS Code, Discord, IDEs, ...)" OFF \ + emacs_uninstall "Emacs & Doom Emacs" OFF \ + vim_uninstall "Vim / Neovim extras" OFF \ + brew_uninstall "Homebrew" OFF \ + cleanup "Run apt autoremove cleanup" OFF -read -r -p "This will remove dev tools, emacs, snaps, GUI apps, Chrome, and Homebrew. Are you sure? [y/N] " response -if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then - vim_uninstall - emacs_uninstall - snaps_uninstall - chrome_uninstall - ubuntu_gui_uninstall - base_uninstall - brew_uninstall - cleanup - - if [ "$(basename "$SHELL")" == "zsh" ]; then - info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" - fi - - info "Uninstallation complete. A system reboot is recommended." -else - info "Uninstallation aborted." +if [ "$(basename "$SHELL")" == "zsh" ]; then + info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" fi + +info "Uninstallation complete. A system reboot is recommended." diff --git a/.local/scripts/bootstrap/uninstall_work b/.local/scripts/bootstrap/uninstall_work index 829ea7b4..a90e6b7c 100755 --- a/.local/scripts/bootstrap/uninstall_work +++ b/.local/scripts/bootstrap/uninstall_work @@ -6,25 +6,20 @@ set -euo pipefail ### VARIABLES scripts="$HOME/.local/scripts" source "$scripts/bootstrap/base_functions" +source "$scripts/bootstrap/uninstall_tui" source "$scripts/bootstrap/uninstall_work_functions" ### UNINSTALLATION -info "Preparing to uninstall work bootstrap dependencies..." +run_selected_uninstalls "Work Machine Uninstaller" \ + nvidia_uninstall "NVIDIA drivers & tools" OFF \ + dev_tools_uninstall "Development tools (build-essential, git, ...)" OFF \ + node_uninstall "Node.js & global npm packages" OFF \ + python_uninstall "Python, pip & pipx packages" OFF \ + docker_uninstall "Docker CE & compose" OFF \ + gui_apps_uninstall "GUI apps (Chrome, VS Code, Cursor, Spotify, ...)" OFF -read -r -p "This will remove development tools, docker, node, python, cursor, and GUI apps. Are you sure? [y/N] " response -if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then - nvidia_uninstall - dev_tools_uninstall - node_uninstall - python_uninstall - docker_uninstall - gui_apps_uninstall - - if [ "$(basename "$SHELL")" == "zsh" ]; then - info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" - fi - - info "Uninstallation complete. A system reboot is recommended." -else - info "Uninstallation aborted." +if [ "$(basename "$SHELL")" == "zsh" ]; then + info "Currently using zsh. To revert to bash, run: chsh -s \$(which bash)" fi + +info "Uninstallation complete. A system reboot is recommended." From c7324b21baceccfa2678d92b204ba71191f28408 Mon Sep 17 00:00:00 2001 From: Pol Casacuberta Gil Date: Wed, 25 Feb 2026 19:04:00 +0100 Subject: [PATCH 5/8] feat: Add GitHub CLI installation to bootstrap and uninstall scripts for Arch, macOS, and Ubuntu, enhancing development toolset. --- .local/scripts/bootstrap/arch_functions | 1 + .local/scripts/bootstrap/mac_functions | 1 + .local/scripts/bootstrap/ubuntu_functions | 3 ++- .../scripts/bootstrap/uninstall_arch_functions | 2 +- .../scripts/bootstrap/uninstall_mac_functions | 2 +- .../bootstrap/uninstall_ubuntu_functions | 2 +- .../scripts/bootstrap/uninstall_work_functions | 10 +++++++--- .local/scripts/bootstrap/work_functions | 18 +++++++++++++----- 8 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.local/scripts/bootstrap/arch_functions b/.local/scripts/bootstrap/arch_functions index 1c0b1ebb..292143e3 100644 --- a/.local/scripts/bootstrap/arch_functions +++ b/.local/scripts/bootstrap/arch_functions @@ -53,6 +53,7 @@ base_install () { $pac gcc # Cpp $pac gdb # debugging c++ $pac git # It's git bro + $pac github-cli # GitHub CLI $pac gnome-calculator # Calculator $pac gnome-font-viewer # Font viewer $pac gnome-keyring # https://wiki.archlinux.org/title/GNOME/Keyring diff --git a/.local/scripts/bootstrap/mac_functions b/.local/scripts/bootstrap/mac_functions index 3ca57f42..8c884e41 100755 --- a/.local/scripts/bootstrap/mac_functions +++ b/.local/scripts/bootstrap/mac_functions @@ -29,6 +29,7 @@ mac_install () { brew install eza # "ls" on steroids (exa replacement) brew install flex brew install fzf # Fuzzy Finder + brew install gh # GitHub CLI brew install git # Git brew install go brew install gpg diff --git a/.local/scripts/bootstrap/ubuntu_functions b/.local/scripts/bootstrap/ubuntu_functions index d89ca8cf..351132a2 100644 --- a/.local/scripts/bootstrap/ubuntu_functions +++ b/.local/scripts/bootstrap/ubuntu_functions @@ -17,7 +17,8 @@ base_install () { ## For windows install it's good to have this $apt file $apt fonts-powerline $apt fzf # Fuzzy finder - $apt git + $apt git + $apt gh # GitHub CLI $apt gnome-shell $apt htop # Show system resources $apt inkscape diff --git a/.local/scripts/bootstrap/uninstall_arch_functions b/.local/scripts/bootstrap/uninstall_arch_functions index f34d467f..e2bf2a9c 100644 --- a/.local/scripts/bootstrap/uninstall_arch_functions +++ b/.local/scripts/bootstrap/uninstall_arch_functions @@ -13,7 +13,7 @@ base_uninstall() { $pac_remove cmake opencl-headers bazel cudnn cuda conky \ adapta-gtk-theme arc-gtk-theme arc-icon-theme \ - bat biber breeze calibre cron dconf-editor dex discord dnsutils \ + bat biber breeze calibre cron dconf-editor dex discord dnsutils github-cli \ dunst eza exfat-utils file-roller firefox fzf gcc gdb \ gnome-calculator gnome-font-viewer gnome-keyring gtk2 gtk3 \ gucharmap gvim hardinfo cpu-x htop inotify-tools kcolorchooser \ diff --git a/.local/scripts/bootstrap/uninstall_mac_functions b/.local/scripts/bootstrap/uninstall_mac_functions index 5cf62dce..74586800 100644 --- a/.local/scripts/bootstrap/uninstall_mac_functions +++ b/.local/scripts/bootstrap/uninstall_mac_functions @@ -9,7 +9,7 @@ cli_uninstall() { info "Uninstalling CLI tools..." local formulae=( - ack astyle bat bison cmake eza flex fzf git go gpg htop llvm mono + ack astyle bat bison cmake eza flex fzf gh git go gpg htop llvm mono ncdu neofetch p7zip pinentry-mac pkg-config ranger w3m rclone ripgrep smimesign sox stow swig the_silver_searcher unrar wget yarn ) diff --git a/.local/scripts/bootstrap/uninstall_ubuntu_functions b/.local/scripts/bootstrap/uninstall_ubuntu_functions index c51753ef..088acc2f 100644 --- a/.local/scripts/bootstrap/uninstall_ubuntu_functions +++ b/.local/scripts/bootstrap/uninstall_ubuntu_functions @@ -12,7 +12,7 @@ base_uninstall() { info "Uninstalling base packages..." $apt_remove autoconf automake bat build-essential cmake curl eza file \ - fonts-powerline fzf git gnome-shell htop inkscape laptop-detect \ + fonts-powerline fzf git gh gnome-shell htop inkscape laptop-detect \ libgtk-3-dev ncdu neovim nodejs npm optipng pkg-config python3 \ python3-pip ranger w3m rclone ruby-dev samba-common-bin sassc \ silversearcher-ag stow subversion tmux vim-gtk yarn zsh eog sshfs || true diff --git a/.local/scripts/bootstrap/uninstall_work_functions b/.local/scripts/bootstrap/uninstall_work_functions index a8b5d1a6..58456506 100755 --- a/.local/scripts/bootstrap/uninstall_work_functions +++ b/.local/scripts/bootstrap/uninstall_work_functions @@ -28,8 +28,8 @@ dev_tools_uninstall() { info "Uninstalling dev tools..." $apt_remove build-essential cmake curl git jq tree wget zsh stow vim-gtk3 neovim \ bat eza fzf htop ncdu ranger ripgrep fd-find silversearcher-ag w3m shellcheck \ - unzip eog flameshot rclone sshfs - + unzip eog flameshot rclone sshfs gh || true + # Unset global git config git config --global --unset credential.helper || true } @@ -85,12 +85,16 @@ gui_apps_uninstall() { info "Uninstalling GUI applications..." # apt packages - $apt_remove firefox vlc google-chrome-stable code antigravity warp-terminal libreoffice caffeine libfuse2 || true + $apt_remove firefox vlc google-chrome-stable code antigravity warp-terminal \ + libreoffice caffeine dconf-editor libfuse2 || true # Snaps sudo snap remove obsidian || true sudo snap remove spotify || true sudo snap remove discord || true + sudo snap remove walc || true + sudo snap remove sublime-text || true + sudo snap remove sublime-merge || true # Remove VS Code repo sudo rm -f /etc/apt/sources.list.d/vscode.list diff --git a/.local/scripts/bootstrap/work_functions b/.local/scripts/bootstrap/work_functions index 4d5639ea..b991237c 100644 --- a/.local/scripts/bootstrap/work_functions +++ b/.local/scripts/bootstrap/work_functions @@ -76,11 +76,10 @@ dev_tools_install() { $apt rclone # Sync files to/from cloud storage $apt sshfs # Mount remote filesystems over SSH + $apt gh # GitHub CLI + # Git config git config --global credential.helper store - - # Add more dev tools below as needed: - # $apt } ############################################################### @@ -286,6 +285,15 @@ EOF # Caffeine (prevent screen from going to sleep) $apt caffeine - # Add more GUI apps below as needed: - # $apt + # GNOME advanced settings + $apt dconf-editor + + # Sublime Text + snap list sublime-text &>/dev/null 2>&1 || sudo snap install sublime-text --classic + + # Sublime Merge + snap list sublime-merge &>/dev/null 2>&1 || sudo snap install sublime-merge --classic + + # Walc (WhatsApp Linux client) + snap list walc &>/dev/null 2>&1 || sudo snap install walc } From 2520cdce97037d7d29d8d654e487c4483fc8f889 Mon Sep 17 00:00:00 2001 From: Pol Casacuberta Gil Date: Wed, 25 Feb 2026 19:13:34 +0100 Subject: [PATCH 6/8] feat: Add high DPI screen configuration to bootstrap script and implement related function for GNOME, enhancing usability on high-resolution displays. --- .local/scripts/bootstrap/tmp/emacs_ubuntu.sh | 8 -------- .local/scripts/bootstrap/work | 5 +++++ .local/scripts/bootstrap/work_functions | 17 +++++++++++++++++ .../bootstrap/xterm-256color-italic.terminfo | 4 ---- 4 files changed, 22 insertions(+), 12 deletions(-) delete mode 100755 .local/scripts/bootstrap/tmp/emacs_ubuntu.sh delete mode 100644 .local/scripts/bootstrap/xterm-256color-italic.terminfo diff --git a/.local/scripts/bootstrap/tmp/emacs_ubuntu.sh b/.local/scripts/bootstrap/tmp/emacs_ubuntu.sh deleted file mode 100755 index cc034110..00000000 --- a/.local/scripts/bootstrap/tmp/emacs_ubuntu.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /usr/bin/env bash - -scripts="$HOME/.local/scripts" -source "$scripts/bootstrap/ubuntu_functions" - - -emacs_install - diff --git a/.local/scripts/bootstrap/work b/.local/scripts/bootstrap/work index bdff934b..007b6b12 100755 --- a/.local/scripts/bootstrap/work +++ b/.local/scripts/bootstrap/work @@ -26,6 +26,11 @@ python_install docker_install gui_apps_install +read -r -p "Do you have a high DPI screen? [y/N] " hidpi +if [[ "$hidpi" =~ ^([yY][eE][sS]|[yY])$ ]]; then + high_dpi_screen +fi + if [ "$(basename "$SHELL")" != "zsh" ]; then chsh -s "$(which zsh)" fi diff --git a/.local/scripts/bootstrap/work_functions b/.local/scripts/bootstrap/work_functions index b991237c..c8742bad 100644 --- a/.local/scripts/bootstrap/work_functions +++ b/.local/scripts/bootstrap/work_functions @@ -297,3 +297,20 @@ EOF # Walc (WhatsApp Linux client) snap list walc &>/dev/null 2>&1 || sudo snap install walc } + +############################################################### +# => High DPI screen tweaks (GNOME) +############################################################### + +# This has some problems with some apps that are seen very tiny, it is definitely not the perfect solution +high_dpi_screen() { + # To fix high dpi screens, two options, go to 200% scaling, or fractional scaling, fractional scaling causes blurry text, more power usage, lower speed. + + # We instead increase text scaling + gsettings set org.gnome.desktop.interface text-scaling-factor 1.3 + + # Increase cursor size Settings-> Accesibility -> Cursor size -> Medium + gsettings set org.gnome.desktop.interface cursor-size 35 + # Set icons to Large 'small' to set it smaller + gsettings set org.gnome.shell.extensions.ding icon-size 'large' +} diff --git a/.local/scripts/bootstrap/xterm-256color-italic.terminfo b/.local/scripts/bootstrap/xterm-256color-italic.terminfo deleted file mode 100644 index 68407aee..00000000 --- a/.local/scripts/bootstrap/xterm-256color-italic.terminfo +++ /dev/null @@ -1,4 +0,0 @@ -# A xterm-256color based TERMINFO that adds the escape sequences for italic. -xterm-256color-italic|xterm with 256 colors and italic, - sitm=\E[3m, ritm=\E[23m, - use=xterm-256color, From 326f9b80f3377572ad4c8326da5a1a041154604a Mon Sep 17 00:00:00 2001 From: Pol Casacuberta Gil Date: Mon, 2 Mar 2026 10:51:19 +0100 Subject: [PATCH 7/8] feat: Enhance bootstrap scripts by adding hardware information tools installation for improved system diagnostics and user experience. --- .local/scripts/bootstrap/uninstall_work_functions | 2 +- .local/scripts/bootstrap/work_functions | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.local/scripts/bootstrap/uninstall_work_functions b/.local/scripts/bootstrap/uninstall_work_functions index 58456506..47c402b2 100755 --- a/.local/scripts/bootstrap/uninstall_work_functions +++ b/.local/scripts/bootstrap/uninstall_work_functions @@ -28,7 +28,7 @@ dev_tools_uninstall() { info "Uninstalling dev tools..." $apt_remove build-essential cmake curl git jq tree wget zsh stow vim-gtk3 neovim \ bat eza fzf htop ncdu ranger ripgrep fd-find silversearcher-ag w3m shellcheck \ - unzip eog flameshot rclone sshfs gh || true + unzip eog flameshot rclone sshfs gh hardinfo cpu-x neofetch || true # Unset global git config git config --global --unset credential.helper || true diff --git a/.local/scripts/bootstrap/work_functions b/.local/scripts/bootstrap/work_functions index c8742bad..6052940d 100644 --- a/.local/scripts/bootstrap/work_functions +++ b/.local/scripts/bootstrap/work_functions @@ -78,6 +78,11 @@ dev_tools_install() { $apt gh # GitHub CLI + # Hardware info + $apt hardinfo # GUI hardware info & benchmarks + $apt cpu-x # CPU-Z style hardware viewer + $apt neofetch # Terminal system info summary + # Git config git config --global credential.helper store } From cf1a43a58eba9046f601976c73195a12f4575a00 Mon Sep 17 00:00:00 2001 From: Pol Casacuberta Gil Date: Mon, 2 Mar 2026 13:22:08 +0100 Subject: [PATCH 8/8] feat: Update high DPI screen detection in bootstrap script to check current scaling factor before prompting user, enhancing usability for high-resolution displays. --- .local/scripts/bootstrap/work | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.local/scripts/bootstrap/work b/.local/scripts/bootstrap/work index 007b6b12..5736a865 100755 --- a/.local/scripts/bootstrap/work +++ b/.local/scripts/bootstrap/work @@ -26,9 +26,12 @@ python_install docker_install gui_apps_install -read -r -p "Do you have a high DPI screen? [y/N] " hidpi -if [[ "$hidpi" =~ ^([yY][eE][sS]|[yY])$ ]]; then - high_dpi_screen +current_scale=$(gsettings get org.gnome.desktop.interface text-scaling-factor 2>/dev/null || echo "1.0") +if [[ "$current_scale" != "1.3" ]]; then + read -r -p "Do you have a high DPI screen? [y/N] " hidpi + if [[ "$hidpi" =~ ^([yY][eE][sS]|[yY])$ ]]; then + high_dpi_screen + fi fi if [ "$(basename "$SHELL")" != "zsh" ]; then