geforcenow-native/uninstall-geforcenow-native.sh
28allday ab845890ae Initial commit: install/uninstall scripts for NVIDIA GeForce NOW flatpak
Targets the official com.nvidia.geforcenow flatpak (not the community
electron build). Forces XWayland for Hyprland compatibility and injects
a marker-bracketed windowrule into ~/.config/hypr/hyprland.conf so it
takes effect on Omarchy (where ~/.config/hypr/windowrules.conf is not
auto-sourced).

Updated for Hyprland 0.54.3:
- Uses modern `windowrule = ...` syntax (drops deprecated windowrulev2).
- Idempotent marker block in hyprland.conf, with hyprctl reload.
- Restarts Elephant so Walker picks up the new .desktop entry.
2026-05-03 14:03:40 +01:00

97 lines
3.2 KiB
Bash
Executable file

#!/bin/bash
# GeForce NOW Uninstaller for Arch Linux / Hyprland (Omarchy-aware)
# Removes the official NVIDIA GeForce NOW flatpak and everything the
# installer added. Leaves Flatpak / Flathub alone (other apps may use them).
echo "=== GeForce NOW Uninstaller ==="
echo ""
# 1/6 - Flatpak app
echo "[1/6] Removing GeForce NOW flatpak..."
if flatpak uninstall -y --user com.nvidia.geforcenow 2>/dev/null; then
echo " Removed."
else
echo " Not installed."
fi
# 2/6 - Flatpak remote
echo "[2/6] Removing GeForce NOW flatpak remote..."
if flatpak remote-delete --user GeForceNOW 2>/dev/null; then
echo " Removed."
else
echo " Not present."
fi
# 3/6 - Launcher
echo "[3/6] Removing launcher script..."
if [ -e "$HOME/.local/bin/geforcenow" ]; then
rm -f "$HOME/.local/bin/geforcenow"
echo " Removed."
else
echo " Not present."
fi
# 4/6 - Desktop entries
echo "[4/6] Removing desktop entries..."
rm -f "$HOME/.local/share/applications/com.nvidia.geforcenow.desktop"
rm -f "$HOME/.local/share/applications/geforcenow.desktop"
rm -f "$HOME/Desktop/com.nvidia.geforcenow.desktop" 2>/dev/null
update-desktop-database "$HOME/.local/share/applications/" 2>/dev/null
echo " Removed."
# 5/6 - App data
echo "[5/6] Removing app data..."
if [ -d "$HOME/.var/app/com.nvidia.geforcenow" ]; then
rm -rf "$HOME/.var/app/com.nvidia.geforcenow"
echo " Removed."
else
echo " Not present."
fi
# 6/6 - Hyprland window rule
echo "[6/6] Removing Hyprland window rule..."
HYPR_CONF_DIR="$HOME/.config/hypr"
BEGIN_MARKER="# >>> geforcenow-native >>>"
END_MARKER="# <<< geforcenow-native <<<"
# Modern: strip the marker block from hyprland.conf
if [ -f "$HYPR_CONF_DIR/hyprland.conf" ] && grep -q "$BEGIN_MARKER" "$HYPR_CONF_DIR/hyprland.conf" 2>/dev/null; then
sed -i "/$BEGIN_MARKER/,/$END_MARKER/d" "$HYPR_CONF_DIR/hyprland.conf"
echo " Removed marker block from $HYPR_CONF_DIR/hyprland.conf"
fi
# Legacy: scrub any stray pre-marker lines from older installs
for conf in "$HYPR_CONF_DIR/hyprland.conf" "$HYPR_CONF_DIR/windowrules.conf" "$HYPR_CONF_DIR/windows.conf"; do
if [ -f "$conf" ] && grep -q "GeForceNOW" "$conf" 2>/dev/null; then
sed -i '/# GeForce NOW/d' "$conf"
sed -i '/GeForceNOW/d' "$conf"
echo " Cleaned legacy lines from $conf"
fi
done
# Reload Hyprland if running
hypr_root="${XDG_RUNTIME_DIR:-/run/user/$UID}/hypr"
if [ -d "$hypr_root" ]; then
for sock in "$hypr_root"/*/.socket.sock; do
[ -e "$sock" ] || continue
inst="${sock%/.socket.sock}"; inst="${inst##*/}"
HYPRLAND_INSTANCE_SIGNATURE="$inst" hyprctl reload >/dev/null 2>&1 || true
break
done
fi
# Walker / Elephant refresh
rm -rf "$HOME/.cache/walker" 2>/dev/null
systemctl --user restart elephant.service 2>/dev/null || true
# Reset flatpak overrides (no-op if app already gone)
flatpak override --user --reset com.nvidia.geforcenow 2>/dev/null || true
echo ""
echo "=== Uninstall Complete ==="
echo ""
echo "GeForce NOW has been removed from your system."
echo ""
echo "Note: Flatpak and Flathub were left installed (other apps may use them)."
echo " To also remove Flatpak completely, run:"
echo " sudo pacman -Rns flatpak"