#!/bin/sh
# Discord, on the touch panel. Installed to /usr/local/bin/discord-launch.
#
# WHY IT IS HERE: this panel is in the Loggia, and the point is walking out for a
# cigarette without dropping out of a voice call — you join from the panel and leave
# the call on the desktop, or the other way round. That is a "switch device" action,
# not a "read messages" one, so the app stays logged in and running from session
# start rather than being launched on demand: an app that takes fifteen seconds to
# start and then wants a login is not something you use on the way past.
#
# Flathub, for the same reason as Spotify: Discord's own .deb exists but updates
# itself by nagging you to download a new one, which on a kiosk nobody logs into
# means it eventually refuses to connect. The Flatpak updates like everything else.
#
# Login is interactive, on-device, on first launch. The Flatpak's persistent data dir
# (~/.var/app/com.discordapp.Discord) keeps that session across reboots — nothing here
# reseeds it, unlike the kiosk Firefox profiles.
set -eu

# Discord runs under XWayland here (its Electron build does not default to Wayland),
# so touch arrives as emulated pointer events rather than wl_touch. Tap and drag
# work; two-finger scrolling in the message list may not. See README.md's touch
# section — this is the same tier-2 behaviour the pointer-fallback block in
# configs/sway/config exists for, and it is good enough for "join voice, mute, leave".
exec flatpak run com.discordapp.Discord "$@"
