Skip to content
This repository was archived by the owner on Jun 2, 2024. It is now read-only.

Commit 8702e3c

Browse files
committed
feat: start themeing firefox sections as well
Signed-off-by: Pranav <[email protected]>
1 parent 8a1f11a commit 8702e3c

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ __pycache__
44
venv/
55

66
# Releases folder
7-
releases
7+
releases
8+
chrome

scripts/create_theme.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from scripts.ctp_colors import ctp_colors
77
from scripts.recolor import recolor
88
from scripts.utils import zip_multiple_folders
9-
from scripts.var import def_color_map, theme_name, work_dir
9+
from scripts.var import def_color_map, repo_dir, src_dir, theme_name, work_dir
1010

1111

1212
def create_theme(types: List[str], accents: List[str], dest: str, link: bool = False,
@@ -25,7 +25,8 @@ def create_theme(types: List[str], accents: List[str], dest: str, link: bool = F
2525
install_cmd: str = f"./install.sh -c {theme_style} -s {size} -n {name} -d {dest} -t {def_color_map[accent]}"
2626
if tweaks:
2727
install_cmd += f" --tweaks {' '.join([tweak for tweak in tweaks])}"
28-
28+
shutil.rmtree(f"{repo_dir}/chrome", ignore_errors=True)
29+
shutil.copytree(f"{src_dir}/other/firefox/chrome", f"{repo_dir}/chrome")
2930
os.chdir(work_dir)
3031
subprocess.call("./build.sh", shell=True) # Rebuild all scss
3132
subprocess.call(install_cmd, shell=True) # Install the theme globally for you

scripts/recolor.py

+47
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,52 @@ def recolor_accent(flavor, accent: str = "blue"):
2020
work_dir, def_accent_light[def_color_map[accent]], Flavour.latte().__dict__[accent].hex)
2121

2222

23+
def recolor_firefox(flavor, accent: str = "blue"):
24+
"""
25+
Recolor the custom gnomish firefox to catpuccin color
26+
"""
27+
firefox_color_file_dark = f"{src_dir}/other/firefox/chrome/Colloid/colors/dark.css"
28+
firefox_color_file_light = f"{src_dir}/other/firefox/chrome/Colloid/colors/light.css"
29+
30+
replacetext(firefox_color_file_light, "2e3436", flavor.base.hex)
31+
replacetext(firefox_color_file_light, "fafafa", Flavour.latte().base.hex)
32+
replacetext(firefox_color_file_light, "f2f2f2", flavor.crust.hex)
33+
replacetext(firefox_color_file_light, "303030", Flavour.mocha().base.hex)
34+
replacetext(firefox_color_file_light, "ffffff", flavor.base.hex)
35+
replacetext(firefox_color_file_light, "5b9bf8", flavor.surface0.hex)
36+
replacetext(firefox_color_file_light, "3c84f7", flavor.__dict__[accent].hex)
37+
replacetext(firefox_color_file_light, "dedede", flavor.surface1.hex)
38+
replacetext(firefox_color_file_light, "f0f0f0", flavor.surface0.hex)
39+
replacetext(firefox_color_file_light, "FAFAFA", flavor.surface1.hex)
40+
replacetext(firefox_color_file_light, "fafafa", flavor.surface0.hex)
41+
replacetext(firefox_color_file_light, "323232", flavor.mantle.hex)
42+
replacetext(firefox_color_file_light, "d5d0cc", flavor.subtext1.hex)
43+
44+
# Buttons
45+
replacetext(firefox_color_file_light, "fd5f51", flavor.red.hex)
46+
replacetext(firefox_color_file_light, "38c76a", flavor.green.hex)
47+
replacetext(firefox_color_file_light, "fdbe04", flavor.yellow.hex)
48+
49+
# Dark
50+
replacetext(firefox_color_file_dark, "eeeeee", flavor.base.hex)
51+
replacetext(firefox_color_file_dark, "2c2c2c", Flavour.mocha().base.hex)
52+
replacetext(firefox_color_file_dark, "242424", flavor.crust.hex)
53+
replacetext(firefox_color_file_dark, "ffffff", Flavour.latte().base.hex)
54+
replacetext(firefox_color_file_dark, "383838", flavor.base.hex)
55+
replacetext(firefox_color_file_dark, "3584e4", flavor.surface0.hex)
56+
replacetext(firefox_color_file_dark, "78aeed", flavor.__dict__[accent].hex)
57+
replacetext(firefox_color_file_dark, "363636", flavor.surface1.hex)
58+
replacetext(firefox_color_file_dark, "404040", flavor.surface0.hex)
59+
replacetext(firefox_color_file_dark, "4F4F4F", flavor.surface1.hex)
60+
replacetext(firefox_color_file_dark, "444444", flavor.surface0.hex)
61+
replacetext(firefox_color_file_dark, "323232", flavor.mantle.hex)
62+
replacetext(firefox_color_file_dark, "919191", flavor.subtext1.hex)
63+
64+
# Buttons
65+
replacetext(firefox_color_file_dark, "fd5f51", flavor.red.hex)
66+
replacetext(firefox_color_file_dark, "38c76a", flavor.green.hex)
67+
replacetext(firefox_color_file_dark, "fdbe04", flavor.yellow.hex)
68+
2369
def recolor(flavor, accent: str):
2470
"""
2571
Recolor the theme. currently hard code it frappe
@@ -29,6 +75,7 @@ def recolor(flavor, accent: str):
2975

3076
print("Recoloring accents")
3177
recolor_accent(flavor, accent)
78+
recolor_firefox(flavor, accent)
3279

3380
print("MOD: Gtkrc.sh")
3481
replacetext(f"{work_dir}/gtkrc.sh", "background_light='#FFFFFF'",

0 commit comments

Comments
 (0)