diff --git a/Containerfile b/Containerfile index 4b29f6a..a5c05be 100644 --- a/Containerfile +++ b/Containerfile @@ -77,4 +77,4 @@ WORKDIR /var/lib/xactfetch USER 2468:2468 -ENTRYPOINT ["tini", "/entrypoint.sh", "--"] +ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 3e21621..50e71cd 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,19 @@ #!/bin/sh -exec xvfb-run -e /dev/stderr -s '-screen 0 1920x1080x24 -nolisten unix' xactfetch "$@" +if [ $$ -eq 1 ]; then + exec tini "$0" -- "$@" +fi + +if [ -z "${SECRET_SOCKET_PATH}" ] || [ ! -e "${SECRET_SOCKET_PATH}" ]; then + export SECRET_SOCKET_PATH="${SECRET_SOCKET_PATH:-/tmp/.secretsocket}" + secretsocket & + sspid=$! +fi + +xvfb-run -e /dev/stderr -s '-screen 0 1920x1080x24 -nolisten unix' xactfetch "$@" +rc=$? + +if [ -n "${sspid}" ]; then + kill $sspid +fi +exit $rc