Add host groups (one tmux window per group) and lightdm --autologin

SOCKTOP_GROUPS splits hosts into ';'-separated groups, each its own tmux
window with an optional @layout. The carousel walks group overview -> each
pane zoomed -> next group overview. SOCKTOP_HOSTS still works as one group.

install.sh --autologin writes a lightdm.conf.d drop-in; uninstall removes it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jasonwitty
2026-08-28 09:53:39 -07:00
co-authored by Claude Fable 5
parent c5b8d04b84
commit 818b09762e
6 changed files with 184 additions and 51 deletions
+25 -11
View File
@@ -3,16 +3,19 @@
Swipe-to-zoom touchscreen navigation for a wall-mounted
[socktop](https://crates.io/crates/socktop) dashboard.
One tmux window shows every monitored host tiled together. Swiping right-to-left
on the panel zooms into each host full-screen, one at a time; swiping
left-to-right walks back out to the overview.
Hosts are arranged in **groups**. Each group is one tmux window showing its
hosts tiled together. Swiping right-to-left on the panel zooms into each host
full-screen, one at a time, then moves on to the next group's overview; swiping
left-to-right walks back the same way.
```
overview -> host 1 -> host 2 -> host 3 -> host 4
(tiled) zoomed zoomed zoomed zoomed
<-------------- swipe left-to-right --------------
group A -> A1 -> A2 -> A3 -> A4 -> group B -> B1 -> B2
(quarters) zoomed zoomed zoomed zoomed (stacked) zoomed zoomed
<------------------------- swipe left-to-right -------------------------
```
With a single group this is simply overview -> each host -> back.
Built for a 10" touch panel on a server rack driving four Raspberry Pis, on a
low-power x86 box running i3 on X11.
@@ -63,6 +66,7 @@ fresh session.
| `--xignore` | Also tell X to ignore the touch panel (see below — usually wanted) |
| `--i3` | Also add i3 autostart lines, with a backup and `i3 -C` validation |
| `--noblank` | Also stop the screen blanking / DPMS power-down (wall displays) |
| `--autologin` | Also make lightdm log this user straight into i3 at boot (see [security note](#related-does-the-display-come-back-by-itself)) |
Re-running is safe: an existing config file is never overwritten, and the i3
edit is skipped if already present.
@@ -92,7 +96,8 @@ blame the config change.
| Option | Default | What it does |
| --- | --- | --- |
| `SOCKTOP_HOSTS` | four Pi profiles | socktop profile names, **in swipe order**. Any count works; layout and carousel adapt. |
| `SOCKTOP_GROUPS` | Pis quartered `;` Orange Pi + Debian stacked | Groups separated by `;`, each a list of socktop profile names **in swipe order**, plus an optional `@layout` (`tiled` default, `even-vertical` stacks, `even-horizontal` side-by-side, `main-*` also work). Any count of groups and hosts works. |
| `SOCKTOP_HOSTS` | empty | Legacy single-group form; used only when `SOCKTOP_GROUPS` is empty |
| `SOCKTOP_SESSION` | `socktop4` | tmux session name |
| `SOCKTOP_BIN` | `$HOME/.cargo/bin/socktop` | Full path — i3 does not have `~/.cargo/bin` on `PATH` |
| `TOUCH_DEV` | ILITEK by-id path | Touch device. **Always use a `/dev/input/by-id/` path**; `eventN` numbers change on reboot. |
@@ -104,8 +109,14 @@ blame the config change.
### Adding or removing hosts
Edit `SOCKTOP_HOSTS` and run `socktop-rack`. Nothing else needs touching — the
carousel derives its length from the pane count at runtime.
Edit `SOCKTOP_GROUPS` and run `socktop-rack`. Nothing else needs touching — the
carousel derives its length from the windows and panes at runtime. Every host
named must exist in `~/.config/socktop/profiles.json` on the display host.
```sh
# four Pis as quarters, then two more boxes stacked one above the other
SOCKTOP_GROUPS="rpi-master rpi-worker-1 rpi-worker-2 rpi-worker-3 ; orangepi trixie @even-vertical"
```
## Autostart
@@ -152,8 +163,11 @@ autostarts. Check with:
grep -E '^autologin-(user|session)' /etc/lightdm/lightdm.conf
```
No output means no autologin. Configuring it is out of scope here — it weakens
the machine's security posture and is a deliberate choice, not a default.
No output means no autologin. `./install.sh --autologin` writes
`/etc/lightdm/lightdm.conf.d/50-autologin-socktop-swipe.conf` for the current
user into the `i3` session. It is opt-in, not a default: **anyone with physical
access to the panel gets that user's session**, so only do it where the display
user is nothing but the dashboard. Delete the file to get the login prompt back.
## Uninstall