diff options
author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2018-05-16 11:18:44 +0200 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2018-05-16 11:18:44 +0200 |
commit | 268a81fa5c7cd6505fc4f70c7bff2c795ea3a243 (patch) | |
tree | 6799cad8d84460ae85300f988610f2536a47bdb8 /bin | |
parent | ace333cce05785433e001d0301a1437503dcf2ad (diff) |
graphics: Look for Xorg logs in $HOME on systems where X is running as non root
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/graphics_driver | 5 | ||||
-rwxr-xr-x | bin/graphics_env | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/bin/graphics_driver b/bin/graphics_driver index dfb5522..6d28f5a 100755 --- a/bin/graphics_driver +++ b/bin/graphics_driver @@ -361,7 +361,10 @@ def hybrid_graphics_check(xlog): def main(): - xlog = XorgLog("/var/log/Xorg.0.log") + if os.path.isfile("/var/log/Xorg.0.log"): + xlog = XorgLog("/var/log/Xorg.0.log") + else: + xlog = XorgLog(os.path.expanduser("~/.local/share/xorg/Xorg.0.log")) results = [] results.append(get_driver_info(xlog)) diff --git a/bin/graphics_env b/bin/graphics_env index 9511560..89c761d 100755 --- a/bin/graphics_env +++ b/bin/graphics_env @@ -19,7 +19,7 @@ if [[ $DRIVER == "amdgpu" || $DRIVER == "radeon" ]]; then if [ $INDEX -gt 1 ]; then # See https://wiki.archlinux.org/index.php/PRIME echo "Setting up PRIME GPU offloading for AMD discrete GPU" - if ! grep -q DRI3 /var/log/Xorg.0.log; then + if ! cat /var/log/Xorg.0.log ~/.local/share/xorg/Xorg.0.log 2>&1 | grep -q DRI3; then PROVIDER_ID=`xrandr --listproviders | grep "Sink Output" | awk {'print $4'} | tail -1` SINK_ID=`xrandr --listproviders | grep "Source Output" | awk {'print $4'} | tail -1` xrandr --setprovideroffloadsink ${PROVIDER_ID} ${SINK_ID} |