aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-15 17:35:15 +0200
committerDanilo M. <danix@danix.xyz>2026-09-15 17:35:15 +0200
commita183b4a054d96f310d867b79d7b9fb7a6b875bb8 (patch)
tree89a1824c95850234c51521a35136eb96a760c00f /install.sh
parent1db739eaf7c2155cee80084183a0a0bbe590d3cd (diff)
downloadunified-desktop-theme-a183b4a054d96f310d867b79d7b9fb7a6b875bb8.tar.gz
unified-desktop-theme-a183b4a054d96f310d867b79d7b9fb7a6b875bb8.zip
fix(waybar): call the bar's installer instead of copying one file
The palette reaches the bar as three generated files, not one: the stylesheet, dots.colors for the two dot scripts, which are bash and cannot read @define-color, and two tints of the Slackware mark, which has to contrast with the accent pill at rest and the dark pill on hover. Copying only the stylesheet meant a scheme switch recoloured every pill and left the dots and the mark on the previous scheme. Generating the other two here would have put a second writer on files the bar's own install.sh already writes, drifting apart the moment either side was edited. So this calls that script rather than reimplementing it, with UDT_PALETTE_DONE=1 so it skips the palette run this one has just done. Never fatal, like udt-appthemes: a failure there warns and leaves the bar on its old colours rather than stopping kitty, Kvantum and Sublime from being themed. Verified by switching tokyo-night to nord and back with only this script: the accent, DOT_SUCCESS and both mark tints followed in each direction. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh26
1 files changed, 19 insertions, 7 deletions
diff --git a/install.sh b/install.sh
index 7bc93c5..3371bba 100755
--- a/install.sh
+++ b/install.sh
@@ -48,18 +48,30 @@ ln -sfn "$repo/bin/udt-palette" "$HOME/bin/udt-palette"
# with settings that are none of this repo's business.
scheme="$(sed -n 's/^scheme *= *//p' "$selector")"
-# waybar. The bar is waybar-theme-udt, which keeps its own config directory and
-# imports styles/theme.css under a fixed name, so this is a copy to one path
-# with no import to repoint: switching scheme rewrites the file the running bar
-# already reads.
+# waybar. The bar is waybar-theme-udt, a sibling checkout with its own
+# install.sh, and that script is called here rather than having this one copy
+# the stylesheet into place.
+#
+# The reason is that the palette reaches the bar as THREE generated files, not
+# one: styles/theme.css, dots.colors for the two dot scripts, which are bash
+# and cannot read @define-color, and two tints of the Slackware mark, which
+# has to contrast with the accent pill at rest and the dark pill on hover.
+# Copying only the stylesheet left the dots and the mark on the previous
+# scheme's colours after a switch, and a second writer for those files here
+# would drift from the one over there.
+#
+# Called with the palette already generated, and never fatal: a failure in the
+# bar's install must not stop kitty, Kvantum or Sublime from being themed. The
+# same reasoning as udt-appthemes below.
#
# The stock ~/.config/waybar/ is deliberately left alone. Nothing launches it
# any more, and its stylesheets still reference the per-module role names this
# generator no longer emits, so writing a new theme in there would leave it
# referencing colours that do not exist rather than simply sitting unused.
-if [ -d "$HOME/.config/waybar-udt" ]; then
- install -Dm644 "$repo/templates/waybar/theme.css" \
- "$HOME/.config/waybar-udt/styles/theme.css"
+waybar_repo="$repo/../waybar-theme-udt"
+if [ -x "$waybar_repo/install.sh" ]; then
+ UDT_PALETTE_DONE=1 "$waybar_repo/install.sh" >/dev/null || \
+ echo "waybar: its install.sh failed, bar left on the old colours" >&2
fi
install -Dm644 "$repo/templates/terminal/kitty-theme.conf" \