mirror of
https://codeberg.org/ProgramSnail/config.git
synced 2026-01-11 05:57:17 +00:00
add dotfiles (including kitty & alacritty themes), add proxies, add writing & haskell roles
This commit is contained in:
parent
46bdf4dda0
commit
6561d54f45
346 changed files with 15329 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
import json
|
||||
from jinja2 import FileSystemLoader, Environment
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
def removeAlpha(value):
|
||||
hex = value.lstrip("#")
|
||||
return "#" + hex[0:6]
|
||||
|
||||
|
||||
filename = sys.argv[1]
|
||||
|
||||
kitty_configuration = os.path.splitext(filename)[0] + ".conf"
|
||||
|
||||
with open(filename, "r") as configuration_file:
|
||||
configuration = json.load(configuration_file)
|
||||
|
||||
loader = FileSystemLoader(".")
|
||||
env = Environment(loader=loader)
|
||||
|
||||
env.filters['removeAlpha'] = removeAlpha
|
||||
env.trim_blocks = True
|
||||
|
||||
template = env.get_template("template.conf.j2")
|
||||
|
||||
output = template.render(**configuration)
|
||||
|
||||
with open(kitty_configuration, "w") as fp:
|
||||
fp.write(output)
|
||||
Loading…
Add table
Add a link
Reference in a new issue