mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-05 23:09:27 -05:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e711ec289 | |||
| 7899f8348f | |||
| b0d68f0a1c | |||
| b0325a1898 | |||
| a6defd2921 | |||
| 0b9e416175 | |||
| 8ce97ea3f5 | |||
| 25c473c18e | |||
| c22916fe45 | |||
| 011989e3ca | |||
| d88cc7ff79 | |||
| a550eb79ed |
Generated
+10
-10
@@ -9,11 +9,11 @@
|
|||||||
"quickshell": "quickshell"
|
"quickshell": "quickshell"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1770949235,
|
"lastModified": 1772330657,
|
||||||
"narHash": "sha256-OFeud9FjaOk6xHp/9igYl/+Zw6FJDyZNrIDNi47gsG0=",
|
"narHash": "sha256-cWblprYsDUeAWA57xAqxIjNxXvDI/rqYn6TFp2OPi/k=",
|
||||||
"owner": "caelestia-dots",
|
"owner": "caelestia-dots",
|
||||||
"repo": "shell",
|
"repo": "shell",
|
||||||
"rev": "93e8880842b03e251bf59d1ba316f2393c68574f",
|
"rev": "278fd4a4ed1bfb42c3fe197ff38b587539c012aa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1770841267,
|
"lastModified": 1772198003,
|
||||||
"narHash": "sha256-9xejG0KoqsoKEGp2kVbXRlEYtFFcDTHjidiuX8hGO44=",
|
"narHash": "sha256-I45esRSssFtJ8p/gLHUZ1OUaaTaVLluNkABkk6arQwE=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "ec7c70d12ce2fc37cb92aff673dcdca89d187bae",
|
"rev": "dd9b079222d43e1943b6ebd802f04fd959dc8e61",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -46,11 +46,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1769593411,
|
"lastModified": 1771926182,
|
||||||
"narHash": "sha256-WW00FaBiUmQyxvSbefvgxIjwf/WmRrEGBbwMHvW/7uQ=",
|
"narHash": "sha256-QbXuSLhiSxOq6ydBL3+KGe1aiYWBW+e3J6qjJZaRMq0=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "1e4d804e7f3fa7465811030e8da2bf10d544426a",
|
"rev": "cddb4f061bab495f4473ca5f2c571b6c710efef7",
|
||||||
"revCount": 732,
|
"revCount": 744,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
|
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,162 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://github.com/longbridge/gpui-component/raw/refs/heads/main/.theme-schema.json",
|
||||||
|
"name": "Caelestia",
|
||||||
|
"author": "Unrectified",
|
||||||
|
"url": "https://github.com/caelestia-dots/cli",
|
||||||
|
"themes": [
|
||||||
|
{
|
||||||
|
"name": "Caelestia",
|
||||||
|
"mode": "{{ $mode }}",
|
||||||
|
"colors": {
|
||||||
|
"accent.background": "{{ $surfaceContainerHigh }}",
|
||||||
|
"accent.foreground": "{{ $onSurface }}",
|
||||||
|
"background": "{{ $background }}",
|
||||||
|
"border": "{{ $outlineVariant }}",
|
||||||
|
"danger.background": "{{ $error }}",
|
||||||
|
"foreground": "{{ $onBackground }}",
|
||||||
|
"input.border": "{{ $outline }}",
|
||||||
|
"link.active.foreground": "{{ $primary }}",
|
||||||
|
"link.foreground": "{{ $primary }}",
|
||||||
|
"link.hover.foreground": "{{ $primaryFixed }}",
|
||||||
|
"list.active.background": "{{ $secondaryContainer }}",
|
||||||
|
"list.active.border": "{{ $secondary }}",
|
||||||
|
"list.even.background": "{{ $surfaceContainerLowest }}",
|
||||||
|
"muted.background": "{{ $surfaceVariant }}",
|
||||||
|
"muted.foreground": "{{ $onSurfaceVariant }}",
|
||||||
|
"panel.background": "{{ $surfaceContainer }}",
|
||||||
|
"popover.background": "{{ $surfaceContainerHigh }}",
|
||||||
|
"popover.foreground": "{{ $onSurface }}",
|
||||||
|
"primary.active.background": "{{ $primaryFixedDim }}",
|
||||||
|
"primary.background": "{{ $primary }}",
|
||||||
|
"primary.foreground": "{{ $onPrimary }}",
|
||||||
|
"primary.hover.background": "{{ $primaryFixed }}",
|
||||||
|
"scrollbar.background": "{{ $surface }}",
|
||||||
|
"scrollbar.thumb.background": "{{ $outline }}",
|
||||||
|
"secondary.background": "{{ $secondaryContainer }}",
|
||||||
|
"secondary.active.background": "{{ $secondaryFixedDim }}",
|
||||||
|
"secondary.foreground": "{{ $onSecondary }}",
|
||||||
|
"secondary.hover.background": "{{ $secondaryFixed }}",
|
||||||
|
"tab.active.background": "{{ $surface }}",
|
||||||
|
"tab.active.foreground": "{{ $onSurface }}",
|
||||||
|
"tab.background": "{{ $surfaceContainerLowest }}",
|
||||||
|
"tab.foreground": "{{ $onSurfaceVariant }}",
|
||||||
|
"tab_bar.background": "{{ $surface }}",
|
||||||
|
"table.background": "{{ $surfaceContainer }}",
|
||||||
|
"table.head.foreground": "{{ $onSurfaceVariant }}",
|
||||||
|
"table.row.border": "{{ $outlineVariant }}",
|
||||||
|
"title_bar.background": "{{ $surfaceDim }}",
|
||||||
|
"ring": "{{ $primary }}",
|
||||||
|
"base.red": "{{ $red }}",
|
||||||
|
"base.red.light": "{{ $peach }}",
|
||||||
|
"base.green": "{{ $green }}",
|
||||||
|
"base.green.light": "{{ $teal }}",
|
||||||
|
"base.blue": "{{ $blue }}",
|
||||||
|
"base.blue.light": "{{ $sky }}",
|
||||||
|
"base.cyan": "{{ $teal }}",
|
||||||
|
"base.cyan.light": "{{ $sky }}",
|
||||||
|
"base.magenta": "{{ $mauve }}",
|
||||||
|
"base.magenta.light": "{{ $pink }}",
|
||||||
|
"base.yellow": "{{ $yellow }}",
|
||||||
|
"base.yellow.light": "{{ $peach }}"
|
||||||
|
},
|
||||||
|
"highlight": {
|
||||||
|
"editor.foreground": "{{ $onSurface }}",
|
||||||
|
"editor.background": "{{ $surface }}",
|
||||||
|
"editor.active_line.background": "{{ $surfaceContainerLow }}",
|
||||||
|
"editor.line_number": "{{ $onSurfaceVariant }}",
|
||||||
|
"editor.active_line_number": "{{ $onSurface }}",
|
||||||
|
"editor.invisible": "{{ $outlineVariant }}",
|
||||||
|
"conflict": "{{ $red }}",
|
||||||
|
"created": "{{ $green }}",
|
||||||
|
"deleted": "{{ $red }}",
|
||||||
|
"error": "{{ $error }}",
|
||||||
|
"hidden": "{{ $outline }}",
|
||||||
|
"hint": "{{ $success }}",
|
||||||
|
"ignored": "{{ $outline }}",
|
||||||
|
"info": "{{ $blue }}",
|
||||||
|
"modified": "{{ $yellow }}",
|
||||||
|
"predictive": "{{ $overlay1 }}",
|
||||||
|
"renamed": "{{ $green }}",
|
||||||
|
"success": "{{ $success }}",
|
||||||
|
"unreachable": "{{ $outlineVariant }}",
|
||||||
|
"warning": "{{ $yellow }}",
|
||||||
|
"syntax": {
|
||||||
|
"attribute": {
|
||||||
|
"color": "{{ $yellow }}"
|
||||||
|
},
|
||||||
|
"boolean": {
|
||||||
|
"color": "{{ $green }}"
|
||||||
|
},
|
||||||
|
"comment": {
|
||||||
|
"color": "{{ $subtext0 }}",
|
||||||
|
"font_style": "italic"
|
||||||
|
},
|
||||||
|
"comment.doc": {
|
||||||
|
"color": "{{ $subtext0 }}",
|
||||||
|
"font_style": "italic"
|
||||||
|
},
|
||||||
|
"constant": {
|
||||||
|
"color": "{{ $red }}"
|
||||||
|
},
|
||||||
|
"constructor": {
|
||||||
|
"color": "{{ $yellow }}"
|
||||||
|
},
|
||||||
|
"embedded": {
|
||||||
|
"color": "{{ $onSurface }}"
|
||||||
|
},
|
||||||
|
"function": {
|
||||||
|
"color": "{{ $green }}"
|
||||||
|
},
|
||||||
|
"keyword": {
|
||||||
|
"color": "{{ $mauve }}"
|
||||||
|
},
|
||||||
|
"link_text": {
|
||||||
|
"color": "{{ $sky }}",
|
||||||
|
"font_style": "normal"
|
||||||
|
},
|
||||||
|
"link_uri": {
|
||||||
|
"color": "{{ $klink }}",
|
||||||
|
"font_style": "italic"
|
||||||
|
},
|
||||||
|
"number": {
|
||||||
|
"color": "{{ $red }}"
|
||||||
|
},
|
||||||
|
"string": {
|
||||||
|
"color": "{{ $green }}"
|
||||||
|
},
|
||||||
|
"string.escape": {
|
||||||
|
"color": "{{ $green }}"
|
||||||
|
},
|
||||||
|
"string.regex": {
|
||||||
|
"color": "{{ $green }}"
|
||||||
|
},
|
||||||
|
"string.special": {
|
||||||
|
"color": "{{ $yellow }}"
|
||||||
|
},
|
||||||
|
"string.special.symbol": {
|
||||||
|
"color": "{{ $yellow }}"
|
||||||
|
},
|
||||||
|
"tag": {
|
||||||
|
"color": "{{ $yellow }}"
|
||||||
|
},
|
||||||
|
"text.literal": {
|
||||||
|
"color": "{{ $red }}"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"color": "{{ $sky }}",
|
||||||
|
"font_weight": 600
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"color": "{{ $yellow }}"
|
||||||
|
},
|
||||||
|
"property": {
|
||||||
|
"color": "{{ $onSurface }}"
|
||||||
|
},
|
||||||
|
"variable.special": {
|
||||||
|
"color": "{{ $red }}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
from materialyoucolor.blend import Blend
|
from materialyoucolor.blend import Blend
|
||||||
from materialyoucolor.dynamiccolor.material_dynamic_colors import (
|
from materialyoucolor.dynamiccolor.material_dynamic_colors import MaterialDynamicColors
|
||||||
DynamicScheme,
|
|
||||||
MaterialDynamicColors,
|
|
||||||
)
|
|
||||||
from materialyoucolor.hct import Hct
|
from materialyoucolor.hct import Hct
|
||||||
from materialyoucolor.scheme.scheme_content import SchemeContent
|
from materialyoucolor.scheme.scheme_content import SchemeContent
|
||||||
from materialyoucolor.scheme.scheme_expressive import SchemeExpressive
|
from materialyoucolor.scheme.scheme_expressive import SchemeExpressive
|
||||||
@@ -15,6 +12,11 @@ from materialyoucolor.scheme.scheme_tonal_spot import SchemeTonalSpot
|
|||||||
from materialyoucolor.scheme.scheme_vibrant import SchemeVibrant
|
from materialyoucolor.scheme.scheme_vibrant import SchemeVibrant
|
||||||
from materialyoucolor.utils.math_utils import difference_degrees, rotation_direction, sanitize_degrees_double
|
from materialyoucolor.utils.math_utils import difference_degrees, rotation_direction, sanitize_degrees_double
|
||||||
|
|
||||||
|
try:
|
||||||
|
from materialyoucolor.dynamiccolor.dynamic_scheme import DynamicScheme
|
||||||
|
except ImportError:
|
||||||
|
from materialyoucolor.scheme.dynamic_scheme import DynamicScheme
|
||||||
|
|
||||||
|
|
||||||
def hex_to_hct(hex: str) -> Hct:
|
def hex_to_hct(hex: str) -> Hct:
|
||||||
return Hct.from_int(int(f"0xFF{hex}", 16))
|
return Hct.from_int(int(f"0xFF{hex}", 16))
|
||||||
|
|||||||
@@ -155,6 +155,12 @@ def apply_discord(scss: str) -> None:
|
|||||||
for client in "Equicord", "Vencord", "BetterDiscord", "equibop", "vesktop", "legcord":
|
for client in "Equicord", "Vencord", "BetterDiscord", "equibop", "vesktop", "legcord":
|
||||||
write_file(config_dir / client / "themes/caelestia.theme.css", conf)
|
write_file(config_dir / client / "themes/caelestia.theme.css", conf)
|
||||||
|
|
||||||
|
@log_exception
|
||||||
|
def apply_pandora(colours: dict[str, str], mode: str) -> None:
|
||||||
|
template = gen_replace(colours, templates_dir / "pandora.json", hash=True)
|
||||||
|
template = template.replace("{{ $mode }}", mode)
|
||||||
|
write_file(data_dir / "PandoraLauncher/themes/caelestia.json", template)
|
||||||
|
|
||||||
|
|
||||||
@log_exception
|
@log_exception
|
||||||
def apply_spicetify(colours: dict[str, str], mode: str) -> None:
|
def apply_spicetify(colours: dict[str, str], mode: str) -> None:
|
||||||
@@ -396,6 +402,8 @@ def apply_colours(colours: dict[str, str], mode: str) -> None:
|
|||||||
apply_discord(gen_scss(colours))
|
apply_discord(gen_scss(colours))
|
||||||
if check("enableSpicetify"):
|
if check("enableSpicetify"):
|
||||||
apply_spicetify(colours, mode)
|
apply_spicetify(colours, mode)
|
||||||
|
if check("enablePandora"):
|
||||||
|
apply_pandora(colours, mode)
|
||||||
if check("enableFuzzel"):
|
if check("enableFuzzel"):
|
||||||
apply_fuzzel(colours)
|
apply_fuzzel(colours)
|
||||||
if check("enableBtop"):
|
if check("enableBtop"):
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ from caelestia.utils.theme import apply_colours
|
|||||||
|
|
||||||
|
|
||||||
def is_valid_image(path: Path) -> bool:
|
def is_valid_image(path: Path) -> bool:
|
||||||
return path.is_file() and path.suffix in [".jpg", ".jpeg", ".png", ".webp", ".tif", ".tiff"]
|
return path.is_file() and path.suffix in [".jpg", ".jpeg", ".png", ".webp", ".tif", ".tiff", ".gif"]
|
||||||
|
|
||||||
|
|
||||||
def check_wall(wall: Path, filter_size: tuple[int, int], threshold: float) -> bool:
|
def check_wall(wall: Path, filter_size: tuple[int, int], threshold: float) -> bool:
|
||||||
@@ -99,6 +99,9 @@ def get_colours_for_wall(wall: Path | str, no_smart: bool) -> None:
|
|||||||
scheme = get_scheme()
|
scheme = get_scheme()
|
||||||
cache = wallpapers_cache_dir / compute_hash(wall)
|
cache = wallpapers_cache_dir / compute_hash(wall)
|
||||||
|
|
||||||
|
if wall.suffix.lower() == ".gif":
|
||||||
|
wall = convert_gif(wall)
|
||||||
|
|
||||||
name = "dynamic"
|
name = "dynamic"
|
||||||
|
|
||||||
if not no_smart:
|
if not no_smart:
|
||||||
@@ -121,6 +124,24 @@ def get_colours_for_wall(wall: Path | str, no_smart: bool) -> None:
|
|||||||
"colours": get_colours_for_image(get_thumb(wall, cache), scheme),
|
"colours": get_colours_for_image(get_thumb(wall, cache), scheme),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def convert_gif(wall: Path) -> Path:
|
||||||
|
cache = wallpapers_cache_dir / compute_hash(wall)
|
||||||
|
output_path = cache / "first_frame.png"
|
||||||
|
|
||||||
|
if not output_path.exists():
|
||||||
|
output_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
with Image.open(wall) as img:
|
||||||
|
try:
|
||||||
|
img.seek(0)
|
||||||
|
except EOFError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
img = img.convert("RGB")
|
||||||
|
img.save(output_path, "PNG")
|
||||||
|
|
||||||
|
return output_path
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def set_wallpaper(wall: Path | str, no_smart: bool) -> None:
|
def set_wallpaper(wall: Path | str, no_smart: bool) -> None:
|
||||||
# Make path absolute
|
# Make path absolute
|
||||||
@@ -129,6 +150,9 @@ def set_wallpaper(wall: Path | str, no_smart: bool) -> None:
|
|||||||
if not is_valid_image(wall):
|
if not is_valid_image(wall):
|
||||||
raise ValueError(f'"{wall}" is not a valid image')
|
raise ValueError(f'"{wall}" is not a valid image')
|
||||||
|
|
||||||
|
# Use gif's 1st frame for thumb only
|
||||||
|
wall_cache = convert_gif(wall) if wall.suffix.lower() == ".gif" else wall
|
||||||
|
|
||||||
# Update files
|
# Update files
|
||||||
wallpaper_path_path.parent.mkdir(parents=True, exist_ok=True)
|
wallpaper_path_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
wallpaper_path_path.write_text(str(wall))
|
wallpaper_path_path.write_text(str(wall))
|
||||||
@@ -136,10 +160,10 @@ def set_wallpaper(wall: Path | str, no_smart: bool) -> None:
|
|||||||
wallpaper_link_path.unlink(missing_ok=True)
|
wallpaper_link_path.unlink(missing_ok=True)
|
||||||
wallpaper_link_path.symlink_to(wall)
|
wallpaper_link_path.symlink_to(wall)
|
||||||
|
|
||||||
cache = wallpapers_cache_dir / compute_hash(wall)
|
cache = wallpapers_cache_dir / compute_hash(wall_cache)
|
||||||
|
|
||||||
# Generate thumbnail or get from cache
|
# Generate thumbnail or get from cache
|
||||||
thumb = get_thumb(wall, cache)
|
thumb = get_thumb(wall_cache, cache)
|
||||||
wallpaper_thumbnail_path.parent.mkdir(parents=True, exist_ok=True)
|
wallpaper_thumbnail_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
wallpaper_thumbnail_path.unlink(missing_ok=True)
|
wallpaper_thumbnail_path.unlink(missing_ok=True)
|
||||||
wallpaper_thumbnail_path.symlink_to(thumb)
|
wallpaper_thumbnail_path.symlink_to(thumb)
|
||||||
@@ -148,7 +172,7 @@ def set_wallpaper(wall: Path | str, no_smart: bool) -> None:
|
|||||||
|
|
||||||
# Change mode and variant based on wallpaper colour
|
# Change mode and variant based on wallpaper colour
|
||||||
if scheme.name == "dynamic" and not no_smart:
|
if scheme.name == "dynamic" and not no_smart:
|
||||||
smart_opts = get_smart_opts(wall, cache)
|
smart_opts = get_smart_opts(wall_cache, cache)
|
||||||
scheme.mode = smart_opts["mode"]
|
scheme.mode = smart_opts["mode"]
|
||||||
scheme.variant = smart_opts["variant"]
|
scheme.variant = smart_opts["variant"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user