noctuid / zscroll

A text scroller for panels or terminals
GNU General Public License v3.0
198 stars 10 forks source link

Scrolling "closes" on polybar #8

Closed indeedwatson closed 4 years ago

indeedwatson commented 4 years ago

Looked at the man and the issues here but I can't find an explanation for this behavior: whenever the text stops scrolling the module "closes", ie. the prefix with the icons move gradually towards the right until there is no text left and then it restarts with the icons all the way to the left, the text scrolling, etc.

Is this intended behavior? Something I'm not configuring right? I'm using it with mpv so this is my script:

#!/bin/sh

player_status=$(playerctl status 2> /dev/null)

if [ "$player_status" = "Playing" ]; then
    ( echo "  $(playerctl metadata artist) - $(playerctl metadata title)"  | zscroll -l 30 -d 0.2 -b "  " )
elif [ "$player_status" = "Paused" ]; then
    ( echo  " $(playerctl metadata artist) - $(playerctl metadata title)" | zscroll -l 30 -d 0.2   )
else
    echo ""
fi
noctuid commented 4 years ago

I don't really understand the behavior your describing. How would the text stop scrolling? I'd expect it to scroll infinitely in your example.

I think it would just be easiest to use zscroll's dynamic updating:

zscroll -b "♪ x" -d 0.2 -l 30 \
        -M "playerctl status" \
        -m "Playing" "-b ' '" \
        -m "Paused" "-b ' '" \
        -u true 'song_title' &

wait

where song_title is a script in PATH that has the echo "$(playerctl metadata artist) -.....

indeedwatson commented 4 years ago

I wasn't sure if the behavior was intended. I thought it was meant to scroll infinitely (not in time, but visually), similar to a text scroll in the news. I don't know what is the purpose of having it close, I want to be able to see the title/album at all times.

I ended up making a function for scrolling in python, might revisit this if I run into issues with that, feel free to close this.

noctuid commented 4 years ago

I thought it was meant to scroll infinitely (not in time, but visually), similar to a text scroll in the news. I don't know what is the purpose of having it close, I want to be able to see the title/album at all times.

Yeah, it should scroll infinitely. I couldn't replicate whatever issue you were having, but I wouldn't expect for your script to work for other reasons.

Feel free to reopen if you ever try my suggested command and it doesn't work.

indeedwatson commented 4 years ago

I couldn't, and I also couldn't get it to work with the format album - title, tried with many combinations following the examples in the man pages and the readme (the flags are a bit confusing to me if I'm honest). But I'm a bit busy so I won't have time to go through it again and copy the commands, output and behavior in detail. If I test this again in a few weeks or so I'll try to do that.