Files
dotfiles/users/richie/home/gui/t3_code/launch.sh
T

26 lines
831 B
Bash

# Launch the newest T3 Code AppImage in the app image directory.
#
# The nightly builds carry the version in the file name, so the file to run is
# resolved at launch time rather than baked into the desktop entry.
# No shebang: this is wrapped by writeShellApplication, which supplies one.
dir="${T3_CODE_DIR:-$HOME/app_images}"
shopt -s nullglob
images=("$dir"/T3-Code-*.AppImage)
if [ "${#images[@]}" -eq 0 ]; then
msg="No T3 Code AppImage found in $dir"
echo "$msg" >&2
# launched from KDE there is no terminal to read, so say it on screen too
kdialog --error "$msg" || true
exit 1
fi
img="$(printf '%s\n' "${images[@]}" | sort -V | tail -n1)"
[ -x "$img" ] || chmod +x "$img"
# --no-sandbox matches the AppImage's own desktop entry; binfmt hands the
# AppImage off to appimage-run.
exec "$img" --no-sandbox "$@"