1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-08 06:25:37 -05:00

add kitty matugen+b16 support

This commit is contained in:
bbedward
2025-08-25 16:02:16 -04:00
parent adb15a7945
commit fb8aad52c4
5 changed files with 98 additions and 6 deletions

View File

@@ -472,12 +472,22 @@ You'll have to restart your session for themes to take effect.
## Terminal Integration
**Ghostty users** can add automatic color theming:
The matugen integration will automatically generate new colors for certain apps only if they are installed.
You can enable the dynamic color schemes in supported terminal apps by modifying their configurations:
**Ghostty**:
```bash
echo "config-file = ./config-dankcolors" >> ~/.config/ghostty/config
```
**kitty**:
```bash
echo "include dank-theme.conf" >> ~/.config/kitty/kitty.conf
```
## Calendar Setup
Sync your caldev compatible calendar (Google, Office365, etc.) for dashboard integration:

View File

@@ -59,16 +59,42 @@ def generate_palette(base_color, is_light=False):
return palette
if __name__ == "__main__":
if len(sys.argv) < 2 or len(sys.argv) > 3:
print("Usage: b16.py <hex_color> [--light]", file=sys.stderr)
if len(sys.argv) < 2 or len(sys.argv) > 4:
print("Usage: b16.py <hex_color> [--light] [--kitty]", file=sys.stderr)
sys.exit(1)
base = sys.argv[1]
if not base.startswith('#'):
base = '#' + base
is_light = len(sys.argv) == 3 and sys.argv[2] == "--light"
is_light = "--light" in sys.argv
is_kitty = "--kitty" in sys.argv
colors = generate_palette(base, is_light)
for i, color in enumerate(colors):
print(f"palette = {i}={color}")
if is_kitty:
# Kitty color format mapping
kitty_colors = [
("color0", colors[0]), # black
("color1", colors[1]), # red
("color2", colors[2]), # green
("color3", colors[3]), # yellow
("color4", colors[4]), # blue
("color5", colors[5]), # magenta
("color6", colors[6]), # cyan
("color7", colors[7]), # white
("color8", colors[8]), # bright black
("color9", colors[9]), # bright red
("color10", colors[10]), # bright green
("color11", colors[11]), # bright yellow
("color12", colors[12]), # bright blue
("color13", colors[13]), # bright magenta
("color14", colors[14]), # bright cyan
("color15", colors[15]) # bright white
]
for name, color in kitty_colors:
print(f"{name} {color}")
else:
# Ghostty format (original)
for i, color in enumerate(colors):
print(f"palette = {i}={color}")

View File

@@ -0,0 +1,3 @@
[templates.kitty]
input_path = './matugen/templates/kitty.conf'
output_path = '~/.config/kitty/dank-theme.conf'

View File

@@ -0,0 +1,8 @@
cursor {{colors.on_surface.default.hex}}
cursor_text_color {{colors.on_surface_variant.default.hex}}
foreground {{colors.on_surface.default.hex}}
background {{colors.surface.default.hex}}
selection_foreground {{colors.on_secondary.default.hex}}
selection_background {{colors.secondary_fixed_dim.default.hex}}
url_color {{colors.primary.default.hex}}

View File

@@ -106,6 +106,15 @@ build_content_config() {
echo " - Skipping ghostty config (ghostty not found)"
fi
if command -v kitty >/dev/null 2>&1; then
echo " - Including kitty config (kitty found)"
cat "$shell_dir/matugen/configs/kitty.toml" >> "$temp_config"
sed -i "s|input_path = './matugen/templates/|input_path = '$shell_dir/matugen/templates/|g" "$temp_config"
echo "" >> "$temp_config"
else
echo " - Skipping kitty config (kitty not found)"
fi
if command -v dgop >/dev/null 2>&1; then
echo " - Including dgop config (dgop found)"
cat "$shell_dir/matugen/configs/dgop.toml" >> "$temp_config"
@@ -221,6 +230,41 @@ if [ -s "$TEMP_CONTENT_CONFIG" ] && grep -q '\[templates\.' "$TEMP_CONTENT_CONFI
echo "Warning: Failed to generate base16 palette"
fi
fi
if command -v kitty >/dev/null 2>&1; then
echo "Generating base16 palette for kitty..."
PRIMARY_COLOR="$EXTRACTED_PRIMARY"
if [ -z "$PRIMARY_COLOR" ]; then
PRIMARY_COLOR="#6b5f8e"
echo "Warning: Could not extract primary color, using fallback: $PRIMARY_COLOR"
fi
B16_ARGS="$PRIMARY_COLOR"
if [ "$IS_LIGHT" = "true" ]; then
B16_ARGS="$B16_ARGS --light"
fi
B16_OUTPUT=$("$SHELL_DIR/matugen/b16.py" $B16_ARGS --kitty)
if [ $? -eq 0 ] && [ -n "$B16_OUTPUT" ]; then
TEMP_KITTY="/tmp/kitty-config-$$.conf"
echo "$B16_OUTPUT" > "$TEMP_KITTY"
echo "" >> "$TEMP_KITTY"
if [ -f "$CONFIG_DIR/kitty/dank-theme.conf" ]; then
cat "$CONFIG_DIR/kitty/dank-theme.conf" >> "$TEMP_KITTY"
else
echo "Warning: $CONFIG_DIR/kitty/dank-theme.conf not found"
fi
mkdir -p "$CONFIG_DIR/kitty"
mv "$TEMP_KITTY" "$CONFIG_DIR/kitty/dank-theme.conf"
echo "Base16 palette prepended to kitty config"
else
echo "Warning: Failed to generate base16 palette for kitty"
fi
fi
else
echo "No content-specific tools found, skipping content generation"
fi
@@ -246,4 +290,5 @@ command -v niri >/dev/null 2>&1 && [ -f "$CONFIG_DIR/niri/dankshell-colors.kdl"
command -v qt5ct >/dev/null 2>&1 && [ -f "$CONFIG_DIR/qt5ct/colors/matugen.conf" ] && echo " - Qt5ct themes"
command -v qt6ct >/dev/null 2>&1 && [ -f "$CONFIG_DIR/qt6ct/colors/matugen.conf" ] && echo " - Qt6ct themes"
command -v ghostty >/dev/null 2>&1 && [ -f "$CONFIG_DIR/ghostty/config-dankcolors" ] && echo " - Ghostty terminal"
command -v kitty >/dev/null 2>&1 && [ -f "$CONFIG_DIR/kitty/dank-theme.conf" ] && echo " - Kitty terminal"
command -v dgop >/dev/null 2>&1 && [ -f "$CONFIG_DIR/dgop/colors.json" ] && echo " - Dgop colors"