diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-03-19 10:41:16 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-03-19 10:41:16 +0900 |
| commit | ff36c13ae85e367d2fe6050a8d9a45dddf546602 (patch) | |
| tree | dc0ba586f645422a6982da34223e676dfea65b75 /ar/.local/bin/wineuninstaller | |
| parent | 081c0c0244ea221952bd6c2768371e9b099b8a16 (diff) | |
created bin/wineinstaller, created bin/wineuninstaller
Diffstat (limited to 'ar/.local/bin/wineuninstaller')
| -rwxr-xr-x | ar/.local/bin/wineuninstaller | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ar/.local/bin/wineuninstaller b/ar/.local/bin/wineuninstaller new file mode 100755 index 0000000..dbdd914 --- /dev/null +++ b/ar/.local/bin/wineuninstaller @@ -0,0 +1,46 @@ +#!/bin/sh +# POSIX-compliant Wine application uninstaller +# Usage: wineuninstaller [app_name] + +set -e + +WINE_BASE="${WINEPREFIX:-${XDG_DATA_HOME:-${HOME}/.local/share}/wine}" + +# Pick app with fzf if no argument given +if [ -z "$1" ]; then + APP_NAME="$( + find "${WINE_BASE}" -mindepth 1 -maxdepth 1 -type d 2>/dev/null \ + | xargs -I{} basename {} \ + | fzf --prompt="Uninstall> " + )" +else + APP_NAME="$1" +fi + +[ -z "${APP_NAME}" ] && exit 0 + +WINEPREFIX="${WINE_BASE}/${APP_NAME}" +LAUNCHER="${HOME}/.local/bin/${APP_NAME}" +DESKTOP_FILE="${XDG_DATA_HOME:-${HOME}/.local/share}/applications/${APP_NAME}.desktop" + +echo "Uninstalling: ${APP_NAME}" + +# Remove Wine prefix +if [ -d "${WINEPREFIX}" ]; then + rm -rf "${WINEPREFIX}" + echo "Removed: ${WINEPREFIX}" +fi + +# Remove launcher script +if [ -f "${LAUNCHER}" ]; then + rm -f "${LAUNCHER}" + echo "Removed: ${LAUNCHER}" +fi + +# Remove desktop entry +if [ -f "${DESKTOP_FILE}" ]; then + rm -f "${DESKTOP_FILE}" + echo "Removed: ${DESKTOP_FILE}" +fi + +echo "Done." |
