rofi-*: properly escape for pango markup

This commit is contained in:
Vincent Bernat 2021-07-21 09:55:50 +02:00
parent 40d8aece8d
commit ac9beaa242
2 changed files with 5 additions and 4 deletions

View file

@ -41,8 +41,8 @@ EOF
status=$(playerctl -p $mediaplayer status)
case $status in
Playing|Paused)
title="$(playerctl -p $mediaplayer metadata xesam:title)"
artist="$(playerctl -p $mediaplayer metadata xesam:artist)"
title="$(playerctl -p $mediaplayer metadata xesam:title | sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g')"
artist="$(playerctl -p $mediaplayer metadata xesam:artist | sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g')"
status="$status <span weight='light'><i>${title} (${artist})</i></span>"
;;
esac

View file

@ -16,7 +16,7 @@ case $ROFI_RETV in
case $(nmcli radio wifi) in
enabled)
printf "Turn wifi off\00info\037off\n"
printf "Scan wifi networks\00info\037rescan\n"
printf "Scan wifi networks...\00info\037rescan\n"
;;
disabled)
printf "Turn wifi on\00info\037on\n"
@ -24,10 +24,11 @@ case $ROFI_RETV in
esac
nmcli -f IN-USE,SSID,BSSID,SECURITY,FREQ,SIGNAL -m multiline device wifi list --rescan no \
| sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g' \
| awk -F': *' '{
property=$1;
value=gensub(property ": *", "", 1);
p[property]=gensub("<", "&lt;", "g", value);
p[property]=value;
}
($1 == "SIGNAL") {
if (p["IN-USE"] == "*") {