diff --git a/config/autostart/limine-snapper-notify.desktop b/config/autostart/limine-snapper-notify.desktop new file mode 100644 index 00000000..e1e3e173 --- /dev/null +++ b/config/autostart/limine-snapper-notify.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/migrations/1782049344.sh b/migrations/1782049344.sh new file mode 100644 index 00000000..8cae01e5 --- /dev/null +++ b/migrations/1782049344.sh @@ -0,0 +1,12 @@ +echo "Disable Limine Snapper warning notifier" + +autostart_file="$HOME/.config/autostart/limine-snapper-notify.desktop" + +mkdir -p "$(dirname "$autostart_file")" +cat >"$autostart_file" <<'DESKTOP' +[Desktop Entry] +Hidden=true +DESKTOP + +systemctl --user stop 'app-limine\x2dsnapper\x2dnotify@autostart.service' >/dev/null 2>&1 || true +systemctl --user daemon-reload >/dev/null 2>&1 || true diff --git a/test/shell.d/snapper-test.sh b/test/shell.d/snapper-test.sh index 5df4bbfd..fcdcb393 100644 --- a/test/shell.d/snapper-test.sh +++ b/test/shell.d/snapper-test.sh @@ -5,6 +5,7 @@ set -euo pipefail source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" template="$ROOT/default/snapper/root" +limine_notify_autostart="$ROOT/config/autostart/limine-snapper-notify.desktop" grep -Fx 'NUMBER_CLEANUP="yes"' "$template" >/dev/null grep -Fx 'NUMBER_LIMIT="5"' "$template" >/dev/null @@ -12,6 +13,10 @@ grep -Fx 'TIMELINE_CREATE="no"' "$template" >/dev/null ! grep -Eq '^TIMELINE_(CLEANUP|LIMIT_)' "$template" || fail "Snapper template keeps timeline cleanup details out of the default config" pass "Snapper template keeps update snapshots and disables timeline snapshots" +grep -Fx '[Desktop Entry]' "$limine_notify_autostart" >/dev/null +grep -Fx 'Hidden=true' "$limine_notify_autostart" >/dev/null +pass "Limine Snapper warning notifier is disabled by default" + test_tmp=$(mktemp -d) trap 'rm -rf "$test_tmp"' EXIT @@ -30,6 +35,26 @@ printf 'systemctl %s\n' "$*" >>"$TEST_LOG" STUB chmod +x "$fake_bin/systemctl" +notification_migration=$(grep -rl 'Disable Limine Snapper warning notifier' "$ROOT/migrations" | head -n 1 || true) +[[ -n $notification_migration ]] || fail "Limine Snapper warning notifier migration exists" +grep -F 'limine-snapper-notify.desktop' "$notification_migration" >/dev/null +grep -F 'systemctl --user daemon-reload' "$notification_migration" >/dev/null +grep -F "app-limine\\x2dsnapper\\x2dnotify@autostart.service" "$notification_migration" >/dev/null + +migration_home="$test_tmp/migration-home" +mkdir -p "$migration_home" +TEST_LOG="$test_tmp/calls.log" \ +PATH="$fake_bin:$PATH" \ +HOME="$migration_home" \ + bash -euo pipefail "$notification_migration" >/dev/null + +cmp -s "$limine_notify_autostart" "$migration_home/.config/autostart/limine-snapper-notify.desktop" || fail "Limine Snapper warning notifier migration writes autostart override" +grep -Fx 'systemctl --user daemon-reload' "$test_tmp/calls.log" >/dev/null || fail "Limine Snapper warning notifier migration reloads user units" +grep -Fx 'systemctl --user stop app-limine\x2dsnapper\x2dnotify@autostart.service' "$test_tmp/calls.log" >/dev/null || fail "Limine Snapper warning notifier migration stops active watcher" +pass "Limine Snapper warning notifier migration disables existing user autostart" + +: >"$test_tmp/calls.log" + TEST_LOG="$test_tmp/calls.log" \ PATH="$fake_bin:$PATH" \ OMARCHY_SNAPPER_CONFIGURE_TEST=1 \