1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-07 22:15:38 -05:00

themes: change gtk theme path to adw-gtk3 + libadwaita for gtk4

This commit is contained in:
bbedward
2025-10-19 23:50:18 -04:00
parent ad778b5d81
commit 851d47213c
4 changed files with 33 additions and 8473 deletions

View File

@@ -540,23 +540,18 @@ If you do not like our theme path, you can integrate this with other GTK themes,
#### GTK Apps #### GTK Apps
1. Install [Colloid](https://github.com/vinceliuice/Colloid-gtk-theme) 1. Install adw-gtk3
Colloid is a hard requirement for the auto-theming because of how it integrates with colloid css files, however you can integrate auto-theming with other themes, you just have to do it manually (so leave the toggle OFF in settings)
It will still create `~/.config/gtk-3.0/4.0/dank-colors.css` on theme updates, these you can import into other compatible GTK themes.
```bash ```bash
# Some default install settings for colloid # Arch
./install.sh -s standard -l --tweaks normal sudo pacman -S adw-gtk-theme
# Fedora
sudo dnf install adw-gtk3-theme
``` ```
Configure in `~/.config/gtk-3.0/settings.ini` and `~/.config/gtk-4.0/settings.ini`: In dms settings, navigate to Theme & Colors, and "apply GTK themes"
```ini This will create symlinks from `~/.config/gtk-3.0/4.0/dank-colors.css` to `~/.config/gtk-3.0/4.0/gtk.css` which enables theming.
[Settings]
gtk-theme-name=Colloid
```
#### QT: basic gtk3 based theme (Option 1) #### QT: basic gtk3 based theme (Option 1)

View File

@@ -3,90 +3,20 @@
* Generated with Matugen * Generated with Matugen
*/ */
@define-color accent_color {{colors.primary.default.hex}}; @define-color accent_color {{colors.primary_fixed_dim.default.hex}};
@define-color accent_fg_color {{colors.on_primary.default.hex}}; @define-color accent_fg_color {{colors.on_primary_fixed.default.hex}};
@define-color accent_bg_color {{colors.primary_fixed_dim.default.hex}}; @define-color accent_bg_color {{colors.primary_fixed_dim.default.hex}};
@define-color window_bg_color {{colors.surface_container.default.hex}}; @define-color window_bg_color {{colors.surface_dim.default.hex}};
@define-color window_fg_color {{colors.on_surface.default.hex}}; @define-color window_fg_color {{colors.on_surface.default.hex}};
@define-color headerbar_bg_color {{colors.surface_container.default.hex}}; @define-color headerbar_bg_color {{colors.surface_dim.default.hex}};
@define-color headerbar_fg_color {{colors.on_surface.default.hex}}; @define-color headerbar_fg_color {{colors.on_surface.default.hex}};
@define-color popover_bg_color {{colors.surface_container.default.hex}}; @define-color popover_bg_color {{colors.surface_dim.default.hex}};
@define-color popover_fg_color {{colors.on_surface.default.hex}}; @define-color popover_fg_color {{colors.on_surface.default.hex}};
@define-color view_bg_color {{colors.surface_container.default.hex}}; @define-color view_bg_color {{colors.surface.default.hex}};
@define-color view_fg_color {{colors.on_surface.default.hex}}; @define-color view_fg_color {{colors.on_surface.default.hex}};
@define-color card_bg_color {{colors.surface_container.default.hex}}; @define-color card_bg_color {{colors.surface.default.hex}};
@define-color card_fg_color {{colors.on_surface.default.hex}}; @define-color card_fg_color {{colors.on_surface.default.hex}};
@define-color sidebar_bg_color @window_bg_color; @define-color sidebar_bg_color @window_bg_color;
@define-color sidebar_fg_color @window_fg_color; @define-color sidebar_fg_color @window_fg_color;
@define-color sidebar_border_color @window_bg_color; @define-color sidebar_border_color @window_bg_color;
@define-color sidebar_backdrop_color @window_bg_color; @define-color sidebar_backdrop_color @window_bg_color;
/* Titlebar and headerbar specific colors for window decorations */
@define-color theme_bg_color {{colors.surface_container.default.hex}};
@define-color theme_fg_color {{colors.on_surface.default.hex}};
@define-color theme_base_color {{colors.surface_container.default.hex}};
@define-color theme_text_color {{colors.on_surface.default.hex}};
@define-color theme_selected_bg_color {{colors.primary.default.hex}};
@define-color theme_selected_fg_color {{colors.on_primary.default.hex}};
@define-color theme_button_background_normal {{colors.surface_container_high.default.hex}};
@define-color theme_button_foreground_normal {{colors.on_surface.default.hex}};
@define-color theme_button_background_hover alpha({{colors.on_surface.default.hex}}, 0.08);
@define-color theme_button_foreground_hover {{colors.on_surface.default.hex}};
@define-color theme_button_background_active alpha({{colors.on_surface.default.hex}}, 0.12);
@define-color theme_button_foreground_active {{colors.on_surface.default.hex}};
@define-color theme_button_background_disabled alpha({{colors.on_surface.default.hex}}, 0.04);
@define-color theme_button_foreground_disabled alpha({{colors.on_surface.default.hex}}, 0.38);
/* Additional headerbar-specific colors for GTK4 compatibility */
@define-color headerbar_backdrop_color {{colors.surface_container_low.default.hex}};
@define-color headerbar_border_color {{colors.outline.default.hex}};
@define-color headerbar_darker_shade_color {{colors.outline_variant.default.hex}};
@define-color headerbar_shade_color {{colors.surface_variant.default.hex}};
/* Window control and decoration colors */
@define-color wm_bg_a {{colors.surface_container.default.hex}};
@define-color wm_bg_b {{colors.surface_container_high.default.hex}};
@define-color wm_border_a {{colors.outline.default.hex}};
@define-color wm_border_b {{colors.outline_variant.default.hex}};
@define-color wm_shadow {{colors.shadow.default.hex}};
@define-color wm_outline {{colors.outline.default.hex}};
/* Menu and popover colors */
@define-color menu_bg_color {{colors.surface_container.default.hex}};
@define-color menu_fg_color {{colors.on_surface.default.hex}};
@define-color menu_selected_bg_color {{colors.primary.default.hex}};
@define-color menu_selected_fg_color {{colors.on_primary.default.hex}};
/* Button and control colors */
@define-color button_bg_color {{colors.surface_container_high.default.hex}};
@define-color button_fg_color {{colors.on_surface.default.hex}};
@define-color button_border_color {{colors.outline_variant.default.hex}};
@define-color button_active_bg_color {{colors.primary.default.hex}};
@define-color button_active_fg_color {{colors.on_primary.default.hex}};
/* Entry and input colors */
@define-color entry_bg_color {{colors.surface_variant.default.hex}};
@define-color entry_fg_color {{colors.on_surface_variant.default.hex}};
@define-color entry_border_color {{colors.outline.default.hex}};
@define-color entry_focus_border_color {{colors.primary.default.hex}};
/* Scrollbar colors */
@define-color scrollbar_bg_color {{colors.surface_variant.default.hex}};
@define-color scrollbar_fg_color {{colors.on_surface_variant.default.hex}};
@define-color scrollbar_hover_color {{colors.primary.default.hex}};
/* Selection and highlight colors */
@define-color selection_bg_color {{colors.primary.default.hex}};
@define-color selection_fg_color {{colors.on_primary.default.hex}};
/* Tooltip colors */
@define-color tooltip_bg_color {{colors.inverse_surface.default.hex}};
@define-color tooltip_fg_color {{colors.inverse_on_surface.default.hex}};
/* Warning and error colors */
@define-color warning_color {{colors.tertiary.default.hex}};
@define-color warning_fg_color {{colors.on_tertiary.default.hex}};
@define-color error_color {{colors.error.default.hex}};
@define-color error_fg_color {{colors.on_error.default.hex}};
@define-color success_color {{colors.tertiary_container.default.hex}};
@define-color success_fg_color {{colors.on_tertiary_container.default.hex}};

File diff suppressed because it is too large Load Diff

View File

@@ -141,12 +141,6 @@ EOF
echo "" >> "$TMP_CFG" echo "" >> "$TMP_CFG"
done done
# GTK3 colors based on colloid
COLLOID_TEMPLATE="$SHELL_DIR/matugen/templates/gtk3-colors.css"
sed -i "/\[templates\.gtk3\]/,/^$/ s|input_path = './matugen/templates/gtk-colors.css'|input_path = '$COLLOID_TEMPLATE'|" "$TMP_CFG"
sed -i "s|input_path = './matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" "$TMP_CFG"
# Handle surface shifting if needed # Handle surface shifting if needed
if [[ "$surface_base" == "s" ]]; then if [[ "$surface_base" == "s" ]]; then
TMP_TEMPLATES_DIR="$(mktemp -d)" TMP_TEMPLATES_DIR="$(mktemp -d)"
@@ -170,11 +164,7 @@ EOF
# Update config to use shifted templates # Update config to use shifted templates
sed -i "s|input_path = '$SHELL_DIR/matugen/templates/|input_path = '$TMP_TEMPLATES_DIR/|g" "$TMP_CFG" sed -i "s|input_path = '$SHELL_DIR/matugen/templates/|input_path = '$TMP_TEMPLATES_DIR/|g" "$TMP_CFG"
sed -i "s|input_path = '$USER_MATUGEN_DIR/templates/|input_path = '$TMP_TEMPLATES_DIR/|g" "$TMP_CFG" sed -i "s|input_path = '$USER_MATUGEN_DIR/templates/|input_path = '$TMP_TEMPLATES_DIR/|g" "$TMP_CFG"
sed -i "s|input_path = '\\./matugen/templates/|input_path = '$TMP_TEMPLATES_DIR/|g" "$TMP_CFG"
# Handle the special colloid template path
if [[ -f "$TMP_TEMPLATES_DIR/gtk3-colors.css" ]]; then
sed -i "/\[templates\.gtk3\]/,/^$/ s|input_path = '$COLLOID_TEMPLATE'|input_path = '$TMP_TEMPLATES_DIR/gtk3-colors.css'|" "$TMP_CFG"
fi
fi fi
pushd "$SHELL_DIR" >/dev/null pushd "$SHELL_DIR" >/dev/null
@@ -240,7 +230,24 @@ EOF
echo "$JSON" | grep -q '"primary"' || { echo "matugen JSON missing primary" >&2; return 2; } echo "$JSON" | grep -q '"primary"' || { echo "matugen JSON missing primary" >&2; return 2; }
printf "%s" "$JSON" > "$LAST_JSON" printf "%s" "$JSON" > "$LAST_JSON"
GTK_CSS="$CONFIG_DIR/gtk-3.0/gtk.css"
SHOULD_RUN_HOOK=false
if [[ -L "$GTK_CSS" ]]; then
LINK_TARGET=$(readlink "$GTK_CSS")
if [[ "$LINK_TARGET" == *"dank-colors.css"* ]]; then
SHOULD_RUN_HOOK=true
fi
elif [[ -f "$GTK_CSS" ]] && grep -q "dank-colors.css" "$GTK_CSS"; then
SHOULD_RUN_HOOK=true
fi
if [[ "$SHOULD_RUN_HOOK" == "true" ]]; then
gsettings set org.gnome.desktop.interface gtk-theme "" >/dev/null 2>&1 || true
gsettings set org.gnome.desktop.interface gtk-theme "adw-gtk3-${mode}" >/dev/null 2>&1 || true
fi
if [ "$mode" = "light" ]; then if [ "$mode" = "light" ]; then
SECTION=$(echo "$JSON" | sed -n 's/.*"light":{\([^}]*\)}.*/\1/p') SECTION=$(echo "$JSON" | sed -n 's/.*"light":{\([^}]*\)}.*/\1/p')
else else