I have a string called "desktops" that look like this:
desktops="1 2 %{F#990000}3%{F-} 4 5 6 7 8 9 0"
The 6 digits after the "#" represent an RGB color, so the 3rd desktop have a dark red color. One of the above numbers separated between spaces can represent a focused desktop, for example:
focused="9"
In that case I need and output like this:
"1 2 %{F#990000}3%{F-} 4 5 6 7 8 %{F#FFFF00}9%{F-} 0"
The problem arises when the numbers in the RGB color codes are also present in the desktops list.
I tried this:
echo $desktops | sed "s/$focused/%{F#FFFF00}$focused%{F-}/"
but of course it doesn't work when the color codes have numbers present in the focused variable.
Any hints?