diff options
| author | Chandler Justice <chandler@cock.li> | 2023-12-09 00:31:22 -0700 |
|---|---|---|
| committer | Chandler Justice <chandler@cock.li> | 2023-12-09 00:31:22 -0700 |
| commit | 7382992e00b104232454dfd3ef5f355fa3cb4095 (patch) | |
| tree | e271a76cbf0e80151cd9bca14695b5ad52d71502 /src/update_rofi.py | |
| parent | 8269c373599e34b0fe4ffd1542420286dded0739 (diff) | |
refactor complete
Diffstat (limited to 'src/update_rofi.py')
| -rw-r--r-- | src/update_rofi.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/update_rofi.py b/src/update_rofi.py new file mode 100644 index 0000000..a7d3aa6 --- /dev/null +++ b/src/update_rofi.py @@ -0,0 +1,23 @@ +import color_engine + +def updateRofiTheme(config_path: str, colors: list, compliments: list): + print('[bold red]Updating Rofi color scheme') + data = '' + with open(config_path, 'r') as file: + data = file.readlines() + bg = color_engine.hexToRGB(colors[1]) + fg = color_engine.hexToRGB(compliments[1]) + lbg = color_engine.hexToRGB(colors[0]) + lfg = color_engine.hexToRGB(colors[0]) + for i,line in enumerate(data): + if 'background: ' in line and i == 23: + data[i] = ' background: rgba({}, {}, {}, 70%);\n'.format(bg[0], bg[1], bg[2]) + if 'foreground: ' in line and i == 28: + data[i] = ' foreground: rgba({}, {}, {}, 100%);\n'.format(fg[0], fg[1], fg[2]) + if 'lightbg: ' in line and i == 12: + data[i] = ' lightbg: rgba({}, {}, {}, 100%);\n'.format(lbg[0], lbg[1], lgb[2]) + if 'lightfg: ' in line and i == 7: + data[i] = ' lightfg: rgba({}, {}, {}, 100%);\n'.format(lfg[0], lfg[1], lfg[2]) + with open(config_path, 'w') as file: + file.writelines(data) + |
