From 363bc738f6fd20dae07faa5453f20477454f4428 Mon Sep 17 00:00:00 2001 From: danix Date: Thu, 11 Jun 2026 10:39:33 +0200 Subject: fix: qarma_select returns empty with plain --list Use --radiolist --print-column=2 so the selected screen value is actually printed. Plain --list printed nothing on selection, so the qarma set flow exited without applying. Caught in hardware smoke test. Co-Authored-By: Claude Opus 4.8 --- tests/wallp.bats | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'tests/wallp.bats') diff --git a/tests/wallp.bats b/tests/wallp.bats index d7edaec..e809c13 100644 --- a/tests/wallp.bats +++ b/tests/wallp.bats @@ -238,6 +238,32 @@ teardown() { [[ "$output" == *"no display"* ]] } +@test "set qarma path applies selected screen" { + CONF_OUTPUT_H="DP-1"; CONF_OUTPUT_V="DP-3"; CONF_THEME="conf" + export WAYLAND_DISPLAY="wayland-0" + : > "$HOME/picked.png" + # qarma stub: --list returns the screen choice; --file-selection returns a path. + # Real qarma --list returns the chosen row only with --radiolist and + # --print-column=2; a plain --list prints nothing. The stub mirrors that, so + # this test fails unless qarma_select uses the correct flags. + cat > "$STUB_DIR/qarma" <> "$TMP_HOME/calls.log" +case "\$*" in + *--list*) + case "\$*" in + *--radiolist*--print-column=2*|*--print-column=2*--radiolist*) echo "V" ;; + esac ;; + *--file-selection*) echo "$HOME/picked.png" ;; +esac +exit 0 +EOF + chmod +x "$STUB_DIR/qarma" + do_set "" + grep -q "swaybg -o DP-3 -i $HOME/picked.png" "$HOME/calls.log" + ! grep -q "swaybg -o DP-1" "$HOME/calls.log" +} + @test "bare invocation shows help" { unset WAYLAND_DISPLAY run main -- cgit v1.2.3