diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2019-10-07 13:38:30 -0400 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2019-10-07 13:38:30 -0400 |
| commit | 82251214b814db66e83c821c625e1b586510c00e (patch) | |
| tree | 764ff1164dbe8ad6a13fb529559d4d62b2b205cb /src/config.py | |
| parent | b8fa5e732a8b065ec67be57bcb94676785c944f9 (diff) | |
Improve theme validation
Diffstat (limited to 'src/config.py')
| -rwxr-xr-x | src/config.py | 43 |
1 files changed, 4 insertions, 39 deletions
diff --git a/src/config.py b/src/config.py index fdee9fc..3d67ff3 100755 --- a/src/config.py +++ b/src/config.py @@ -2,7 +2,7 @@ import re,tempfile,shutil -theme_keys=["client.focused", +config_keys=["client.focused", "client.focused_inactive", "client.unfocused", "client.urgent", @@ -22,7 +22,7 @@ def extract_config(config_file): tmp=tempfile.NamedTemporaryFile(mode="w",delete=False) for line in f: is_theme_line=False - for key in theme_keys: + for key in config_keys: if contains(".*"+key+"\s",line): is_theme_line=True if not(is_theme_line): @@ -63,45 +63,10 @@ def apply_to_config(tmp_config,theme): for key,value in client_theme.items(): f.write("client."+key+" "+value["border"]+" "+value["background"]+" "+value["text"]+" "+value["indicator"]+" "+safe_get(value,"child_border")+"\n") f.close() - + + def apply_theme(config_file,theme): tmp=extract_config(config_file) apply_to_config(tmp,theme) shutil.move(tmp,config_file) -theme={ - "bar":{ - "separator": "#666666", - "background": "#333333", - "statusline": "#bbbbbb", - "focused_workspace": { "border":"#888888", - "background": "#dddddd", - "text": "#222222"}, - "active_workspace": { "border": "#333333", - "background": "#555555", - "text": "#bbbbbb"}, - "inactive_workspace": { "border": "#333333", - "background": "#555555", - "text": "#bbbbbb"}, - "urgent_workspace": { "border": "#2f343a", - "background": "#900000", - "text": "#ffffff"}}, - "client": { - "client.focused": { "background": "#888888", - "text": "#dddddd", - "indicator": "#222222", - "child_border": "#2e9ef4"}, - "client.focused_inactive": { "background": "#333333", - "text": "#555555", - "indicator": "#bbbbbb", - "child_border": "#484e50"}, - "client.unfocused": { "background": "#333333", - "text": "#333333", - "indicator": "#888888", - "child_border": "#292d2e"}, - "client.urgent": { "background": "#2f343a", - "text": "#900000", - "indicator": "#ffffff", - "child_border": "#900000"}} -} - |
