summaryrefslogtreecommitdiff
path: root/.local/share/Anki2/addons21/anki_reworked/config.py
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2022-08-04 09:50:48 +0300
committerThanos Apollo <[email protected]>2022-08-04 09:50:48 +0300
commit4ddb7273098bee179bb77e0937e560fc0100960c (patch)
treecebc2f9412e45910408a7885ca78d7dedb77de78 /.local/share/Anki2/addons21/anki_reworked/config.py
parente83759ae9d0513024e390810ddcb18ffdd84675e (diff)
Add anki addons
Diffstat (limited to '.local/share/Anki2/addons21/anki_reworked/config.py')
-rw-r--r--.local/share/Anki2/addons21/anki_reworked/config.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/.local/share/Anki2/addons21/anki_reworked/config.py b/.local/share/Anki2/addons21/anki_reworked/config.py
new file mode 100644
index 0000000..9e508f8
--- /dev/null
+++ b/.local/share/Anki2/addons21/anki_reworked/config.py
@@ -0,0 +1,22 @@
+from aqt import mw
+
+def get_config() -> dict:
+ config: dict = mw.addonManager.getConfig(__name__) or dict()
+ ## Addon fix
+ config['addon_more_overview_stats'] = True if config.get('addon_more_overview_stats', "false").lower() == "true" else False
+ config['addon_advanced_review_bottom_bar'] = True if config.get('addon_advanced_review_bottom_bar', "false").lower() == "true" else False
+ ## Customization
+ config['font'] = config.get('font', "Segoe UI")
+ config['font_size'] = int(config.get('font_size', "12"))
+ config['theme'] = config.get('theme', 'Anki')
+ config['theme_reload'] = True if config.get('theme_reload', "false").lower() == "true" else False
+
+ return config
+
+def write_config(config):
+ for key in config.keys():
+ if not isinstance(config[key], str):
+ config[key] = str(config[key])
+ mw.addonManager.writeConfig(__name__, config)
+
+config = get_config()