eww: lyrics highlighting & rofi: adjust size

This commit is contained in:
2025-06-28 09:02:57 +02:00
parent aacbf08995
commit a47bf3d9ce
10 changed files with 52 additions and 10 deletions

24
eww/Lyrics/scripts/colorize.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/env bash
HIGHLIGHT_COLOR="#cdd6f4" # text
NORMAL_COLOR="#7f849c" # overlay1
TARGET_LINE=1
[ -n $1 ] && TARGET_LINE="$1"
mapfile -t lines
output=""
for i in "${!lines[@]}"; do
line_num=$((i + 1))
escaped_line=$(echo "${lines[$i]}" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g')
[[ $i -gt 0 ]] && output+=$'\n' # +="\n" is not properly displayed in eww
if [[ $line_num -eq $TARGET_LINE ]]; then
output+="<span color=\"$HIGHLIGHT_COLOR\">$escaped_line</span>"
else
output+="<span color=\"$NORMAL_COLOR\">$escaped_line</span>"
fi
done
echo "$output"

0
eww/Lyrics/scripts/lyric-show.sh Normal file → Executable file
View File