Add files via upload

This commit is contained in:
Mohamed Mahjoub
2026-09-11 20:30:34 +01:00
committed by GitHub
parent 07f3af3441
commit c7c02edb60
35 changed files with 3975 additions and 13 deletions

33
uninstall.sh Normal file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
# Removes MacroPad. Your pad keeps its bindings; they live on the pad itself.
set -euo pipefail
DATA="${XDG_DATA_HOME:-$HOME/.local/share}"
CONF="${XDG_CONFIG_HOME:-$HOME/.config}/macropad"
RULE="/etc/udev/rules.d/60-macropad.rules"
ask() {
local answer=""
if { exec 3</dev/tty; } 2>/dev/null; then
read -r -p " $1 [y/N] " answer <&3 || true
exec 3<&-
fi
case "$answer" in [yY]*) return 0 ;; *) return 1 ;; esac
}
rm -rf "$DATA/macropad"
rm -f "$HOME/.local/bin/macropad" "$DATA/applications/macropad.desktop" \
"$DATA/icons/hicolor/scalable/apps/macropad.svg"
command -v kbuildsycoca6 >/dev/null && kbuildsycoca6 >/dev/null 2>&1 || true
echo "Removed the app and its menu entry."
if [ -d "$CONF" ] && ask "Also delete the app's memory of what's on your pad ($CONF)?"; then
rm -rf "$CONF"
echo "Deleted $CONF."
fi
if [ -f "$RULE" ] && ask "Also remove the USB permission rule? (asks for your password)"; then
sudo rm -f "$RULE"
sudo udevadm control --reload-rules
echo "Removed $RULE."
fi
echo "Done. The pad keeps working with whatever you last wrote to it."