Add dark mode detection fix for users without gnome schema (#1610)

* 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
This commit is contained in:
Spooghetti420 2022-01-24 09:48:32 +00:00 committed by GitHub
parent 78ac1fe3cc
commit 4016c7fbda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()