diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-03-16 23:46:49 -0400 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-03-17 14:19:50 -0400 |
| commit | 25b4f61512a76d75aa94b44bb666fd899cf8bf5e (patch) | |
| tree | b97a4dd9190cf57b2c0c6408bf292b6e214505b7 | |
| parent | update commits (diff) | |
| download | dotfiles-nix-25b4f61512a76d75aa94b44bb666fd899cf8bf5e.tar.gz dotfiles-nix-25b4f61512a76d75aa94b44bb666fd899cf8bf5e.tar.bz2 dotfiles-nix-25b4f61512a76d75aa94b44bb666fd899cf8bf5e.zip | |
update caelestia and its theming
| -rw-r--r-- | flake.lock | 20 | ||||
| -rw-r--r-- | home/apps/caelestia/scheme.nix | 45 | ||||
| -rw-r--r-- | home/apps/caelestia/settings.nix | 1 | ||||
| -rw-r--r-- | lib/colors.nix | 66 | ||||
| -rw-r--r-- | lib/default.nix | 2 | ||||
| -rw-r--r-- | options.nix | 6 | ||||
| -rw-r--r-- | themes/catppuccin/mocha.nix | 3 |
7 files changed, 99 insertions, 44 deletions
@@ -94,11 +94,11 @@ "quickshell": "quickshell" }, "locked": { - "lastModified": 1773113687, - "narHash": "sha256-Y3IYKvD4Zwnaye8OFsi5QJg58dOvGLyW/EDxLTw3ZzY=", + "lastModified": 1773771498, + "narHash": "sha256-0+b85clo3NwGEm5kxLhYAezlJi0eDXTSJTbxCaunzTM=", "ref": "refs/heads/main", - "rev": "796ca5a7fc250bdff33589925e11c1b9f1e4eb2a", - "revCount": 1763, + "rev": "76b2b96be41d276505b4346433a1bcd7adb9d004", + "revCount": 1847, "type": "git", "url": "https://g.freya.cat/caelestia-shell" }, @@ -670,17 +670,17 @@ ] }, "locked": { - "lastModified": 1773110235, - "narHash": "sha256-54fcqz/u/2P1ITLEsfLjg288i6vKIXJxiPYRuXR93c4=", + "lastModified": 1773648506, + "narHash": "sha256-uVdqQIOzmMcHy1bUyF5NdZ3T5f1/5OVSNx3nIoXV6Os=", "ref": "refs/heads/master", - "rev": "cf1a2aeb2d01e446346fcd37c4b8f4e7d40d6f2c", - "revCount": 751, + "rev": "6705e2da778d216e81dbdc3764a3f50e89bfd87d", + "revCount": 761, "type": "git", - "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + "url": "https://git.outfoxxed.me/quickshell/quickshell" }, "original": { "type": "git", - "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + "url": "https://git.outfoxxed.me/quickshell/quickshell" } }, "root": { diff --git a/home/apps/caelestia/scheme.nix b/home/apps/caelestia/scheme.nix index b454b78..06991d9 100644 --- a/home/apps/caelestia/scheme.nix +++ b/home/apps/caelestia/scheme.nix @@ -1,8 +1,10 @@ { lib, config, + inputs, ... -}: let +}: +with inputs.self.lib; let inherit (lib) mkIf; cfg = config.apps.caelestia; theme = config.theme.colors; @@ -16,7 +18,6 @@ in { colours = { primary_paletteKeyColor = theme.primary; secondary_paletteKeyColor = theme.secondary; - tertiary_paletteKeyColor = theme.tertiary; neutral_paletteKeyColor = theme.overlay; neutral_variant_paletteKeyColor = "777680"; background = theme.base; @@ -24,11 +25,11 @@ in { surface = theme.surface; surfaceDim = theme.base; surfaceBright = theme.overlay; - surfaceContainerLowest = theme.base; - surfaceContainerLow = theme.base; - surfaceContainer = theme.base; - surfaceContainerHigh = theme.surface; - surfaceContainerHighest = theme.overlay; + surfaceContainerLowest = mixColor 0.80 theme.base theme.primary; + surfaceContainerLow = mixColor 0.72 theme.base theme.primary; + surfaceContainer = mixColor 0.68 theme.base theme.primary; + surfaceContainerHigh = mixColor 0.64 theme.base theme.primary; + surfaceContainerHighest = mixColor 0.60 theme.base theme.primary; onSurface = theme.text; surfaceVariant = theme.text; onSurfaceVariant = theme.subtext; @@ -41,33 +42,25 @@ in { surfaceTint = theme.primary; primary = theme.primary; onPrimary = theme.surface; - primaryContainer = theme.primary; - onPrimaryContainer = theme.surface; + primaryContainer = mixColor 0.66 theme.base theme.primary; + onPrimaryContainer = theme.primary; inversePrimary = theme.surface; secondary = theme.secondary; onSecondary = theme.surface; - secondaryContainer = theme.secondary; - onSecondaryContainer = theme.surface; - tertiary = theme.tertiary; - onTertiary = theme.surface; - tertiaryContainer = theme.tertiary; - onTertiaryContainer = theme.surface; + secondaryContainer = mixColor 0.66 theme.base theme.secondary; + onSecondaryContainer = theme.secondary; error = theme.error; - onError = theme.text; - errorContainer = theme.error; - onErrorContainer = theme.text; + onError = theme.surface; + errorContainer = mixColor 0.66 theme.base theme.error; + onErrorContainer = theme.error; primaryFixed = theme.primary; primaryFixedDim = theme.primary; - onPrimaryFixed = theme.primary; - onPrimaryFixedVariant = theme.primary; + onPrimaryFixed = theme.base; + onPrimaryFixedVariant = theme.base; secondaryFixed = theme.secondary; secondaryFixedDim = theme.primary; - onSecondaryFixed = theme.secondary; - onSecondaryFixedVariant = theme.secondary; - tertiaryFixed = theme.tertiary; - tertiaryFixedDim = theme.tertiary; - onTertiaryFixed = theme.tertiary; - onTertiaryFixedVariant = theme.tertiary; + onSecondaryFixed = theme.base; + onSecondaryFixedVariant = theme.base; term0 = theme.normal.black; term1 = theme.normal.red; term2 = theme.normal.green; diff --git a/home/apps/caelestia/settings.nix b/home/apps/caelestia/settings.nix index de81df7..9168d86 100644 --- a/home/apps/caelestia/settings.nix +++ b/home/apps/caelestia/settings.nix @@ -186,6 +186,7 @@ in { brightnessIncrement = 0.1; maxVolume = 1.0; useFahrenheit = false; + useFahrenheitPerformance = false; useTwelveHourClock = false; }; diff --git a/lib/colors.nix b/lib/colors.nix new file mode 100644 index 0000000..a653f11 --- /dev/null +++ b/lib/colors.nix @@ -0,0 +1,66 @@ +{lib, ...}: let + colorToInt = hex: let + table = { + "0" = 0; + "1" = 1; + "2" = 2; + "3" = 3; + "4" = 4; + "5" = 5; + "6" = 6; + "7" = 7; + "8" = 8; + "9" = 9; + "a" = 10; + "b" = 11; + "c" = 12; + "d" = 13; + "e" = 14; + "f" = 15; + }; + in + builtins.foldl' + (acc: c: acc * 16 + table.${c}) + 0 + (lib.strings.stringToCharacters (lib.strings.toLower hex)); + + colorToHex = n: let + hexChars = "0123456789abcdef"; + hi = builtins.div n 16; + lo = lib.trivial.mod n 16; + in + builtins.substring hi 1 hexChars + + builtins.substring lo 1 hexChars; + + mapColor = f: hex: let + r = colorToInt (builtins.substring 0 2 hex); + g = colorToInt (builtins.substring 2 2 hex); + b = colorToInt (builtins.substring 4 2 hex); + in + colorToHex (f r) + + colorToHex (f g) + + colorToHex (f b); + + darkenColor = factor: hex: + mapColor (c: builtins.floor (c * (1 - factor))) hex; + + lightenColor = factor: hex: + mapColor (c: builtins.floor (c + (255 - c) * factor)) hex; + + mixColor = factor: hex1: hex2: let + r1 = colorToInt (builtins.substring 0 2 hex1); + g1 = colorToInt (builtins.substring 2 2 hex1); + b1 = colorToInt (builtins.substring 4 2 hex1); + r2 = colorToInt (builtins.substring 0 2 hex2); + g2 = colorToInt (builtins.substring 2 2 hex2); + b2 = colorToInt (builtins.substring 4 2 hex2); + r = builtins.floor (r1 * factor) + builtins.floor (r2 * (1 - factor)); + g = builtins.floor (g1 * factor) + builtins.floor (g2 * (1 - factor)); + b = builtins.floor (b1 * factor) + builtins.floor (b2 * (1 - factor)); + in + colorToHex r + + colorToHex g + + colorToHex b; +in { + inherit colorToInt colorToHex darkenColor lightenColor mixColor; +} diff --git a/lib/default.nix b/lib/default.nix index b501184..21031c8 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,8 +1,10 @@ {lib, ...} @ inputs: let callLibs = file: import file inputs; files = callLibs ./files.nix; + colors = callLibs ./colors.nix; in { inherit (files) getFiles certs sshKeys gpgKeys; + inherit (colors) colorToInt colorToHex darkenColor lightenColor mixColor; # set of options we want to copy from a system # config to home manager diff --git a/options.nix b/options.nix index 4ed92ee..3a2f269 100644 --- a/options.nix +++ b/options.nix @@ -113,12 +113,6 @@ with lib; let default = self.primary; }; - tertiary = mkOption { - type = types.str; - description = "tertiary accent color"; - default = self.secondary; - }; - success = mkOption { type = types.str; description = "Success color"; diff --git a/themes/catppuccin/mocha.nix b/themes/catppuccin/mocha.nix index 57ef7e8..837768b 100644 --- a/themes/catppuccin/mocha.nix +++ b/themes/catppuccin/mocha.nix @@ -10,8 +10,7 @@ rec { overlay = "6c7086"; primary = normal.blue; - secondary = subtext; - tertiary = normal.pink; + secondary = normal.pink; success = normal.green; warning = normal.yellow; error = normal.red; |