#!/bin/sh # Flatpak entry point for the HeiniRemote agent. # # Two sandbox adaptations, no agent code changes: # # 1. The PTY console (agent's console.rs) spawns $SHELL. Inside the sandbox # that would be a sandboxed shell showing the Flatpak filesystem — useless # as a rescue console. Point it at the host-shell bridge instead, which # escapes to the real host login shell via flatpak-spawn. # # 2. Config migration: the agent reads $XDG_CONFIG_HOME/heiniremote/agent.toml, # which Flatpak redirects to ~/.var/app//config/. If no config exists # there yet but a native install left one at ~/.config/heiniremote/ # (visible read-only via --filesystem=xdg-config/heiniremote:ro), use that # via the agent's HEINIREMOTE_CONFIG override. export SHELL=/app/bin/host-shell if [ -z "${HEINIREMOTE_CONFIG:-}" ] \ && [ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/heiniremote/agent.toml" ] \ && [ -f "$HOME/.config/heiniremote/agent.toml" ]; then export HEINIREMOTE_CONFIG="$HOME/.config/heiniremote/agent.toml" fi exec /app/bin/heiniremote-agent "$@"