spotui icon indicating copy to clipboard operation
spotui copied to clipboard

Auto-scroll truncated text

Open ceuk opened this issue 4 years ago • 1 comments

When text is truncated it should automatically scroll left and right on an interval.

E.g. given the text "Never gonna give you up - Rick Astley"

You would move the truncation offset about 1 character every 500ms until the end is reached (at which point it should reverse).

There should also be a short delay (2 seconds or so) when the truncation offset reaches 0 again.

e.g. (the bar represents the truncation)

Never gonna give you up - Rick Astley
| ---------------- |

rendered: Never gonna give...

~500ms later:

Never gonna give you up - Rick Astley
  | ---------------- |

rendered: ever gonna give ...

~500ms later:

Never gonna give you up - Rick Astley
    | ---------------- |

rendered: ver gonna give y...

... etc

ceuk avatar May 31 '21 12:05 ceuk

I've been grabbing lil tidbits of the internet on where to learn things that might help add features to this, and I have just the thing for this one, with code example through python curses:

https://www.youtube.com/watch?v=FGcZeVDWXR0

octoshrimpy avatar May 31 '21 19:05 octoshrimpy