From 6f7beecdc6de14cf1fd6be9038a86528d2ba52f0 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:42:13 +1000 Subject: feat: theme discord --- src/caelestia/data/templates/discord.scss | 174 ++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 src/caelestia/data/templates/discord.scss (limited to 'src/caelestia/data/templates') diff --git a/src/caelestia/data/templates/discord.scss b/src/caelestia/data/templates/discord.scss new file mode 100644 index 0000000..34220d5 --- /dev/null +++ b/src/caelestia/data/templates/discord.scss @@ -0,0 +1,174 @@ +/** + * @name Midnight (Caelestia) + * @description A dark, rounded discord theme. Caelestia scheme colours. + * @author refact0r, esme, anubis + * @version 1.6.2 + * @invite nz87hXyvcy + * @website https://github.com/refact0r/midnight-discord + * @authorId 508863359777505290 + * @authorLink https://www.refact0r.dev +*/ + +@use "sass:color"; +@use "colours" as c; + +@import url("https://refact0r.github.io/midnight-discord/build/midnight.css"); + +body { + /* font, change to '' for default discord font */ + --font: "figtree"; + + /* sizes */ + --gap: 12px; /* spacing between panels */ + --divider-thickness: 4px; /* thickness of unread messages divider and highlighted message borders */ + --border-thickness: 1px; /* thickness of borders around main panels. DOES NOT AFFECT OTHER BORDERS */ + + /* animation/transition options */ + --animations: on; /* turn off to disable all midnight animations/transitions */ + --list-item-transition: 0.2s ease; /* transition for list items */ + --dms-icon-svg-transition: 0.4s ease; /* transition for the dms icon */ + + /* top bar options */ + --top-bar-height: var( + --gap + ); /* height of the titlebar/top bar (discord default is 36px, 24px recommended if moving/hiding top bar buttons) */ + --top-bar-button-position: hide; /* off: default position, hide: hide inbox/support buttons completely, serverlist: move inbox button to server list, titlebar: move inbox button to titlebar (will hide title) */ + --top-bar-title-position: hide; /* off: default centered position, hide: hide title completely, left: left align title (like old discord) */ + --subtle-top-bar-title: off; /* off: default, on: hide the icon and use subtle text color (like old discord) */ + + /* window controls */ + --custom-window-controls: on; /* turn off to use discord default window controls */ + --window-control-size: 14px; /* size of custom window controls */ + + /* dms button icon options */ + --custom-dms-icon: custom; /* off: use default discord icon, hide: remove icon entirely, custom: use custom icon */ + --dms-icon-svg-url: url("https://upload.wikimedia.org/wikipedia/commons/c/c4/Font_Awesome_5_solid_moon.svg"); /* icon svg url. MUST BE A SVG. */ + --dms-icon-svg-size: 90%; /* size of the svg (css mask-size) */ + --dms-icon-color-before: var(--icon-secondary); /* normal icon color */ + --dms-icon-color-after: var(--white); /* icon color when button is hovered/selected */ + + /* dms button background options */ + --custom-dms-background: off; /* off to disable, image to use a background image (must set url variable below), color to use a custom color/gradient */ + --dms-background-image-url: url(""); /* url of the background image */ + --dms-background-image-size: cover; /* size of the background image (css background-size) */ + --dms-background-color: linear-gradient( + 70deg, + var(--blue-2), + var(--purple-2), + var(--red-2) + ); /* fixed color/gradient (css background) */ + + /* background image options */ + --background-image: off; /* turn on to use a background image */ + --background-image-url: url(""); /* url of the background image */ + + /* transparency/blur options */ + /* NOTE: TO USE TRANSPARENCY/BLUR, YOU MUST HAVE TRANSPARENT BG COLORS. FOR EXAMPLE: --bg-4: hsla(220, 15%, 10%, 0.7); */ + --transparency-tweaks: off; /* turn on to remove some elements for better transparency */ + --remove-bg-layer: off; /* turn on to remove the base --bg-3 layer for use with window transparency (WILL OVERRIDE BACKGROUND IMAGE) */ + --panel-blur: off; /* turn on to blur the background of panels */ + --blur-amount: 12px; /* amount of blur */ + --bg-floating: #{c.$surface}; /* you can set this to a more opaque color if floating panels look too transparent */ + + /* chatbar options */ + --custom-chatbar: aligned; /* off: default chatbar, aligned: chatbar aligned with the user panel, separated: chatbar separated from chat */ + --chatbar-height: 47px; /* height of the chatbar (52px by default, 47px recommended for aligned, 56px recommended for separated) */ + --chatbar-padding: 8px; /* padding of the chatbar. only applies in aligned mode. */ + + /* other options */ + --small-user-panel: off; /* turn on to make the user panel smaller like in old discord */ +} + +/* color options */ +:root { + --colors: on; /* turn off to use discord default colors */ + + /* text colors */ + --text-0: #{c.$onPrimary}; /* text on colored elements */ + --text-1: #{color.scale(c.$onSurface, $lightness: 10%)}; /* bright text on colored elements */ + --text-2: #{color.scale(c.$onSurface, $lightness: 5%)}; /* headings and important text */ + --text-3: #{c.$onSurface}; /* normal text */ + --text-4: #{c.$outline}; /* icon buttons and channels */ + --text-5: #{c.$outline}; /* muted channels/chats and timestamps */ + + /* background and dark colors */ + --bg-1: #{c.$surfaceContainerHighest}; /* dark buttons when clicked */ + --bg-2: #{c.$surfaceContainerHigh}; /* dark buttons */ + --bg-3: #{c.$surface}; /* spacing, secondary elements */ + --bg-4: #{c.$surfaceContainer}; /* main background color */ + --hover: #{color.change(c.$onSurface, $alpha: 0.08)}; /* channels and buttons when hovered */ + --active: #{color.change(c.$onSurface, $alpha: 0.1)}; /* channels and buttons when clicked or selected */ + --active-2: #{color.change(c.$onSurface, $alpha: 0.2)}; /* extra state for transparent buttons */ + --message-hover: #{color.change(c.$onSurface, $alpha: 0.08)}; /* messages when hovered */ + + /* accent colors */ + --accent-1: var(--blue-1); /* links and other accent text */ + --accent-2: var(--blue-2); /* small accent elements */ + --accent-3: var(--blue-3); /* accent buttons */ + --accent-4: var(--blue-4); /* accent buttons when hovered */ + --accent-5: var(--blue-5); /* accent buttons when clicked */ + --accent-new: #{c.$error}; /* stuff that's normally red like mute/deafen buttons */ + --mention: linear-gradient( + to right, + color-mix(in hsl, var(--blue-2), transparent 90%) 40%, + transparent + ); /* background of messages that mention you */ + --mention-hover: linear-gradient( + to right, + color-mix(in hsl, var(--blue-2), transparent 95%) 40%, + transparent + ); /* background of messages that mention you when hovered */ + --reply: linear-gradient( + to right, + color-mix(in hsl, var(--text-3), transparent 90%) 40%, + transparent + ); /* background of messages that reply to you */ + --reply-hover: linear-gradient( + to right, + color-mix(in hsl, var(--text-3), transparent 95%) 40%, + transparent + ); /* background of messages that reply to you when hovered */ + + /* status indicator colors */ + --online: var(--green-2); /* change to #43a25a for default */ + --dnd: var(--red-2); /* change to #d83a42 for default */ + --idle: var(--yellow-2); /* change to #ca9654 for default */ + --streaming: var(--purple-2); /* change to #593695 for default */ + --offline: var(--text-4); /* change to #83838b for default offline color */ + + /* border colors */ + --border-light: #{color.change(c.$outline, $alpha: 0)}; /* light border color */ + --border: #{color.change(c.$outline, $alpha: 0)}; /* normal border color */ + --button-border: #{color.change(c.$outline, $alpha: 0)}; /* neutral border color of buttons */ + + /* base colors */ + --red-1: #{c.$error}; + --red-2: #{color.scale(c.$error, $lightness: -5%)}; + --red-3: #{color.scale(c.$error, $lightness: -10%)}; + --red-4: #{color.scale(c.$error, $lightness: -15%)}; + --red-5: #{color.scale(c.$error, $lightness: -20%)}; + + --green-1: #{c.$green}; + --green-2: #{color.scale(c.$green, $lightness: -5%)}; + --green-3: #{color.scale(c.$green, $lightness: -10%)}; + --green-4: #{color.scale(c.$green, $lightness: -15%)}; + --green-5: #{color.scale(c.$green, $lightness: -20%)}; + + --blue-1: #{c.$primary}; + --blue-2: #{color.scale(c.$primary, $lightness: -5%)}; + --blue-3: #{color.scale(c.$primary, $lightness: -10%)}; + --blue-4: #{color.scale(c.$primary, $lightness: -15%)}; + --blue-5: #{color.scale(c.$primary, $lightness: -20%)}; + + --yellow-1: #{c.$yellow}; + --yellow-2: #{color.scale(c.$yellow, $lightness: -5%)}; + --yellow-3: #{color.scale(c.$yellow, $lightness: -10%)}; + --yellow-4: #{color.scale(c.$yellow, $lightness: -15%)}; + --yellow-5: #{color.scale(c.$yellow, $lightness: -20%)}; + + --purple-1: #{c.$mauve}; + --purple-2: #{color.scale(c.$mauve, $lightness: -5%)}; + --purple-3: #{color.scale(c.$mauve, $lightness: -10%)}; + --purple-4: #{color.scale(c.$mauve, $lightness: -15%)}; + --purple-5: #{color.scale(c.$mauve, $lightness: -20%)}; +} -- cgit v1.2.3-freya From 09f01bfd1dfebea92c2931e617fbc634e03d2b2c Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:59:23 +1000 Subject: feat: theme spicetify --- src/caelestia/data/templates/spicetify.ini | 17 +++++++++++++++++ src/caelestia/utils/theme.py | 11 ++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/caelestia/data/templates/spicetify.ini (limited to 'src/caelestia/data/templates') diff --git a/src/caelestia/data/templates/spicetify.ini b/src/caelestia/data/templates/spicetify.ini new file mode 100644 index 0000000..839f30d --- /dev/null +++ b/src/caelestia/data/templates/spicetify.ini @@ -0,0 +1,17 @@ +[caelestia] +text = $text ; Main text colour +subtext = $subtext0 ; Subtext colour +main = $base ; Panel backgrounds +highlight = $primary ; Doesn't seem to do anything +misc = $primary ; Doesn't seem to do anything +notification = $overlay0 ; Notifications probably +notification-error = $error ; Error notifications probably +shadow = $mantle ; Shadow for covers, context menu, also affects playlist/artist banners +card = $surface0 ; Context menu and tooltips +player = $base ; Doesn't seem to do anything +sidebar = $mantle ; Background +main-elevated = $surface0 ; Higher layers than main, e.g. search bar +selected-row = $text ; Selections, hover, other coloured text and slider background +button = $primary ; Slider and text buttons +button-active = $primary ; Background buttons +button-disabled = $overlay0 ; Disabled buttons diff --git a/src/caelestia/utils/theme.py b/src/caelestia/utils/theme.py index 7940547..acca868 100644 --- a/src/caelestia/utils/theme.py +++ b/src/caelestia/utils/theme.py @@ -1,4 +1,3 @@ -import json import subprocess import tempfile from pathlib import Path @@ -91,7 +90,17 @@ def apply_discord(scss: str) -> None: try_write(config_dir / client / "themes/caelestia.theme.css", conf) +def apply_spicetify(colours: dict[str, str]) -> None: + template = (templates_dir / "spicetify.ini").read_text() + + for name, colour in colours.items(): + template = template.replace(f"${name}", colour) + + try_write(config_dir / "spicetify/Themes/caelestia/color.ini", template) + + def apply_colours(colours: dict[str, str]) -> None: apply_terms(gen_sequences(colours)) apply_hypr(gen_conf(colours)) apply_discord(gen_scss(colours)) + apply_spicetify(colours) -- cgit v1.2.3-freya From 63040f68b7098ba2cf7b83ab878420debe75cfb1 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 11 Jun 2025 22:09:44 +1000 Subject: feat: theme fuzzel --- src/caelestia/data/templates/fuzzel.ini | 41 +++++++++++++++++++++++++++++++++ src/caelestia/utils/theme.py | 17 ++++++++++---- 2 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 src/caelestia/data/templates/fuzzel.ini (limited to 'src/caelestia/data/templates') 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) -- cgit v1.2.3-freya From b08858191cf6e3acda33afbd532b743ad6d0f808 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 11 Jun 2025 22:25:03 +1000 Subject: feat: theme btop Also change template replacement format --- src/caelestia/data/templates/btop.theme | 83 ++++++++++++++++++++++++++++++ src/caelestia/data/templates/fuzzel.ini | 22 ++++---- src/caelestia/data/templates/spicetify.ini | 32 ++++++------ src/caelestia/utils/theme.py | 11 +++- 4 files changed, 119 insertions(+), 29 deletions(-) create mode 100644 src/caelestia/data/templates/btop.theme (limited to 'src/caelestia/data/templates') diff --git a/src/caelestia/data/templates/btop.theme b/src/caelestia/data/templates/btop.theme new file mode 100644 index 0000000..9e63bce --- /dev/null +++ b/src/caelestia/data/templates/btop.theme @@ -0,0 +1,83 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]={{ $surface }} + +# Main text color +theme[main_fg]={{ $onSurface }} + +# Title color for boxes +theme[title]={{ $onSurface }} + +# Highlight color for keyboard shortcuts +theme[hi_fg]={{ $primary }} + +# Background color of selected item in processes box +theme[selected_bg]={{ $surfaceContainer }} + +# Foreground color of selected item in processes box +theme[selected_fg]={{ $primary }} + +# Color of inactive/disabled text +theme[inactive_fg]={{ $outline }} + +# Color of text appearing on top of graphs, i.e uptime and current network graph scaling +theme[graph_text]={{ $tertiary }} + +# Background color of the percentage meters +theme[meter_bg]={{ $outline }} + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]={{ $tertiary }} + +# CPU, Memory, Network, Proc box outline colors +theme[cpu_box]={{ $mauve }} +theme[mem_box]={{ $green }} +theme[net_box]={{ $maroon }} +theme[proc_box]={{ $blue }} + +# Box divider line and small boxes line color +theme[div_line]={{ $outlineVariant }} + +# Temperature graph color (Green -> Yellow -> Red) +theme[temp_start]={{ $green }} +theme[temp_mid]={{ $yellow }} +theme[temp_end]={{ $red }} + +# CPU graph colors (Teal -> Sapphire -> Lavender) +theme[cpu_start]={{ $teal }} +theme[cpu_mid]={{ $sapphire }} +theme[cpu_end]={{ $lavender }} + +# Mem/Disk free meter (Mauve -> Lavender -> Blue) +theme[free_start]={{ $mauve }} +theme[free_mid]={{ $lavender }} +theme[free_end]={{ $blue }} + +# Mem/Disk cached meter (Sapphire -> Blue -> Lavender) +theme[cached_start]={{ $sapphire }} +theme[cached_mid]={{ $blue }} +theme[cached_end]={{ $lavender }} + +# Mem/Disk available meter (Peach -> Maroon -> Red) +theme[available_start]={{ $peach }} +theme[available_mid]={{ $maroon }} +theme[available_end]={{ $red }} + +# Mem/Disk used meter (Green -> Teal -> Sky) +theme[used_start]={{ $green }} +theme[used_mid]={{ $teal }} +theme[used_end]={{ $sky }} + +# Download graph colors (Peach -> Maroon -> Red) +theme[download_start]={{ $peach }} +theme[download_mid]={{ $maroon }} +theme[download_end]={{ $red }} + +# Upload graph colors (Green -> Teal -> Sky) +theme[upload_start]={{ $green }} +theme[upload_mid]={{ $teal }} +theme[upload_end]={{ $sky }} + +# Process box color gradient for threads, mem and cpu usage (Sapphire -> Lavender -> Mauve) +theme[process_start]={{ $sapphire }} +theme[process_mid]={{ $lavender }} +theme[process_end]={{ $mauve }} diff --git a/src/caelestia/data/templates/fuzzel.ini b/src/caelestia/data/templates/fuzzel.ini index d4eaafe..d61f208 100644 --- a/src/caelestia/data/templates/fuzzel.ini +++ b/src/caelestia/data/templates/fuzzel.ini @@ -28,14 +28,14 @@ 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 +background={{ $surface }}dd +text={{ $onSurface }}dd +prompt={{ $primary }}ff +placeholder={{ $outline }}ff +input={{ $onSurface }}ff +match={{ $tertiary }}ff +selection={{ $primary }}87 +selection-text={{ $onSurface }}ff +selection-match={{ $tertiary }}ff +counter={{ $outline }}ff +border={{ $primary }}77 diff --git a/src/caelestia/data/templates/spicetify.ini b/src/caelestia/data/templates/spicetify.ini index 839f30d..976a0c9 100644 --- a/src/caelestia/data/templates/spicetify.ini +++ b/src/caelestia/data/templates/spicetify.ini @@ -1,17 +1,17 @@ [caelestia] -text = $text ; Main text colour -subtext = $subtext0 ; Subtext colour -main = $base ; Panel backgrounds -highlight = $primary ; Doesn't seem to do anything -misc = $primary ; Doesn't seem to do anything -notification = $overlay0 ; Notifications probably -notification-error = $error ; Error notifications probably -shadow = $mantle ; Shadow for covers, context menu, also affects playlist/artist banners -card = $surface0 ; Context menu and tooltips -player = $base ; Doesn't seem to do anything -sidebar = $mantle ; Background -main-elevated = $surface0 ; Higher layers than main, e.g. search bar -selected-row = $text ; Selections, hover, other coloured text and slider background -button = $primary ; Slider and text buttons -button-active = $primary ; Background buttons -button-disabled = $overlay0 ; Disabled buttons +text = {{ $text }} ; Main text colour +subtext = {{ $subtext0 }} ; Subtext colour +main = {{ $base }} ; Panel backgrounds +highlight = {{ $primary }} ; Doesn't seem to do anything +misc = {{ $primary }} ; Doesn't seem to do anything +notification = {{ $overlay0 }} ; Notifications probably +notification-error = {{ $error }} ; Error notifications probably +shadow = {{ $mantle }} ; Shadow for covers, context menu, also affects playlist/artist banners +card = {{ $surface0 }} ; Context menu and tooltips +player = {{ $base }} ; Doesn't seem to do anything +sidebar = {{ $mantle }} ; Background +main-elevated = {{ $surface0 }} ; Higher layers than main, e.g. search bar +selected-row = {{ $text }} ; Selections, hover, other coloured text and slider background +button = {{ $primary }} ; Slider and text buttons +button-active = {{ $primary }} ; Background buttons +button-disabled = {{ $overlay0 }} ; Disabled buttons diff --git a/src/caelestia/utils/theme.py b/src/caelestia/utils/theme.py index c4e9899..7f29637 100644 --- a/src/caelestia/utils/theme.py +++ b/src/caelestia/utils/theme.py @@ -19,10 +19,10 @@ def gen_scss(colours: dict[str, str]) -> str: return scss -def gen_replace(colours: dict[str, str], template: Path) -> str: +def gen_replace(colours: dict[str, str], template: Path, hash: bool = False) -> str: template = template.read_text() for name, colour in colours.items(): - template = template.replace(f"${name}", colour) + template = template.replace(f"{{{{ ${name} }}}}", f"#{colour}" if hash else colour) return template @@ -107,9 +107,16 @@ def apply_fuzzel(colours: dict[str, str]) -> None: try_write(config_dir / "fuzzel/fuzzel.ini", template) +def apply_btop(colours: dict[str, str]) -> None: + template = gen_replace(colours, templates_dir / "btop.theme", hash=True) + try_write(config_dir / "btop/themes/caelestia.theme", template) + subprocess.run(["killall", "-USR2", "btop"]) + + def apply_colours(colours: dict[str, str]) -> None: apply_terms(gen_sequences(colours)) apply_hypr(gen_conf(colours)) apply_discord(gen_scss(colours)) apply_spicetify(colours) apply_fuzzel(colours) + apply_btop(colours) -- cgit v1.2.3-freya From 2161e3ee6b61c0ebd56142ccd9502404d3ee1314 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 11 Jun 2025 22:48:09 +1000 Subject: theme: better spicetify colours --- src/caelestia/data/templates/spicetify-dark.ini | 19 +++++++++++++++++++ src/caelestia/data/templates/spicetify-light.ini | 19 +++++++++++++++++++ src/caelestia/data/templates/spicetify.ini | 17 ----------------- src/caelestia/subcommands/scheme.py | 2 +- src/caelestia/utils/theme.py | 8 ++++---- 5 files changed, 43 insertions(+), 22 deletions(-) create mode 100644 src/caelestia/data/templates/spicetify-dark.ini create mode 100644 src/caelestia/data/templates/spicetify-light.ini delete mode 100644 src/caelestia/data/templates/spicetify.ini (limited to 'src/caelestia/data/templates') diff --git a/src/caelestia/data/templates/spicetify-dark.ini b/src/caelestia/data/templates/spicetify-dark.ini new file mode 100644 index 0000000..4bf85eb --- /dev/null +++ b/src/caelestia/data/templates/spicetify-dark.ini @@ -0,0 +1,19 @@ +[caelestia] +text = {{ $onSurface }} ; Main text colour +subtext = {{ $onSurfaceVariant }} ; Subtext colour +main = {{ $surfaceContainer }} ; Panel backgrounds +highlight = {{ $primary }} ; Doesn't seem to do anything +misc = {{ $primary }} ; Doesn't seem to do anything +notification = {{ $outline }} ; Notifications probably +notification-error = {{ $error }} ; Error notifications probably +shadow = {{ $shadow }} ; Shadow for covers, context menu, also affects playlist/artist banners +card = {{ $surfaceContainerHigh }} ; Context menu and tooltips +player = {{ $secondaryContainer }} ; Background for top result in search +sidebar = {{ $surface }} ; Background +main-elevated = {{ $surfaceContainerHigh }} ; Higher layers than main, e.g. search bar +highlight-elevated = {{ $surfaceContainerHighest }} ; Home button and search bar accelerator +selected-row = {{ $onSurface }} ; Selections, hover, other coloured text and slider background +button = {{ $primary }} ; Slider and text buttons +button-active = {{ $primary }} ; Background buttons +button-disabled = {{ $outline }} ; Disabled buttons +tab-active = {{ $surfaceContainerHigh }} ; Profile fallbacks in search diff --git a/src/caelestia/data/templates/spicetify-light.ini b/src/caelestia/data/templates/spicetify-light.ini new file mode 100644 index 0000000..a8b361b --- /dev/null +++ b/src/caelestia/data/templates/spicetify-light.ini @@ -0,0 +1,19 @@ +[caelestia] +text = {{ $onSurface }} ; Main text colour +subtext = {{ $onSurfaceVariant }} ; Subtext colour +main = {{ $surface }} ; Panel backgrounds +highlight = {{ $primary }} ; Doesn't seem to do anything +misc = {{ $primary }} ; Doesn't seem to do anything +notification = {{ $outline }} ; Notifications probably +notification-error = {{ $error }} ; Error notifications probably +shadow = {{ $shadow }} ; Shadow for covers, context menu, also affects playlist/artist banners +card = {{ $surfaceContainer }} ; Context menu and tooltips +player = {{ $secondaryContainer }} ; Background for top result in search +sidebar = {{ $surfaceContainer }} ; Background +main-elevated = {{ $surfaceContainerHigh }} ; Higher layers than main, e.g. search bar +highlight-elevated = {{ $surfaceContainerHighest }} ; Home button and search bar accelerator +selected-row = {{ $onSurface }} ; Selections, hover, other coloured text and slider background +button = {{ $primary }} ; Slider and text buttons +button-active = {{ $primary }} ; Background buttons +button-disabled = {{ $outline }} ; Disabled buttons +tab-active = {{ $surfaceContainer }} ; Profile fallbacks in search diff --git a/src/caelestia/data/templates/spicetify.ini b/src/caelestia/data/templates/spicetify.ini deleted file mode 100644 index 976a0c9..0000000 --- a/src/caelestia/data/templates/spicetify.ini +++ /dev/null @@ -1,17 +0,0 @@ -[caelestia] -text = {{ $text }} ; Main text colour -subtext = {{ $subtext0 }} ; Subtext colour -main = {{ $base }} ; Panel backgrounds -highlight = {{ $primary }} ; Doesn't seem to do anything -misc = {{ $primary }} ; Doesn't seem to do anything -notification = {{ $overlay0 }} ; Notifications probably -notification-error = {{ $error }} ; Error notifications probably -shadow = {{ $mantle }} ; Shadow for covers, context menu, also affects playlist/artist banners -card = {{ $surface0 }} ; Context menu and tooltips -player = {{ $base }} ; Doesn't seem to do anything -sidebar = {{ $mantle }} ; Background -main-elevated = {{ $surface0 }} ; Higher layers than main, e.g. search bar -selected-row = {{ $text }} ; Selections, hover, other coloured text and slider background -button = {{ $primary }} ; Slider and text buttons -button-active = {{ $primary }} ; Background buttons -button-disabled = {{ $overlay0 }} ; Disabled buttons diff --git a/src/caelestia/subcommands/scheme.py b/src/caelestia/subcommands/scheme.py index fa1f49a..e149d13 100644 --- a/src/caelestia/subcommands/scheme.py +++ b/src/caelestia/subcommands/scheme.py @@ -22,6 +22,6 @@ class Command: scheme.flavour = self.args.flavour if self.args.mode: scheme.mode = self.args.mode - apply_colours(scheme.colours) + apply_colours(scheme.colours, scheme.mode) else: print(scheme) diff --git a/src/caelestia/utils/theme.py b/src/caelestia/utils/theme.py index 7f29637..3250ea3 100644 --- a/src/caelestia/utils/theme.py +++ b/src/caelestia/utils/theme.py @@ -97,8 +97,8 @@ def apply_discord(scss: str) -> None: try_write(config_dir / client / "themes/caelestia.theme.css", conf) -def apply_spicetify(colours: dict[str, str]) -> None: - template = gen_replace(colours, templates_dir / "spicetify.ini") +def apply_spicetify(colours: dict[str, str], mode: str) -> None: + template = gen_replace(colours, templates_dir / f"spicetify-{mode}.ini") try_write(config_dir / "spicetify/Themes/caelestia/color.ini", template) @@ -113,10 +113,10 @@ def apply_btop(colours: dict[str, str]) -> None: subprocess.run(["killall", "-USR2", "btop"]) -def apply_colours(colours: dict[str, str]) -> None: +def apply_colours(colours: dict[str, str], mode: str) -> None: apply_terms(gen_sequences(colours)) apply_hypr(gen_conf(colours)) apply_discord(gen_scss(colours)) - apply_spicetify(colours) + apply_spicetify(colours, mode) apply_fuzzel(colours) apply_btop(colours) -- cgit v1.2.3-freya