use upstream noctalia-shell theming
This commit is contained in:
parent
52f48ab978
commit
f973c7bb0c
3 changed files with 20 additions and 102 deletions
|
|
@ -2,15 +2,27 @@
|
|||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
customPackage = pkgs.mkNoctaliaShellCustom {
|
||||
catppuccin-flavor = config.catppuccin.flavor;
|
||||
catppuccin-accent = config.catppuccin.accent;
|
||||
};
|
||||
in {
|
||||
}: {
|
||||
programs.noctalia-shell = {
|
||||
enable = true;
|
||||
package = customPackage;
|
||||
colors = {
|
||||
mPrimary = pkgs.catppuccin.${config.catppuccin.flavor}.${config.catppuccin.accent};
|
||||
mOnPrimary = pkgs.catppuccin.${config.catppuccin.flavor}.crust;
|
||||
mSecondary = pkgs.catppuccin.${config.catppuccin.flavor}.subtext0;
|
||||
mOnSecondary = pkgs.catppuccin.${config.catppuccin.flavor}.crust;
|
||||
mTertiary = pkgs.catppuccin.${config.catppuccin.flavor}.teal;
|
||||
mOnTertiary = pkgs.catppuccin.${config.catppuccin.flavor}.crust;
|
||||
mError = pkgs.catppuccin.${config.catppuccin.flavor}.red;
|
||||
mOnError = pkgs.catppuccin.${config.catppuccin.flavor}.crust;
|
||||
mSurface = pkgs.catppuccin.${config.catppuccin.flavor}.mantle;
|
||||
mOnSurface = pkgs.catppuccin.${config.catppuccin.flavor}.text;
|
||||
mSurfaceVariant = pkgs.catppuccin.${config.catppuccin.flavor}.surface0;
|
||||
mOnSurfaceVariant = pkgs.catppuccin.${config.catppuccin.flavor}.lavender;
|
||||
mOutline = pkgs.catppuccin.${config.catppuccin.flavor}.surface2;
|
||||
mShadow = pkgs.catppuccin.${config.catppuccin.flavor}.crust;
|
||||
mHover = pkgs.catppuccin.${config.catppuccin.flavor}.subtext1;
|
||||
mOnHover = pkgs.catppuccin.${config.catppuccin.flavor}.crust;
|
||||
};
|
||||
settings = {
|
||||
settingsVersion = 0;
|
||||
brightness = {
|
||||
|
|
@ -378,7 +390,6 @@ in {
|
|||
};
|
||||
colorSchemes = {
|
||||
useWallpaperColors = false;
|
||||
predefinedScheme = "Cat-Custom";
|
||||
darkMode = true;
|
||||
schedulingMode = "off";
|
||||
manualSunrise = "06:30";
|
||||
|
|
@ -435,7 +446,7 @@ in {
|
|||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = "${customPackage}/bin/noctalia-shell";
|
||||
ExecStart = "${pkgs.noctalia-shell}/bin/noctalia-shell";
|
||||
Restart = "on-failure";
|
||||
Environment = [
|
||||
"LOCALE_ARCHIVE=${pkgs.glibcLocales}/lib/locale"
|
||||
|
|
|
|||
|
|
@ -1,82 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
noctalia-shell,
|
||||
catppuccin-flavor,
|
||||
catppuccin-accent,
|
||||
}: let
|
||||
# Get the actual color palettes
|
||||
darkPalette = pkgs.catppuccin.${catppuccin-flavor};
|
||||
lightPalette = pkgs.catppuccin.latte;
|
||||
|
||||
# Create theme from palette
|
||||
mkTheme = palette: accent: {
|
||||
mPrimary = palette.${accent};
|
||||
mOnPrimary = palette.crust;
|
||||
mSecondary = palette.subtext0;
|
||||
mOnSecondary = palette.crust;
|
||||
mTertiary = palette.teal;
|
||||
mOnTertiary = palette.crust;
|
||||
mError = palette.red;
|
||||
mOnError = palette.crust;
|
||||
mSurface = palette.mantle;
|
||||
mOnSurface = palette.text;
|
||||
mSurfaceVariant = palette.surface0;
|
||||
mOnSurfaceVariant = palette.lavender;
|
||||
mOutline = palette.surface2;
|
||||
mShadow = palette.crust;
|
||||
mHover = palette.subtext1;
|
||||
mOnHover = palette.crust;
|
||||
};
|
||||
|
||||
# Build the complete color scheme
|
||||
customScheme = {
|
||||
dark = mkTheme darkPalette catppuccin-accent;
|
||||
light = mkTheme lightPalette catppuccin-accent;
|
||||
};
|
||||
|
||||
# Convert to JSON
|
||||
schemeJson = builtins.toJSON customScheme;
|
||||
in
|
||||
noctalia-shell.overrideAttrs (oldAttrs: {
|
||||
pname = "noctalia-shell-custom";
|
||||
nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [pkgs.jq];
|
||||
|
||||
postPatch =
|
||||
(oldAttrs.postPatch or "")
|
||||
+ ''
|
||||
echo "Patching noctalia-shell with Cat-Custom theme..."
|
||||
echo " Dark: ${catppuccin-flavor} / Light: latte"
|
||||
echo " Accent: ${catppuccin-accent}"
|
||||
|
||||
if [ -d Assets/ColorScheme/Catppuccin ]; then
|
||||
mkdir -p Assets/ColorScheme/Cat-Custom
|
||||
|
||||
# Write the JSON directly
|
||||
cat > Assets/ColorScheme/Cat-Custom/Cat-Custom.json << 'COLORSCHEME_EOF'
|
||||
${schemeJson}
|
||||
COLORSCHEME_EOF
|
||||
|
||||
echo "Created Cat-Custom color scheme:"
|
||||
${pkgs.jq}/bin/jq -C '.' Assets/ColorScheme/Cat-Custom/Cat-Custom.json || true
|
||||
|
||||
# Add translation entries
|
||||
for lang in en fr de es pt zh-CN; do
|
||||
if [ -f "Assets/Translations/$lang.json" ]; then
|
||||
${pkgs.jq}/bin/jq \
|
||||
'.["color-scheme"].predefined.schemes["Cat-Custom"] = "Cat-Custom"' \
|
||||
"Assets/Translations/$lang.json" > "Assets/Translations/$lang.json.tmp" \
|
||||
&& mv "Assets/Translations/$lang.json.tmp" "Assets/Translations/$lang.json"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "ERROR: ColorScheme directory not found"
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
|
||||
meta =
|
||||
oldAttrs.meta
|
||||
// {
|
||||
description = "${oldAttrs.meta.description} (Cat-Custom: ${catppuccin-flavor}/${catppuccin-accent})";
|
||||
};
|
||||
})
|
||||
|
|
@ -10,17 +10,6 @@ final: prev: {
|
|||
inherit (final) openmw-git;
|
||||
};
|
||||
|
||||
# Noctalia shell is parameterized by catppuccin theme, so we create a function
|
||||
# that home-manager configs can call with their specific theme settings
|
||||
mkNoctaliaShellCustom = {
|
||||
catppuccin-flavor,
|
||||
catppuccin-accent,
|
||||
}:
|
||||
final.callPackage ./noctalia-shell {
|
||||
noctalia-shell = final.noctalia-shell;
|
||||
inherit catppuccin-flavor catppuccin-accent;
|
||||
};
|
||||
|
||||
linuxPackages_asahi = prev.linuxPackages_asahi.override {
|
||||
_kernelPatches = [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue