aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-29 09:55:45 +0200
committerDanilo M. <danix@danix.xyz>2026-09-29 09:55:45 +0200
commit1e4d2b4be7ad20dd108503fb65c264673ca6457b (patch)
tree8d76604d4bdebe5fa4b4e60be2447df61475789f /tests
parenta06d8f948c4d5a60bff992c3d6f26b5fb54f80cb (diff)
downloadunified-desktop-theme-1e4d2b4be7ad20dd108503fb65c264673ca6457b.tar.gz
unified-desktop-theme-1e4d2b4be7ad20dd108503fb65c264673ca6457b.zip
feat(install): track rofi scripts, wire nvim and hypr-theme, merge qt/gtk keys
The rofi menus' launch scripts lived loose in ~/bin, so the themes were tracked and the only things that open them were not. They now live in bin/ and are symlinked under the names hypr-theme's keybindings call. neovim gets a generated colorscheme: catppuccin/nvim with all 26 palette colours overridden from the active scheme, selected by rewriting only the colorscheme line of init.vim. hypr-theme is linked as the whole of ~/.config/hypr, leaving a real directory there alone. The qt-gtk templates were reference copies nothing installed. They now hold theme keys only and ini_merge writes them into the live qt5ct, qt6ct and gtk3 files key by key, keeping every other line; tests/ini-merge.sh checks it. The stale kvantum.kvconfig template is gone, install.sh writes that file. Fresh-machine fixes: settings.ini and ~/.config/gtk-4.0 are created when missing instead of aborting under set -e, and conky is found as a sibling checkout and skipped when absent, in udt-palette as well as install.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/ini-merge.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ini-merge.sh b/tests/ini-merge.sh
new file mode 100755
index 0000000..b495c9c
--- /dev/null
+++ b/tests/ini-merge.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Check install.sh's ini_merge: fresh file, partial file, idempotence.
+# Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+# Licensed under the GNU General Public License v2 only.
+set -euo pipefail
+
+repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+eval "$(sed -n '/^ini_merge() {/,/^}/p' "$repo/install.sh")"
+tmp="$(mktemp -d)"
+trap 'rm -rf "$tmp"' EXIT
+
+printf '[A]\nx=1\ny=2\n[B]\nz=3\n' > "$tmp/tmpl"
+
+ini_merge "$tmp/tmpl" "$tmp/fresh"
+diff <(printf '[A]\nx=1\ny=2\n[B]\nz=3\n') "$tmp/fresh"
+
+# Existing key replaced, foreign key kept, missing key lands before the blank
+# line that separates sections, missing section appended.
+printf '[A]\nx=0\nkeep=me\n\n[C]\nw=4\n' > "$tmp/part"
+ini_merge "$tmp/tmpl" "$tmp/part"
+diff <(printf '[A]\nx=1\nkeep=me\ny=2\n\n[C]\nw=4\n[B]\nz=3\n') "$tmp/part"
+
+cp "$tmp/part" "$tmp/again"
+ini_merge "$tmp/tmpl" "$tmp/again"
+diff "$tmp/part" "$tmp/again"
+
+echo "ini-merge OK"