File VentoyGUI.sh of Package ventoy
#!/bin/bash
set -e
# Default path.
# The .spec file will replace this line with the actual architecture-specific path (e.g., /usr/lib64/ventoy).
VentoyDir="/usr/lib/ventoy"
Arch="$(uname -m)"
[ "${Arch}" = "i686" ] && Arch=i386
VentoyBin="${VentoyDir}/VentoyGUI.${Arch}"
# Validation
if [ ! -d "${VentoyDir}" ]; then
echo "Error: Ventoy directory not found at ${VentoyDir}"
exit 1
fi
# Now run
cd "${VentoyDir}"
[ $# -ne 0 ] && exec "${VentoyBin}" "$@"
case "${XDG_CURRENT_DESKTOP,,}" in
*kde*|*lxqt*|*plasma*) exec "${VentoyBin}" --qt5 ;;
*) exec "${VentoyBin}" ;;
esac