From d37cfd92ddd2f7b3dbb7c2eaf3600a8aac1edc5a Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Mon, 2 Nov 2026 22:44:34 +0300 Subject: [PATCH] fixup! fixup! fixup! Install lucid --- modules/user.nix | 1 + user/sweetbread/home.nix | 2 -- user/sweetbread/modules/lucid.nix | 29 +++++++++++++++++++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/modules/user.nix b/modules/user.nix index 2d7ea75..aea79dc 100644 --- a/modules/user.nix +++ b/modules/user.nix @@ -5,6 +5,7 @@ ./user/helix.nix ./user/hyprland.nix ./user/hyprlock.nix + ../user/sweetbread/modules/lucid.nix ./user/mako.nix ./user/neofetch.nix ./user/qt.nix diff --git a/user/sweetbread/home.nix b/user/sweetbread/home.nix index d789863..bcc1eb4 100644 --- a/user/sweetbread/home.nix +++ b/user/sweetbread/home.nix @@ -1,6 +1,4 @@ { pkgs, ... }: { - imports = [ ./modules/lucid.nix ]; - programs.hyprlock.enable = true; home.packages = with pkgs; [ android-studio diff --git a/user/sweetbread/modules/lucid.nix b/user/sweetbread/modules/lucid.nix index ae83161..6af02fa 100644 --- a/user/sweetbread/modules/lucid.nix +++ b/user/sweetbread/modules/lucid.nix @@ -1,5 +1,6 @@ -{ config, lib, pkgs, ... }: +{ config, lib, osConfig, pkgs, ... }: let + liveDecoder = if builtins.elem osConfig.networking.hostName [ "Rias" "Eclipse" ] then "cuda" else "vaapi"; source = pkgs.fetchgit { url = "https://github.com/Sn3akyy1/lucid.git"; rev = "bdd7f79da18efd837f79dcecbe5d2ec178abc10c"; @@ -36,6 +37,7 @@ from pathlib import Path output, scheme_path, scripts, accent_key = sys.argv[1:] sys.path.insert(0, scripts) +from lucid_palette import at_tone importer = runpy.run_path(str(Path(scripts) / "add-theme.py")) scheme = importer["parse_base16"](scheme_path, Path(scheme_path).read_text()) if scheme is None: @@ -48,6 +50,28 @@ hints["tertiary"] = scheme["colors"]["base0c" if accent_key == "base0b" else "ba palette = importer["build_palette"]( bg, fg, accents, hints, mode="dark" if importer["is_dark"](bg) else "light" ) +if importer["is_dark"](bg): + colors = scheme["colors"] + # Keep the Base16 dark surface ladder. Lucid's built-in Mocha uses base00 + # for its main panels, with base01/base02 as the raised surfaces; the + # generic Material builder starts at base02 and makes the whole shell pale. + background_tone = importer["tone"](bg) + darkest = importer["hx"](at_tone(bg, background_tone - 4)) + near_background = importer["hx"](at_tone(bg, background_tone - 2)) + palette.update({ + "surface": colors["base00"], + "surface_dim": darkest, + "surface_bright": importer["hx"](at_tone(bg, background_tone + 8)), + "surface_container_lowest": darkest, + "surface_container_low": near_background, + "surface_container": colors["base00"], + "surface_container_high": colors["base01"], + "surface_container_highest": colors["base02"], + "surface_variant": colors["base01"], + "on_surface_variant": colors["base04"], + "outline": colors["base03"], + "outline_variant": colors["base01"], + }) Path(output).write_text(json.dumps(palette, indent=2) + "\n") PY ''; @@ -140,7 +164,8 @@ in { prefs_tmp=$(${pkgs.coreutils}/bin/mktemp "$target/lucidprefs/prefs.json.XXXXXX") if ${pkgs.jq}/bin/jq --arg font ${lib.escapeShellArg config.stylix.fonts.sansSerif.name} \ --arg wallpaperDir ${lib.escapeShellArg wallpaperDir} \ - '.barEnabled = true | .widgetOnTop = false | .widgetHideFullscreen = true | .fontFamily = $font | .wallpaperFolder = $wallpaperDir' \ + --arg decoder ${lib.escapeShellArg liveDecoder} \ + '.barEnabled = true | .widgetOnTop = false | .widgetHideFullscreen = true | .fontFamily = $font | .wallpaperFolder = $wallpaperDir | .liveDecoder = $decoder' \ "$target/lucidprefs/prefs.json" > "$prefs_tmp"; then ${pkgs.coreutils}/bin/chmod 644 "$prefs_tmp" ${pkgs.coreutils}/bin/mv "$prefs_tmp" "$target/lucidprefs/prefs.json"