mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
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:
parent
78ac1fe3cc
commit
4016c7fbda
1 changed files with 5 additions and 0 deletions
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue