omarchy/bin/omarchy-webapp-remove
Ankur Kotwal 5e3d0d89a5
Reflect default browser changes in bindings and webapps (#871)
* Abstract default browser to omarchy-browser (a wrapper)

* Fix the omarchy-browser command as it used to loop. Extract info from the browser .desktop files.

* Clean up and fix bugs

* Cleanup unused change

* Fix indentation

* Separate out omarchy-browser from omarchy-webapp so that we don't break webapps for browsers other than Chromium or Google Chrome.

* Fix incorrect function call

* Add a migration script

* Migration script fixes

* Simplify the browser and webapp commands. Rename commands to align with launch terminology.

* Add support for Microsoft Edge, Opera and Vivaldi

* Fix errors

* Remove --name and --class -- They're not respected when --app is defined

* We don't ship with Chrome

* Simplify launchers

* Use launch commands everywhere

---------

Co-authored-by: Ryan Hughes <ryan@heyoodle.com>
2025-08-23 17:28:45 +02:00

37 lines
857 B
Bash
Executable File

#!/bin/bash
ICON_DIR="$HOME/.local/share/applications/icons"
DESKTOP_DIR="$HOME/.local/share/applications/"
if [ "$#" -ne 1 ]; then
# Find all web apps
while IFS= read -r -d '' file; do
if grep -q '^Exec=.*omarchy-launch-webapp.*' "$file"; then
WEB_APPS+=("$(basename "${file%.desktop}")")
fi
done < <(find "$DESKTOP_DIR" -name '*.desktop' -print0)
if ((${#WEB_APPS[@]})); then
IFS=$'\n' SORTED_WEB_APPS=($(sort <<<"${WEB_APPS[*]}"))
unset IFS
APP_NAME=$(gum choose --header "Select web app to remove..." "${SORTED_WEB_APPS[@]}")
else
echo "No web apps to remove."
exit 1
fi
else
APP_NAME="$1"
fi
if [[ -z "$APP_NAME" ]]; then
echo "You must provide web app name."
exit 1
fi
rm "$DESKTOP_DIR/$APP_NAME.desktop"
rm "$ICON_DIR/$APP_NAME.png"
if [ "$#" -ne 1 ]; then
echo -e "Removed $APP_NAME\n"
fi