scripts/waybar/escape-pango.sh
2025-03-17 00:54:57 -07:00

10 lines
259 B
Bash
Executable File

#!/bin/bash
CMD="$1"
BEFORE_SPACE="${CMD%% *}"
if command -v "$BEFORE_SPACE" &> /dev/null; then
eval "$CMD" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/'\''/\&#39;/g'
else
echo "$CMD" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/'\''/\&#39;/g'
fi