noctuid/zscroll

Scrolling "closes" on polybar

indeedwatson opened this issue · 4 comments

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

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) -.....

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.

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.

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.