From 4016c7fbdacfdaa82f15e372e4f44c4ab2140295 Mon Sep 17 00:00:00 2001 From: Spooghetti420 <83249561+Spooghetti420@users.noreply.github.com> Date: Mon, 24 Jan 2022 09:48:32 +0000 Subject: [PATCH] Add dark mode detection fix for users without gnome schema (#1610) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add fix for users without gnome schema On some systems, the result of the `gsettings get org.gnome.desktop.interface gtk-theme` command is `No such schema “org.gnome.desktop.interface”`, which causes Anki to fail to find a value, subsequently crashing on some Linux systems. * Fix whitespace --- qt/aqt/theme.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qt/aqt/theme.py b/qt/aqt/theme.py index cd63fbbbf..e9cebe3a2 100644 --- a/qt/aqt/theme.py +++ b/qt/aqt/theme.py @@ -369,6 +369,11 @@ def get_linux_dark_mode() -> bool: print(e) return False + except subprocess.CalledProcessError as e: + # gsettings is installed, but cannot return a value + print(e) + return False + return "-dark" in process.stdout.lower()