Files
socktop-swipe/uninstall.sh
T

45 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/sh
# Remove socktop-swipe. Leaves lisgd, the 'input' group membership and your
# socktop profiles alone -- those are useful independently and removing them
# could break other things.
#
# ./uninstall.sh remove scripts, config and the X ignore rule
# ./uninstall.sh --keep-config leave the config file in place
set -eu
PREFIX=${PREFIX:-/usr/local}
BIN="$PREFIX/bin"
CONF="$PREFIX/etc/socktop-swipe.env"
XCONF=/etc/X11/xorg.conf.d/99-ignore-touch-socktop-swipe.conf
keep_config=no
[ "${1:-}" = "--keep-config" ] && keep_config=yes
# Stop anything running. -x matches the exact process name; -f would also match
# this script's own command line and kill the shell running it.
pkill -x lisgd 2>/dev/null || true
for f in socktop-rack socktop-swipe socktop-gestures; do
if [ -e "$BIN/$f" ]; then
sudo rm -f "$BIN/$f"
echo "removed $BIN/$f"
fi
done
if [ "$keep_config" = no ] && [ -e "$CONF" ]; then
sudo rm -f "$CONF"
echo "removed $CONF"
fi
if [ -e "$XCONF" ]; then
sudo rm -f "$XCONF"
echo "removed $XCONF (touch returns to X after the next X restart)"
fi
echo
echo "Left in place on purpose:"
echo " * lisgd -- remove with: sudo make -C ~/src/lisgd uninstall"
echo " * 'input' group -- remove with: sudo gpasswd -d $(id -un) input"
echo " * i3 autostart -- delete the 'socktop-swipe' block in ~/.config/i3/config"
echo " * socktop profiles -- ~/.config/socktop/profiles.json"