diff options
author | Matthew Weber <mtwb47@gmail.com> | 2023-04-19 21:52:18 -0400 |
---|---|---|
committer | Matthew Weber <mtwb47@gmail.com> | 2023-04-19 21:52:18 -0400 |
commit | 3e713d0906d488da390dc4bbf477a388643e19d0 (patch) | |
tree | fa1d38026d8e867e1df6ecd6de5dde6275d6c0ce /skel/.config/qtile/settings/theme.py | |
parent | 107ca66579d51c20678a7e330ba08045891ea300 (diff) |
added qtile config and readme
Diffstat (limited to 'skel/.config/qtile/settings/theme.py')
-rw-r--r-- | skel/.config/qtile/settings/theme.py | 36 |
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() + |