From 0baefc7edcb5faee0627fd7b3f4a4a1d97c3eae5 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Tue, 18 Jul 2023 18:59:28 -0400 Subject: [PATCH] initial itch.io image (no shortcut yet) --- apps/itchio/Containerfile | 12 ++++++++++++ apps/itchio/itch-wrapper.sh | 17 +++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 apps/itchio/Containerfile create mode 100644 apps/itchio/itch-wrapper.sh diff --git a/apps/itchio/Containerfile b/apps/itchio/Containerfile new file mode 100644 index 0000000..559e4af --- /dev/null +++ b/apps/itchio/Containerfile @@ -0,0 +1,12 @@ +FROM dobu/deps-base-ubuntu-jammy:latest + +RUN apt-get -y update && apt-get -y install libgtk-3-0 curl libnss3 + +COPY ./itch-wrapper.sh /usr/bin/itch-wrapper.sh + +RUN curl -Lo /usr/bin/itch-setup 'https://itch.io/app/download?platform=linux' && \ + chmod +x /usr/bin/itch-setup && chmod +x /usr/bin/itch-wrapper.sh + +USER user + +ENTRYPOINT [ "/usr/bin/itch-wrapper.sh" ] diff --git a/apps/itchio/itch-wrapper.sh b/apps/itchio/itch-wrapper.sh new file mode 100644 index 0000000..a292fd0 --- /dev/null +++ b/apps/itchio/itch-wrapper.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +itch-setup --prefer-launch -- --no-sandbox + +sleep 10 + +# Wait until the real itch.io process exits +# Because whoever designed the client thought it is a good idea to unconditionally daemonize +for pid in $(pgrep itch); do + ppid=$(ps -o ppid= -p $pid | xargs) + if [ "$ppid" == "1" ]; then + while [ -d /proc/$pid ]; do + sleep 1 + done + fi +done +