This commit is contained in:
Lysec
2026-01-24 14:29:32 +01:00
5 changed files with 73 additions and 42 deletions
+31
View File
@@ -0,0 +1,31 @@
set default-bg "{{colors.surface.default.rgba | set_alpha: 0.8}}"
set default-fg "{{colors.on_surface.default.hex}}"
set recolor-lightcolor "rgba(0,0,0,0)"
set recolor-darkcolor "{{colors.on_surface.default.hex}}"
set statusbar-bg "{{colors.on_primary.default.hex}}"
set statusbar-fg "{{colors.primary.default.hex}}"
set inputbar-bg "{{colors.on_primary.default.hex}}"
set inputbar-fg "{{colors.primary.default.hex}}"
set notification-bg "{{colors.on_primary.default.hex}}"
set notification-fg "{{colors.primary.default.hex}}"
set notification-error-bg "{{colors.on_error.default.hex}}"
set notification-error-fg "{{colors.error.default.hex}}"
set notification-warning-bg "{{colors.primary_fixed.default.hex}}"
set notification-warning-fg "{{colors.error_container.default.hex}}"
set index-bg "rgba(0,0,0,0)"
set index-fg "{{colors.on_surface.default.hex}}"
set index-active-bg "{{colors.primary.default.hex}}"
set index-active-fg "{{colors.on_primary.default.hex}}"
set highlight-color "{{colors.primary_fixed.default.rgba | set_alpha: 0.5}}"
set highlight-active-color "{{colors.primary_fixed_dim.default.rgba | set_alpha: 0.5}}"
set highlight-fg "{{colors.on_primary.default.hex}}"
set completion-bg "{{colors.on_primary.default.hex}}"
set completion-fg "{{colors.primary.default.hex}}"
set completion-group-bg "{{colors.on_primary.default.hex}}"
set completion-group-fg "{{colors.primary.default.hex}}"
set completion-highlight-fg "{{colors.on_primary.default.hex}}"
set completion-highlight-bg "{{colors.primary.default.hex}}"
+25 -2
View File
@@ -432,10 +432,11 @@ mango)
echo "Warning: mmsg command not found, manual restart may be needed." >&2
fi
;;
btop)
echo "🎨 Applying 'noctalia' theme to btop..."
CONFIG_FILE="$HOME/.config/btop/btop.conf"
if [ -f "$CONFIG_FILE" ]; then
if grep -q '^color_theme = "noctalia"' "$CONFIG_FILE"; then
echo "Theme already set to noctalia, skipping modification."
@@ -447,7 +448,7 @@ btop)
fi
echo "✅ Updated btop config to use noctalia theme."
fi
if pgrep -x btop >/dev/null; then
echo "Reloading btop..."
pkill -SIGUSR2 -x btop
@@ -456,6 +457,28 @@ btop)
echo "Warning: btop config file not found at $CONFIG_FILE" >&2
fi
;;
zathura)
echo "🎨 Applying 'noctalia' theme to zathura..."
ZATHURA_INSTANCES=$(dbus-send --session \
--dest=org.freedesktop.DBus \
--type=method_call \
--print-reply \
/org/freedesktop/DBus \
org.freedesktop.DBus.ListNames \
| grep -o 'org.pwmt.zathura.PID-[0-9]*')
for id in $ZATHURA_INSTANCES; do
dbus-send --session \
--dest="$id" \
--type=method_call \
/org/pwmt/zathura \
org.pwmt.zathura.ExecuteCommand \
string:"source"
done
;;
*)
# Handle unknown application names.
echo "Error: Unknown application '$APP_NAME'." >&2
+1 -31
View File
@@ -116,12 +116,6 @@ def kmeans_cluster(
return results
def _hue_distance(h1: float, h2: float) -> float:
"""Calculate circular distance between two hues (0-360)."""
diff = abs(h1 - h2)
return min(diff, 360.0 - diff)
def _score_colors_chroma(
colors_with_counts: list[tuple[RGB, int]],
) -> list[tuple[Color, float]]:
@@ -403,7 +397,7 @@ def _score_colors_population(
is_far_enough = True
for chosen_color, _ in chosen_colors:
chosen_hct = chosen_color.to_hct()
if _hue_distance(hct.hue, chosen_hct.hue) < min_hue_diff:
if hue_distance(hct.hue, chosen_hct.hue) < min_hue_diff:
is_far_enough = False
break
@@ -544,27 +538,3 @@ def find_error_color(palette: list[Color]) -> Color:
return Color.from_hex("#FD4663")
def derive_harmonious_colors(primary: Color) -> tuple[Color, Color, Color]:
"""
Derive secondary and tertiary colors as harmonious complements to primary.
Uses hue shifts for visual distinction (matugen-compatible):
- Secondary: 30° hue shift (analogous, slightly cooler/warmer)
- Tertiary: 60° hue shift (distinct accent color)
- Quaternary: 180° hue shift (complementary)
Returns:
Tuple of (secondary, tertiary, quaternary) colors
"""
h, s, l = primary.to_hsl()
# Secondary: 30° analogous hue shift with slightly lower saturation
secondary = Color.from_hsl((h + 30) % 360, s * 0.8, l)
# Tertiary: complementary (180° shift) for strong contrast
tertiary = Color.from_hsl((h + 180) % 360, s * 0.9, l)
# Quaternary: complementary - opposite on color wheel
quaternary = Color.from_hsl((h + 180) % 360, s, l)
return secondary, tertiary, quaternary
+4 -9
View File
@@ -111,8 +111,6 @@ def generate_normal_dark(palette: list[Color]) -> dict[str, str]:
else:
tertiary = shift_hue(primary, 60)
# Quaternary: complementary
quaternary = palette[3] if len(palette) > 3 else shift_hue(primary, 180)
error = find_error_color(palette)
# Keep colors vibrant - preserve saturation
@@ -168,7 +166,7 @@ def generate_normal_dark(palette: list[Color]) -> dict[str, str]:
base_on_surface = Color.from_hsl(text_h, 0.05, 0.95)
on_surface = ensure_contrast(base_on_surface, surface, 4.5)
base_on_surface_variant = Color.from_hsl(text_h, 0.05, 0.80)
base_on_surface_variant = Color.from_hsl(text_h, 0.05, 0.70)
on_surface_variant = ensure_contrast(base_on_surface_variant, surface_variant, 4.5)
outline = ensure_contrast(adjust_surface(palette[0], 0.10, 0.30), surface, 3.0)
@@ -324,7 +322,6 @@ def generate_normal_light(palette: list[Color]) -> dict[str, str]:
else:
tertiary = shift_hue(primary, 60)
quaternary = palette[3] if len(palette) > 3 else shift_hue(primary, 180)
error = find_error_color(palette)
# Keep colors vibrant - darken for visibility on light bg
@@ -364,7 +361,7 @@ def generate_normal_light(palette: list[Color]) -> dict[str, str]:
base_on_surface = Color.from_hsl(text_h, 0.05, 0.10)
on_surface = ensure_contrast(base_on_surface, surface, 4.5)
base_on_surface_variant = Color.from_hsl(text_h, 0.05, 0.90) # Light text on darker variant
base_on_surface_variant = Color.from_hsl(text_h, 0.05, 0.35)
on_surface_variant = ensure_contrast(base_on_surface_variant, surface_variant, 4.5)
# Contrasting foregrounds - light text on dark accent colors
@@ -503,7 +500,6 @@ def generate_muted_dark(palette: list[Color]) -> dict[str, str]:
# Much smaller shifts than normal mode since we want cohesion
secondary = shift_hue(primary, 15)
tertiary = shift_hue(primary, 30)
quaternary = shift_hue(primary, 180)
error = find_error_color(palette)
# Cap saturation low - this is the key difference from normal mode
@@ -549,7 +545,7 @@ def generate_muted_dark(palette: list[Color]) -> dict[str, str]:
base_on_surface = Color.from_hsl(primary_h, 0.03, 0.95)
on_surface = ensure_contrast(base_on_surface, surface, 4.5)
base_on_surface_variant = Color.from_hsl(primary_h, 0.03, 0.80)
base_on_surface_variant = Color.from_hsl(primary_h, 0.03, 0.70)
on_surface_variant = ensure_contrast(base_on_surface_variant, surface_variant, 4.5)
outline = ensure_contrast(Color.from_hsl(primary_h, 0.05, 0.30), surface, 3.0)
@@ -682,7 +678,6 @@ def generate_muted_light(palette: list[Color]) -> dict[str, str]:
# Derive secondary and tertiary with subtle hue shifts
secondary = shift_hue(primary, 15)
tertiary = shift_hue(primary, 30)
quaternary = shift_hue(primary, 180)
error = find_error_color(palette)
# Cap saturation low
@@ -725,7 +720,7 @@ def generate_muted_light(palette: list[Color]) -> dict[str, str]:
base_on_surface = Color.from_hsl(primary_h, 0.03, 0.10)
on_surface = ensure_contrast(base_on_surface, surface, 4.5)
base_on_surface_variant = Color.from_hsl(primary_h, 0.03, 0.90)
base_on_surface_variant = Color.from_hsl(primary_h, 0.03, 0.35)
on_surface_variant = ensure_contrast(base_on_surface_variant, surface_variant, 4.5)
# Contrasting foregrounds
+12
View File
@@ -363,6 +363,18 @@ Singleton {
}
],
"postProcess": () => `${templateApplyScript} btop`
},
{
"id": "zathura",
"name": "Zathura",
"category": "misc",
"input": "zathurarc",
"outputs": [
{
"path": "~/.config/zathura/noctaliarc"
}
],
"postProcess": () => `${templateApplyScript} zathura`
}
]