v2 release prep: installer, README, packaging, notes; retire the v1 scripts

Installer rewritten around a preflight: distro, package manager, display
manager, window manager, terminal, tmux, cargo, git, screen locker, touch
device, device permissions and free disk are all checked BEFORE anything is
installed, and the total cost is printed once for a single confirmation.
Prompts read /dev/tty so they still work when the script is piped from curl,
and fall back to defaults with a notice when there is no terminal at all.

Several "[ test ] && action" statements were set -e landmines: under set -e an
AND-OR list that ends up false aborts the script, so a box with no lightdm, no
i3 or nothing to install would have exited silently partway through detection
-- which is exactly the fresh-Debian case the installer exists for. Rewritten
as if-statements and verified against a stripped PATH with no tmux, cargo, git
or package manager present. Also fixed cargo detection reporting blank instead
of NOT INSTALLED: the status of `cargo --version | cut` is cut's, and cut
succeeds on empty input, so the fallback never fired.

Device access now defaults to a udev rule matching touchscreens only, rather
than the input group, which grants access to every input device including the
keyboard and needs a full logout.

README rewritten for someone who has not seen the project: what the photo
shows, the hardware, install, then a config built up step by step, each step
with the YAML and the resulting map. Every example is verified verbatim
against the binary, and every relative link resolves. The mechanism and the
reasoning move to notes/: DESIGN.md, HARDWARE-NOTES.md, V1-BASH.md, TODO.md.

cad/README.md was a verbatim copy of the one inside
geeekpi_rack_adapter_release_v1/, so every path in it -- including the
screenshot -- was broken from where it sits. Corrected to its own level, and
it now states once that the 9-inch screen, the 10-inch mini-rack mount and the
19-inch rack are three different measurements.

The v1 shell implementation is removed; it stays recoverable at tag v1.2 and
notes/V1-BASH.md carries the setting-by-setting migration table.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
jasonwitty
2026-09-09 13:08:42 -07:00
co-authored by Claude Opus 5
parent 9f082b52b7
commit ce6acec299
29 changed files with 1388 additions and 1089 deletions
+61 -41
View File
@@ -1,56 +1,76 @@
#!/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.
# Remove socktop-swipe.
#
# ./uninstall.sh remove scripts, config and the X ignore rule
# ./uninstall.sh --keep-config leave the config file in place
# ./uninstall.sh binary, config, udev rule, X snippets, autologin
# ./uninstall.sh --keep-config leave the config file alone
#
# The Rust toolchain, tmux, socktop and friends, and your 'input' group
# membership are all left in place: they are useful independently, and removing
# them could break something else. What was skipped is printed at the end.
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
BCONF=/etc/X11/xorg.conf.d/10-no-blanking-socktop-swipe.conf
LCONF=/etc/lightdm/lightdm.conf.d/50-autologin-socktop-swipe.conf
BIN="$PREFIX/bin/socktop-swipe"
CONF_DIR="$HOME/.config/socktop-swipe"
CONF="$CONF_DIR/config.yaml"
UDEV=/etc/udev/rules.d/70-socktop-swipe.rules
XBLANK=/etc/X11/xorg.conf.d/10-no-blanking-socktop-swipe.conf
XIGNORE=/etc/X11/xorg.conf.d/99-ignore-touch-socktop-swipe.conf
LIGHTDM=/etc/lightdm/lightdm.conf.d/50-autologin-socktop-swipe.conf
UNIT="$HOME/.config/systemd/user/socktop-swipe.service"
keep_config=no
[ "${1:-}" = "--keep-config" ] && keep_config=yes
for a in "$@"; do
case "$a" in
--keep-config) keep_config=yes ;;
-h | --help) sed -n '2,10p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
*) echo "unknown option: $a" >&2; exit 2 ;;
esac
done
# 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
say() { printf '%s\n' "$*"; }
for f in socktop-rack socktop-swipe socktop-gestures; do
if [ -e "$BIN/$f" ]; then
sudo rm -f "$BIN/$f"
echo "removed $BIN/$f"
# Stop it first, so nothing is holding the touch device or the tmux session.
if command -v systemctl >/dev/null 2>&1 && [ -e "$UNIT" ]; then
systemctl --user disable --now socktop-swipe 2>/dev/null || true
rm -f "$UNIT"
systemctl --user daemon-reload 2>/dev/null || true
say "removed $UNIT"
fi
pkill -x socktop-swipe 2>/dev/null || true
# Session name comes from the config, which may be about to be deleted.
if [ -r "$CONF" ] && command -v tmux >/dev/null 2>&1; then
session=$(sed -n 's/^session:[[:space:]]*//p' "$CONF" | head -1)
[ -n "${session:-}" ] || session=socktop-swipe
tmux kill-session -t "$session" 2>/dev/null || true
fi
for f in "$BIN" "$UDEV" "$XBLANK" "$XIGNORE" "$LIGHTDM"; do
if [ -e "$f" ]; then
sudo rm -f "$f"
say "removed $f"
fi
done
if [ -e "$UDEV" ] || command -v udevadm >/dev/null 2>&1; then
sudo udevadm control --reload 2>/dev/null || true
fi
if [ "$keep_config" = no ] && [ -e "$CONF" ]; then
sudo rm -f "$CONF"
echo "removed $CONF"
rm -f "$CONF"
rmdir "$CONF_DIR" 2>/dev/null || true
say "removed $CONF"
fi
if [ -e "$XCONF" ]; then
sudo rm -f "$XCONF"
echo "removed $XCONF (touch returns to X after the next X restart)"
fi
if [ -e "$BCONF" ]; then
sudo rm -f "$BCONF"
echo "removed $BCONF (screen blanking returns after the next X restart)"
fi
if [ -e "$LCONF" ]; then
sudo rm -f "$LCONF"
echo "removed $LCONF (login prompt returns at next boot)"
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"
say ""
say "Left in place on purpose:"
say " * the Rust toolchain -- remove with: rustup self uninstall"
say " * tmux -- your package manager installed it"
say " * socktop and friends -- cargo uninstall socktop uptime-kuma-status"
say " * the source checkout -- rm -rf ~/.local/src/socktop-swipe"
say " * 'input' group -- sudo gpasswd -d $(id -un) input"
say " * i3 autostart -- delete the 'socktop-swipe' block in ~/.config/i3/config"
say ""
say "Screen blanking and the login prompt come back after the next X restart"
say "or reboot."