summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-11 22:09:44 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-11 22:09:44 +1000
commit63040f68b7098ba2cf7b83ab878420debe75cfb1 (patch)
tree57760739fa541802c95cb79f2905d0dc9fad12a2 /src
parentfeat: theme spicetify (diff)
downloadcaelestia-cli-63040f68b7098ba2cf7b83ab878420debe75cfb1.tar.gz
caelestia-cli-63040f68b7098ba2cf7b83ab878420debe75cfb1.tar.bz2
caelestia-cli-63040f68b7098ba2cf7b83ab878420debe75cfb1.zip
feat: theme fuzzel
Diffstat (limited to 'src')
-rw-r--r--src/caelestia/data/templates/fuzzel.ini41
-rw-r--r--src/caelestia/utils/theme.py17
2 files changed, 54 insertions, 4 deletions
diff --git a/src/caelestia/data/templates/fuzzel.ini b/src/caelestia/data/templates/fuzzel.ini
new file mode 100644
index 0000000..d4eaafe
--- /dev/null
+++ b/src/caelestia/data/templates/fuzzel.ini
@@ -0,0 +1,41 @@
+font=JetBrains Mono NF:size=17
+terminal=foot -e
+prompt="> "
+layer=overlay
+lines=15
+width=60
+dpi-aware=no
+inner-pad=10
+horizontal-pad=40
+vertical-pad=15
+match-counter=yes
+
+[colors]
+background=282c34dd
+text=abb2bfdd
+prompt=d19a66ff
+placeholder=666e7cff
+input=abb2bfff
+match=be5046ff
+selection=d19a6687
+selection-text=abb2bfff
+selection-match=be5046ff
+counter=666e7cff
+border=d19a6677
+
+[border]
+radius=10
+width=2
+
+[colors]
+background=$surfacedd
+text=$onSurfacedd
+prompt=$primaryff
+placeholder=$outlineff
+input=$onSurfaceff
+match=$tertiaryff
+selection=$primary87
+selection-text=$onSurfaceff
+selection-match=$tertiaryff
+counter=$outlineff
+border=$primary77
diff --git a/src/caelestia/utils/theme.py b/src/caelestia/utils/theme.py
index acca868..c4e9899 100644
--- a/src/caelestia/utils/theme.py
+++ b/src/caelestia/utils/theme.py
@@ -19,6 +19,13 @@ def gen_scss(colours: dict[str, str]) -> str:
return scss
+def gen_replace(colours: dict[str, str], template: Path) -> str:
+ template = template.read_text()
+ for name, colour in colours.items():
+ template = template.replace(f"${name}", colour)
+ return template
+
+
def c2s(c: str, *i: list[int]) -> str:
"""Hex to ANSI sequence (e.g. ffffff, 11 -> \x1b]11;rgb:ff/ff/ff\x1b\\)"""
return f"\x1b]{';'.join(map(str, i))};rgb:{c[0:2]}/{c[2:4]}/{c[4:6]}\x1b\\"
@@ -91,12 +98,13 @@ def apply_discord(scss: str) -> None:
def apply_spicetify(colours: dict[str, str]) -> None:
- template = (templates_dir / "spicetify.ini").read_text()
+ template = gen_replace(colours, templates_dir / "spicetify.ini")
+ try_write(config_dir / "spicetify/Themes/caelestia/color.ini", template)
- for name, colour in colours.items():
- template = template.replace(f"${name}", colour)
- try_write(config_dir / "spicetify/Themes/caelestia/color.ini", template)
+def apply_fuzzel(colours: dict[str, str]) -> None:
+ template = gen_replace(colours, templates_dir / "fuzzel.ini")
+ try_write(config_dir / "fuzzel/fuzzel.ini", template)
def apply_colours(colours: dict[str, str]) -> None:
@@ -104,3 +112,4 @@ def apply_colours(colours: dict[str, str]) -> None:
apply_hypr(gen_conf(colours))
apply_discord(gen_scss(colours))
apply_spicetify(colours)
+ apply_fuzzel(colours)