feat: theme btop

Also change template replacement format
This commit is contained in:
2 * r + 2 * t
2025-06-11 22:25:03 +10:00
parent 63040f68b7
commit b08858191c
4 changed files with 119 additions and 29 deletions
+83
View File
@@ -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 }}
+11 -11
View File
@@ -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
+16 -16
View File
@@ -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
+9 -2
View File
@@ -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)