summaryrefslogtreecommitdiff
path: root/skel/.config/qtile/settings/theme.py
diff options
context:
space:
mode:
Diffstat (limited to 'skel/.config/qtile/settings/theme.py')
-rw-r--r--skel/.config/qtile/settings/theme.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/skel/.config/qtile/settings/theme.py b/skel/.config/qtile/settings/theme.py
new file mode 100644
index 0000000..707b221
--- /dev/null
+++ b/skel/.config/qtile/settings/theme.py
@@ -0,0 +1,36 @@
+# Antonio Sarosi
+# https://youtube.com/c/antoniosarosi
+# https://github.com/antoniosarosi/dotfiles
+
+# Theming for Qtile
+
+from os import path
+import subprocess
+import json
+
+from settings.path import qtile_path
+
+
+def load_theme():
+ theme = "arc"
+
+ config = path.join(qtile_path, "config.json")
+ if path.isfile(config):
+ with open(config) as f:
+ theme = json.load(f)["theme"]
+ else:
+ with open(config, "w") as f:
+ f.write(f'{{"theme": "{theme}"}}\n')
+
+
+ theme_file = path.join(qtile_path, "themes", f'{theme}.json')
+ if not path.isfile(theme_file):
+ raise Exception(f'"{theme_file}" does not exist')
+
+ with open(path.join(theme_file)) as f:
+ return json.load(f)
+
+
+if __name__ == "settings.theme":
+ colors = load_theme()
+