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

Commit

Permalink
fix: drop casing; absolutely ensure gtk.css and gtk-dark.css are the …
Browse files Browse the repository at this point in the history
…same
  • Loading branch information
nullishamy committed May 28, 2024
1 parent b5eda7a commit 23647df
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class Suffix:
DARK_LIGHT = Suffix(
true_value="-Dark", false_value="-Light", test=lambda ctx: ctx.flavor.dark
)
GTK_SUFFIX = Suffix(true_value='-Dark', false_value='-Light', test=lambda ctx: ctx.flavor.dark)

@dataclass
class BuildContext:
Expand All @@ -56,7 +55,7 @@ class BuildContext:
tweaks: Tweaks

def output_dir(self) -> str:
return f"{self.build_root}/{self.build_id()}{self.apply_suffix(GTK_SUFFIX)}"
return f"{self.build_root}/{self.build_id()}"

def build_id(self) -> str:
return f"{self.theme_name}-{self.flavor.identifier}-{self.accent.identifier}-{self.size}+{self.tweaks.id() or 'default'}"
Expand All @@ -78,13 +77,13 @@ def build(ctx: BuildContext):
with open(f"{output_dir}/index.theme", "w") as file:
file.write("[Desktop Entry]\n")
file.write("Type=X-GNOME-Metatheme\n")
file.write(f"Name={ctx.build_id()}{ctx.apply_suffix(GTK_SUFFIX)}\n")
file.write(f"Name={ctx.build_id()}\n")
file.write("Comment=An Flat Gtk+ theme based on Elegant Design\n")
file.write("Encoding=UTF-8\n")
file.write("\n")
file.write("[X-GNOME-Metatheme]\n")
file.write(f"GtkTheme={ctx.build_id()}{ctx.apply_suffix(GTK_SUFFIX)}\n")
file.write(f"MetacityTheme={ctx.build_id()}{ctx.apply_suffix(GTK_SUFFIX)}\n")
file.write(f"GtkTheme={ctx.build_id()}\n")
file.write(f"MetacityTheme={ctx.build_id()}\n")
file.write(f"IconTheme=Tela-circle{ctx.apply_suffix(IS_DARK)}\n")
file.write(f"CursorTheme={ctx.flavor.name}-cursors\n")
file.write("ButtonLayout=close,minimize,maximize:menu\n")
Expand Down Expand Up @@ -116,8 +115,7 @@ def build(ctx: BuildContext):
[
"sassc",
*SASSC_OPT,
# NOTE: This uses 'Dark' for the source, but 'dark' for the destination. This is intentional. Do !!NOT!! change it without consultation
f"{SRC_DIR}/main/gtk-3.0/gtk-Dark.scss",
f"{SRC_DIR}/main/gtk-3.0/gtk{ctx.apply_suffix(DARK_LIGHT)}.scss",
f"{output_dir}/gtk-3.0/gtk-dark.css",
]
)
Expand All @@ -135,8 +133,7 @@ def build(ctx: BuildContext):
[
"sassc",
*SASSC_OPT,
# NOTE: This uses 'Dark' for the source, but 'dark' for the destination. This is intentional. Do !!NOT!! change it without consultation
f"{SRC_DIR}/main/gtk-4.0/gtk-Dark.scss",
f"{SRC_DIR}/main/gtk-4.0/gtk{ctx.apply_suffix(DARK_LIGHT)}.scss",
f"{output_dir}/gtk-4.0/gtk-dark.css",
]
)
Expand Down

0 comments on commit 23647df

Please sign in to comment.