Commit b6c43219 authored by Jai Luthra's avatar Jai Luthra Committed by GitHub

Merge pull request #693 from neromaverick/fix/flatpack-user-context

Fixed flatpak driver installed in user context not found
parents 4066f290 ac20b275
...@@ -312,8 +312,12 @@ check_version_supported () { ...@@ -312,8 +312,12 @@ check_version_supported () {
get_flatpak_driver_path () { get_flatpak_driver_path () {
# Flatpak's package versioning replaces '.' by '-' # Flatpak's package versioning replaces '.' by '-'
version="$(echo "$1" | tr '.' '-')" version="$(echo "$1" | tr '.' '-')"
# Attempts to patch system flatpak
if path=$(flatpak info --show-location "org.freedesktop.Platform.GL.nvidia-${version}" 2>/dev/null); then if path=$(flatpak info --show-location "org.freedesktop.Platform.GL.nvidia-${version}" 2>/dev/null); then
echo "$path/files/lib" echo "$path/files/lib"
# If it isn't found will login as the user that envoked sudo & patch this version
elif path=$(su -c - ${SUDO_USER} 'flatpak info --show-location "org.freedesktop.Platform.GL.nvidia-'${version}'"'); then
echo "$path/files/lib"
fi fi
} }
......
...@@ -388,8 +388,12 @@ check_version_supported () { ...@@ -388,8 +388,12 @@ check_version_supported () {
get_flatpak_driver_path () { get_flatpak_driver_path () {
# Flatpak's package versioning replaces '.' by '-' # Flatpak's package versioning replaces '.' by '-'
version="$(echo "$1" | tr '.' '-')" version="$(echo "$1" | tr '.' '-')"
# Attempts to patch system flatpak
if path=$(flatpak info --show-location "org.freedesktop.Platform.GL.nvidia-${version}" 2>/dev/null); then if path=$(flatpak info --show-location "org.freedesktop.Platform.GL.nvidia-${version}" 2>/dev/null); then
echo "$path/files/lib" echo "$path/files/lib"
# If it isn't found will login as the user that envoked sudo & patch this version
elif path=$(su -c - ${SUDO_USER} 'flatpak info --show-location "org.freedesktop.Platform.GL.nvidia-'${version}'"'); then
echo "$path/files/lib"
fi fi
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment