From ff36c13ae85e367d2fe6050a8d9a45dddf546602 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:41:16 +0900 Subject: created bin/wineinstaller, created bin/wineuninstaller --- ar/.local/bin/wineuninstaller | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 ar/.local/bin/wineuninstaller (limited to 'ar/.local/bin/wineuninstaller') 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." -- cgit v1.2.3