From 1070a87a47c10c9e028db0929498992c4317fce0 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 7 Feb 2026 11:05:56 +0100 Subject: [PATCH] Add option to remove all preinstalls To get a bare-bones Omarchy --- bin/omarchy-menu | 3 ++- bin/omarchy-remove-all | 24 +++++++++++++++++++++++ bin/omarchy-tui-remove-all | 36 +++++++++++++++++++++++++++++++++++ bin/omarchy-webapp-remove-all | 36 +++++++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100755 bin/omarchy-remove-all create mode 100755 bin/omarchy-tui-remove-all create mode 100755 bin/omarchy-webapp-remove-all diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 2bd21d21..cb4c5a4b 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -431,11 +431,12 @@ show_install_elixir_menu() { } show_remove_menu() { - case $(menu "Remove" "󰣇 Package\n Web App\n TUI\n󰵮 Development\n Dictation\n󰸌 Theme\n󰍲 Windows\n󰈷 Fingerprint\n Fido2") in + case $(menu "Remove" "󰣇 Package\n Web App\n TUI\n󰵮 Development\n󰏓 Preinstalls\n Dictation\n󰸌 Theme\n󰍲 Windows\n󰈷 Fingerprint\n Fido2") in *Package*) terminal omarchy-pkg-remove ;; *Web*) present_terminal omarchy-webapp-remove ;; *TUI*) present_terminal omarchy-tui-remove ;; *Development*) show_remove_development_menu ;; + *Preinstalls*) present_terminal omarchy-remove-all ;; *Dictation*) present_terminal omarchy-voxtype-remove ;; *Theme*) present_terminal omarchy-theme-remove ;; *Windows*) present_terminal "omarchy-windows-vm remove" ;; diff --git a/bin/omarchy-remove-all b/bin/omarchy-remove-all new file mode 100755 index 00000000..1d532bf3 --- /dev/null +++ b/bin/omarchy-remove-all @@ -0,0 +1,24 @@ +#!/bin/bash + +# Remove preinstalled Omarchy applications (web apps, TUIs, and selected packages). +# This removes all web apps, TUIs, plus specific desktop applications. + +if gum confirm "Are you sure you want to remove all preinstalled web apps, TUI wrappers, and desktop applications?"; then + echo -e "Removing preinstalled Omarchy applications...\n" + + omarchy-webapp-remove-all + omarchy-tui-remove-all + + omarchy-pkg-drop \ + typora \ + spotify \ + libreoffice-fresh \ + 1password-beta \ + 1password-cli \ + xournalpp \ + signal-desktop \ + pinta \ + obsidian \ + obs-studio \ + kdenlive +fi diff --git a/bin/omarchy-tui-remove-all b/bin/omarchy-tui-remove-all new file mode 100755 index 00000000..8a696d84 --- /dev/null +++ b/bin/omarchy-tui-remove-all @@ -0,0 +1,36 @@ +#!/bin/bash + +# Remove all TUIs installed via omarchy-tui-install. +# Identifies TUIs by their Exec pattern (xdg-terminal-exec --app-id=TUI.). + +set -e + +APP_DIR="${1:-$HOME/.local/share/applications}" +ICON_DIR="$HOME/.local/share/applications/icons" + +echo "Scanning for TUIs in $APP_DIR..." + +tui_desktop_files=() +while IFS= read -r -d '' file; do + if grep -q "Exec=xdg-terminal-exec --app-id=TUI\." "$file" 2>/dev/null; then + tui_desktop_files+=("$file") + fi +done < <(find "$APP_DIR" -maxdepth 1 -name "*.desktop" -print0 2>/dev/null) + +if [[ ${#tui_desktop_files[@]} -eq 0 ]]; then + echo "No TUIs found." + exit 0 +fi + +for file in "${tui_desktop_files[@]}"; do + app_name=$(basename "$file" .desktop) + echo "Removing TUI: $app_name" + rm -f "$file" + rm -f "$ICON_DIR/$app_name.png" +done + +if command -v update-desktop-database &>/dev/null; then + update-desktop-database "$APP_DIR" &>/dev/null || true +fi + +echo "TUIs removed successfully." diff --git a/bin/omarchy-webapp-remove-all b/bin/omarchy-webapp-remove-all new file mode 100755 index 00000000..9cb8f4e3 --- /dev/null +++ b/bin/omarchy-webapp-remove-all @@ -0,0 +1,36 @@ +#!/bin/bash + +# Remove all web apps installed via omarchy-webapp-install. +# Identifies web apps by their Exec pattern (omarchy-launch-webapp or omarchy-webapp-handler). + +set -e + +APP_DIR="${1:-$HOME/.local/share/applications}" +ICON_DIR="$HOME/.local/share/applications/icons" + +echo "Scanning for web apps in $APP_DIR..." + +webapp_desktop_files=() +while IFS= read -r -d '' file; do + if grep -q "Exec=omarchy-launch-webapp\|Exec=omarchy-webapp-handler" "$file" 2>/dev/null; then + webapp_desktop_files+=("$file") + fi +done < <(find "$APP_DIR" -maxdepth 1 -name "*.desktop" -print0 2>/dev/null) + +if [[ ${#webapp_desktop_files[@]} -eq 0 ]]; then + echo "No web apps found." + exit 0 +fi + +for file in "${webapp_desktop_files[@]}"; do + app_name=$(basename "$file" .desktop) + echo "Removing web app: $app_name" + rm -f "$file" + rm -f "$ICON_DIR/$app_name.png" +done + +if command -v update-desktop-database &>/dev/null; then + update-desktop-database "$APP_DIR" &>/dev/null || true +fi + +echo "Web apps removed successfully."