From 0f1fe2b6293bd12c9abc336a7741b5f378622e49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= <henrik@tjaders.com>
Date: Mon, 15 Aug 2022 18:35:17 +0200
Subject: [PATCH] Special handling for nvidia

---
 .config/qutebrowser/config.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py
index 94b2b09..909285d 100644
--- a/.config/qutebrowser/config.py
+++ b/.config/qutebrowser/config.py
@@ -2,6 +2,8 @@
 # Documentation:
 #   qute://help/configuring.html
 #   qute://help/settings.html
+from subprocess import run
+from os import environ
 
 # Stop flake8 nagging
 c = c  # noqa: F821
@@ -83,3 +85,6 @@ config.bind('b', 'set-cmd-text -s :buffer')
 # config.bind('K', 'scroll-page 0 -1')
 config.bind('J', 'tab-next')
 config.bind('K', 'tab-prev')
+
+if run(["modprobe", "nvidia"]).returncode == 0 and environ["XDG_SESSION_TYPE"] == "wayland":
+    c.qt.environ = {"QMLSCENE_DEVICE":  "softwarecontext"}
-- 
GitLab