aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/install.sh b/install.sh
index 0fe2575..b2b1576 100755
--- a/install.sh
+++ b/install.sh
@@ -121,6 +121,39 @@ install -Dm644 "$repo/templates/kvantum/theme.kvconfig" "$kv/udt.kvconfig"
install -Dm644 "$repo/templates/kvantum/theme.svg" "$kv/udt.svg"
printf '[General]\ntheme=udt\n' > "$HOME/.config/Kvantum/kvantum.kvconfig"
+# GTK3 and GTK4. Installed under one fixed name for every scheme, like Kvantum:
+# the theme name is set in gsettings and in a symlink, so a per-scheme name
+# would mean rewriting both on every switch and leaving stale themes behind.
+#
+# Only the two GTK directories are installed. The upstream theme this is
+# derived from also ships cinnamon, gnome-shell, metacity, xfwm4 and plank
+# directories, none of which anything on this desktop reads.
+gtk_theme="$HOME/.themes/udt"
+install -Dm644 "$repo/templates/gtk/index.theme" "$gtk_theme/index.theme"
+for v in 3.0 4.0; do
+ src="gtk3.css"
+ [ "$v" = "4.0" ] && src="gtk4.css"
+ install -Dm644 "$repo/templates/gtk/$src" "$gtk_theme/gtk-$v/gtk.css"
+ # gtk-dark.css is byte-identical to gtk.css upstream; apps ask for one or
+ # the other depending on the prefer-dark setting, so both must exist.
+ install -Dm644 "$repo/templates/gtk/$src" "$gtk_theme/gtk-$v/gtk-dark.css"
+ rm -rf "$gtk_theme/gtk-$v/assets"
+ mkdir -p "$gtk_theme/gtk-$v/assets"
+ cp "$repo"/templates/gtk/assets/*.svg "$gtk_theme/gtk-$v/assets/"
+done
+
+# GTK3 reads the theme name from gsettings on Wayland, not settings.ini: the
+# file is written too, but gsettings is what actually wins. It was once pinned
+# to Breeze, silently overriding the file.
+sed -i 's/^gtk-theme-name=.*/gtk-theme-name=udt/' "$HOME/.config/gtk-3.0/settings.ini"
+if command -v gsettings >/dev/null 2>&1; then
+ gsettings set org.gnome.desktop.interface gtk-theme 'udt' 2>/dev/null || true
+fi
+
+# GTK4 ignores gtk-theme-name entirely; its stylesheet is imported by
+# ~/.config/gtk-4.0/gtk.css through this symlink.
+ln -sfn "$gtk_theme/gtk-4.0" "$HOME/.config/gtk-4.0/theme"
+
# Obsidian and Typora need more than a copy: the Obsidian snippet has to be
# enabled in each vault's appearance.json without disturbing the snippets
# already listed there. Skipped silently when neither app is installed.