Initial commit: swipe-to-zoom touchscreen navigation for socktop
Tiled socktop dashboard where a right-to-left swipe zooms into each host full-screen and left-to-right walks back out. The carousel is tmux pane zoom rather than separate socktop instances, so there is one process per host: half the processes, no reconnect delay when swiping back, and constant polling load on the monitored hosts. Gestures come from lisgd because libinput emits gesture events only for touchpads, never touchscreens, which rules out libinput-gestures entirely. Documents the four gotchas found while building this: panels reporting 2-3 contacts for a one-finger swipe, X needing to ignore the panel so the terminal and socktop stop competing for the same touches, tmux mouse mode being incompatible with swipes, and lisgd not grabbing the device exclusively so two instances double-fire. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
# Identify the touchscreen and print the stable by-id path for config.env.
|
||||
set -eu
|
||||
|
||||
echo "=== input devices reporting a touch-ish name ==="
|
||||
found=
|
||||
for ev in /dev/input/event*; do
|
||||
name=$(cat "/sys/class/input/$(basename "$ev")/device/name" 2>/dev/null || true)
|
||||
case "$name" in
|
||||
*[Tt]ouch* | *TOUCH*)
|
||||
found=yes
|
||||
echo
|
||||
echo " device: $ev"
|
||||
echo " name: $name"
|
||||
for l in /dev/input/by-id/* /dev/input/by-path/*; do
|
||||
[ -e "$l" ] || continue
|
||||
if [ "$(readlink -f "$l")" = "$(readlink -f "$ev")" ]; then
|
||||
echo " stable: $l"
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$found" ]; then
|
||||
echo " (none matched by name)"
|
||||
echo
|
||||
echo "Fall back to listing everything:"
|
||||
for ev in /dev/input/event*; do
|
||||
printf ' %-22s %s\n' "$ev" "$(cat "/sys/class/input/$(basename "$ev")/device/name" 2>/dev/null)"
|
||||
done
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Put the 'stable:' path (prefer /dev/input/by-id/) into TOUCH_DEV."
|
||||
echo "Event numbers change across reboots; by-id symlinks do not."
|
||||
Reference in New Issue
Block a user