aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanix <danix@danix.xyz>2026-06-11 10:51:15 +0200
committerdanix <danix@danix.xyz>2026-06-11 10:51:15 +0200
commit25eca863522ad8c37770782b5a86a3591093e17e (patch)
tree780a6a1a812d70012345017a178ddfdf299f654f
parentd7bd784d23d9543740e2428bd7f65fb85283d26f (diff)
downloadwallp-25eca863522ad8c37770782b5a86a3591093e17e.tar.gz
wallp-25eca863522ad8c37770782b5a86a3591093e17e.zip
feat: render help with Pango markup in qarma
qarma --info supports Pango markup; bold headers + monospace command column. Stdout path stays plain text (no tags leak to terminal). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
-rw-r--r--tests/wallp.bats20
-rwxr-xr-xwallp16
2 files changed, 35 insertions, 1 deletions
diff --git a/tests/wallp.bats b/tests/wallp.bats
index e809c13..b78dc35 100644
--- a/tests/wallp.bats
+++ b/tests/wallp.bats
@@ -278,6 +278,26 @@ EOF
[[ "$output" == *"Usage"* ]]
}
+@test "stdout help has no pango markup tags" {
+ unset WAYLAND_DISPLAY
+ run show_help
+ [[ "$output" != *"<b>"* ]]
+ [[ "$output" != *"<tt>"* ]]
+ [[ "$output" == *"Usage"* ]]
+}
+
+@test "qarma help uses pango markup" {
+ export WAYLAND_DISPLAY="wayland-0"
+ cat > "$STUB_DIR/qarma" <<EOF
+#!/bin/bash
+echo "qarma \$*" >> "$TMP_HOME/calls.log"
+exit 0
+EOF
+ chmod +x "$STUB_DIR/qarma"
+ show_help
+ grep -q "<b>" "$HOME/calls.log"
+}
+
@test "bootstrap on missing conf exits zero without setting wallpaper" {
unset WAYLAND_DISPLAY
run main --restore
diff --git a/wallp b/wallp
index 339b0dc..81a9054 100755
--- a/wallp
+++ b/wallp
@@ -260,7 +260,21 @@ Usage:
Config: ~/.config/wallp/wallp.conf"
if [ -n "${WAYLAND_DISPLAY:-}" ] && command -v qarma >/dev/null 2>&1; then
- qarma --info --title="wallp help" --text="$text" 2>/dev/null
+ # qarma renders Pango markup in --info: bold headers, monospace commands.
+ local markup="<b>wallp</b> — unified wallpaper manager
+
+<b>Usage</b>
+ <tt>wallp </tt> Show this help
+ <tt>wallp --help | -h </tt> Show this help
+ <tt>wallp --set </tt> Interactive (qarma) selection
+ <tt>wallp --set H=&lt;file&gt; </tt> Set horizontal screen only
+ <tt>wallp --set V=&lt;file&gt; </tt> Set vertical screen only
+ <tt>wallp --set H=&lt;f&gt; V=&lt;f&gt; </tt> Set both screens
+ <tt>wallp --restore </tt> Restore last session (defaults if none)
+ <tt>wallp --theme &lt;name&gt; </tt> Override theme (with --set or --restore)
+
+<b>Config:</b> <tt>~/.config/wallp/wallp.conf</tt>"
+ qarma --info --title="wallp help" --text="$markup" 2>/dev/null
else
printf '%s\n' "$text"
fi