@@ -289,33 +289,36 @@ The check is enabled in the AppRun, the script inside the AppImage, using the va
289289 <summary >Click here to see the part of the AppRun that handles Nvidia drivers</summary >
290290
291291```
292- [ -z "$NVIDIA_ON" ] && NVIDIA_ON=1
293- if [ "$NVIDIA_ON" = 1 ]; then
294- DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}"
295- CONTY_DIR="${DATADIR}/Conty/overlayfs_shared"
296- CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}"
297- [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)"
298- [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty="$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version)"
299- if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then
300- if command -v curl >/dev/null 2>&1; then
301- if ! curl --output /dev/null --silent --head --fail https://github.com 1>/dev/null; then
302- notify-send "You are offline, cannot use Nvidia drivers"
303- else
304- notify-send "Configuring Nvidia drivers for this AppImage..."
305- mkdir -p "${CACHEDIR}" && cd "${CACHEDIR}" || exit 1
306- curl -Ls "https://raw.githubusercontent.com/ivan-hc/ArchImage/main/nvidia-junest.sh" > nvidia-junest.sh
307- chmod a+x ./nvidia-junest.sh && ./nvidia-junest.sh
308- fi
309- else
310- notify-send "Missing \"curl\" command, cannot use Nvidia drivers"
311- echo "You need \"curl\" to download this script"
312- fi
313- fi
314- [ -d "${CONTY_DIR}"/up/usr/bin ] && export PATH="${PATH}":"${CONTY_DIR}"/up/usr/bin:"${PATH}"
315- [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}"
316- [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}"
317- fi
292+ [ -z "$NVIDIA_ON" ] && NVIDIA_ON=1
293+ if [ "$NVIDIA_ON" = 1 ]; then
294+ DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}"
295+ CONTY_DIR="${DATADIR}/Conty/overlayfs_shared"
296+ CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}"
297+ [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)"
298+ [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty="$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version)"
299+ if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then
300+ if command -v curl >/dev/null 2>&1; then
301+ if ! curl --output /dev/null --silent --head --fail https://github.com 1>/dev/null; then
302+ notify-send "You are offline, cannot use Nvidia drivers"
303+ else
304+ notify-send "Configuring Nvidia drivers for this AppImage..."
305+ mkdir -p "${CACHEDIR}" && cd "${CACHEDIR}" || exit 1
306+ curl -Ls "https://raw.githubusercontent.com/ivan-hc/ArchImage/main/nvidia-junest.sh" > nvidia-junest.sh
307+ chmod a+x ./nvidia-junest.sh && ./nvidia-junest.sh
308+ fi
309+ else
310+ notify-send "Missing \"curl\" command, cannot use Nvidia drivers"
311+ echo "You need \"curl\" to download this script"
312+ fi
313+ fi
314+ [ -d "${CONTY_DIR}"/up/usr/bin ] && export PATH="${PATH}":"${CONTY_DIR}"/up/usr/bin:"${PATH}"
315+ [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}"
316+ [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}"
317+ fi
318318```
319+
320+ For the existing Archimages, its enough to add this part to the AppRun.
321+
319322</details >
320323
321324The function is set to warn the user if the necessary drivers are installed/updated or not. If this fails, the Archimage can still be run, but without hardware acceleration.
0 commit comments