The goal of this gist is to setup waypipe to automically run locally on user login and remotely when you connect to it. In both cases, this is managed by systemd user session and assumes that is running. This took way too long to figure out, so I hope it helps someone (or me) in the future.
On your local system, copy the waypipe-client.service to the user systemd directory.
install -d 0755 ${HOME}/.config/systemd/user/
install waypipe-client.service ${HOME}/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now waypipe-client.serviceConfigure SSH Remote Forward by creating or amending an entry for your remote host.
It should look like the ssh_config file in this gist.
On the remote system, do similarly with waypipe-server.service.
install -d 0755 ${HOME}/.config/systemd/user/
install waypipe-server.service ${HOME}/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now waypipe-server.service
I see. In situations like that I usually did a
sleep 1dor similar. Nice idea to use cat as a detection for a closed connection/stdin.Understood. Not used to using exit. Stop usually worked for me 😅
Give it a shot!
More thoughts:
Automatically stopping the waypipe server services after use would be nice. Tracking all potential users (e.g. ssh connections) or tracking by activity would be quite hard though. A
sleep 1dinstead of asleep infwould ensure the services stops, but is NOT guarantied to NOT happen in the middle of your work session the next day. Something to reset a stop timer timeout is missing here.Also I put a
|| truein the exec statement to ensure it never fails because it's a hack and not really a qualifier script or something. Though if the service isn't present at the remote host, without this|| true, the matching should fail, which would prevent the remote forwarding and setting of WAYLAND_DISPLAY. A desired outcome prevented by my addition I guess 🤷Happy hacking and have a nice weekend!