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

Commit

Permalink
fix: -Dark, not a joke
Browse files Browse the repository at this point in the history
  • Loading branch information
nullishamy committed May 28, 2024
1 parent 54633c0 commit b5eda7a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ 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 @@ -55,10 +56,7 @@ class BuildContext:
tweaks: Tweaks

def output_dir(self) -> str:
suffix = "light"
if self.flavor.dark:
suffix = "dark"
return f"{self.build_root}/{self.build_id()}-{suffix}"
return f"{self.build_root}/{self.build_id()}{self.apply_suffix(GTK_SUFFIX)}"

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 @@ -80,13 +78,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()}\n")
file.write(f"Name={ctx.build_id()}{ctx.apply_suffix(GTK_SUFFIX)}\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()}\n")
file.write(f"MetacityTheme={ctx.build_id()}\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"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

0 comments on commit b5eda7a

Please sign in to comment.