aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/install.sh b/install.sh
index 1b51947..5489f46 100755
--- a/install.sh
+++ b/install.sh
@@ -9,6 +9,12 @@ target="$HOME/.config/rofi/udt"
mkdir -p "$target" "$HOME/bin" "$HOME/.cache/wal"
+# Generate every themed config from the selected scheme first: the rofi palette
+# symlinked below is one of its outputs, so this has to run before anything is
+# linked. It fails loudly if a role names a colour the scheme does not define,
+# which is the whole point of keeping the colours in one place.
+"$repo/bin/udt-palette"
+
# Theme files are symlinked individually; accent.rasi is NOT, it points at the
# generated file in the wal cache instead.
for f in palette.rasi common.rasi menu.rasi list.rasi grid.rasi powermenu.rasi confirm.rasi; do
@@ -30,6 +36,25 @@ fi
ln -sfn "$HOME/.cache/wal/udt-accent.rasi" "$target/accent.rasi"
ln -sfn "$repo/bin/udt-accent" "$HOME/bin/udt-accent"
+ln -sfn "$repo/bin/udt-palette" "$HOME/bin/udt-palette"
+
+# The generated configs for everything that is not rofi. These are copied
+# rather than symlinked: each app owns its config file and mixes theme keys
+# with settings that are none of this repo's business.
+scheme="$(sed -n 's/^scheme *= *//p' "$repo/palette/roles.conf")"
+
+# waybar reads whichever themes/<name>.css style.css imports, so write the file
+# under the scheme's own name and repoint the import. The older per-flavour
+# files in themes/ are left alone; they are simply no longer imported.
+install -Dm644 "$repo/templates/waybar/theme.css" \
+ "$HOME/.config/waybar/themes/$scheme.css"
+if [ -f "$HOME/.config/waybar/style.css" ]; then
+ sed -i "s|@import \"themes/.*\.css\";|@import \"themes/$scheme.css\";|" \
+ "$HOME/.config/waybar/style.css"
+fi
+
+install -Dm644 "$repo/templates/terminal/kitty-theme.conf" \
+ "$HOME/.config/kitty/current-theme.conf"
echo "installed:"
ls -l "$target" "$HOME/bin/udt-accent"