diff --git a/bin/omarchy-plymouth-set b/bin/omarchy-plymouth-set index 960ce660..88e59b0a 100755 --- a/bin/omarchy-plymouth-set +++ b/bin/omarchy-plymouth-set @@ -54,7 +54,7 @@ for asset in bullet.png entry.png lock.png progress_bar.png; do magick "$staging_dir/$asset" -channel RGB +level-colors "#$text_hex","#$text_hex" "$staging_dir/$asset" done -sudo cp -a "$staging_dir/." "$theme_dir/" +sudo cp -a --no-preserve=mode,ownership "$staging_dir/." "$theme_dir/" sudo plymouth-set-default-theme omarchy if omarchy-cmd-present limine-mkinitcpio; then diff --git a/test/shell.d/plymouth-set-test.sh b/test/shell.d/plymouth-set-test.sh new file mode 100755 index 00000000..bbc8b6de --- /dev/null +++ b/test/shell.d/plymouth-set-test.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh" + +test_tmp=$(mktemp -d) +trap 'rm -rf "$test_tmp"' EXIT + +source_dir="$test_tmp/source" +theme_dir="$test_tmp/theme" + +mkdir -m 0700 "$source_dir" +mkdir -m 0755 "$theme_dir" +touch "$source_dir/logo.png" + +cp -a --no-preserve=mode,ownership "$source_dir/." "$theme_dir/" + +[[ $(stat -c %a "$theme_dir") == "755" ]] || + fail "Plymouth asset copy preserves the theme directory permissions" + +grep -Fq \ + 'cp -a --no-preserve=mode,ownership "$staging_dir/." "$theme_dir/"' \ + "$ROOT/bin/omarchy-plymouth-set" || + fail "omarchy-plymouth-set avoids copying staging directory ownership and mode" + +pass "Plymouth asset copy preserves the package-owned directory metadata"