forked from Shinonome/caelestia-cli
feat: theme btop
Also change template replacement format
This commit is contained in:
@@ -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 }}
|
||||||
@@ -28,14 +28,14 @@ radius=10
|
|||||||
width=2
|
width=2
|
||||||
|
|
||||||
[colors]
|
[colors]
|
||||||
background=$surfacedd
|
background={{ $surface }}dd
|
||||||
text=$onSurfacedd
|
text={{ $onSurface }}dd
|
||||||
prompt=$primaryff
|
prompt={{ $primary }}ff
|
||||||
placeholder=$outlineff
|
placeholder={{ $outline }}ff
|
||||||
input=$onSurfaceff
|
input={{ $onSurface }}ff
|
||||||
match=$tertiaryff
|
match={{ $tertiary }}ff
|
||||||
selection=$primary87
|
selection={{ $primary }}87
|
||||||
selection-text=$onSurfaceff
|
selection-text={{ $onSurface }}ff
|
||||||
selection-match=$tertiaryff
|
selection-match={{ $tertiary }}ff
|
||||||
counter=$outlineff
|
counter={{ $outline }}ff
|
||||||
border=$primary77
|
border={{ $primary }}77
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
[caelestia]
|
[caelestia]
|
||||||
text = $text ; Main text colour
|
text = {{ $text }} ; Main text colour
|
||||||
subtext = $subtext0 ; Subtext colour
|
subtext = {{ $subtext0 }} ; Subtext colour
|
||||||
main = $base ; Panel backgrounds
|
main = {{ $base }} ; Panel backgrounds
|
||||||
highlight = $primary ; Doesn't seem to do anything
|
highlight = {{ $primary }} ; Doesn't seem to do anything
|
||||||
misc = $primary ; Doesn't seem to do anything
|
misc = {{ $primary }} ; Doesn't seem to do anything
|
||||||
notification = $overlay0 ; Notifications probably
|
notification = {{ $overlay0 }} ; Notifications probably
|
||||||
notification-error = $error ; Error notifications probably
|
notification-error = {{ $error }} ; Error notifications probably
|
||||||
shadow = $mantle ; Shadow for covers, context menu, also affects playlist/artist banners
|
shadow = {{ $mantle }} ; Shadow for covers, context menu, also affects playlist/artist banners
|
||||||
card = $surface0 ; Context menu and tooltips
|
card = {{ $surface0 }} ; Context menu and tooltips
|
||||||
player = $base ; Doesn't seem to do anything
|
player = {{ $base }} ; Doesn't seem to do anything
|
||||||
sidebar = $mantle ; Background
|
sidebar = {{ $mantle }} ; Background
|
||||||
main-elevated = $surface0 ; Higher layers than main, e.g. search bar
|
main-elevated = {{ $surface0 }} ; Higher layers than main, e.g. search bar
|
||||||
selected-row = $text ; Selections, hover, other coloured text and slider background
|
selected-row = {{ $text }} ; Selections, hover, other coloured text and slider background
|
||||||
button = $primary ; Slider and text buttons
|
button = {{ $primary }} ; Slider and text buttons
|
||||||
button-active = $primary ; Background buttons
|
button-active = {{ $primary }} ; Background buttons
|
||||||
button-disabled = $overlay0 ; Disabled buttons
|
button-disabled = {{ $overlay0 }} ; Disabled buttons
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ def gen_scss(colours: dict[str, str]) -> str:
|
|||||||
return scss
|
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()
|
template = template.read_text()
|
||||||
for name, colour in colours.items():
|
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
|
return template
|
||||||
|
|
||||||
|
|
||||||
@@ -107,9 +107,16 @@ def apply_fuzzel(colours: dict[str, str]) -> None:
|
|||||||
try_write(config_dir / "fuzzel/fuzzel.ini", template)
|
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:
|
def apply_colours(colours: dict[str, str]) -> None:
|
||||||
apply_terms(gen_sequences(colours))
|
apply_terms(gen_sequences(colours))
|
||||||
apply_hypr(gen_conf(colours))
|
apply_hypr(gen_conf(colours))
|
||||||
apply_discord(gen_scss(colours))
|
apply_discord(gen_scss(colours))
|
||||||
apply_spicetify(colours)
|
apply_spicetify(colours)
|
||||||
apply_fuzzel(colours)
|
apply_fuzzel(colours)
|
||||||
|
apply_btop(colours)
|
||||||
|
|||||||
Reference in New Issue
Block a user