Sorry if the title isn't too descriptive. I want to achieve the following "animation":
- Song Name
\ Song Name # all these 4 would stay on the same line by
| Song Name # replacing each other every 0.5 seconds
/ Song Name
current_window_title # then for 2 seconds the current window
# title will be displayed
# repeat the animation from the start over and over
I hope that you understand. I'm trying to make a module for my Polybar that shows the played song, then shows the current window title. Unfortunately, I'm not that experienced with Bash in order to achieve this result.
So far I managed to get the song animation part, but when it comes to combining it with the 2 seconds of displaying the current window name on the same line, ahh kind of a headache.
#!/bin/bash
chars="/-\|"
while sleep 0.5; do
echo -en "${chars:$(( i=(i+1) % ${#chars} )):1}" "Song Name" "\r"
done
Can you guys give me some pointers or some help please? Tried to do it myself for 2 days but I can't really figure it out. Is it possible at least?
Thank you in advance.