[Feature] Custom animation support #719

Closed
opened 2024-12-12 14:36:54 +01:00 by Motohrust · 8 comments
Motohrust commented 2024-12-12 14:36:54 +01:00 (Migrated from github.com)

Pre-requisites

  • I have looked for any other duplicate issues
  • I have confirmed the requested feature doesn't exist in the latest version in development

Wanted behavior

sorry for stupid question, I just didn't found any information and commenced configuration of system like some days ago

### Pre-requisites - [X] I have looked for any other duplicate issues - [X] I have confirmed the requested feature doesn't exist in the latest version in development ### Wanted behavior sorry for stupid question, I just didn't found any information and commenced configuration of system like some days ago
jepes1981 commented 2025-02-09 04:40:12 +01:00 (Migrated from github.com)

I want this too, thou I do not know how to program in zig but an image to ascii art is probably the best approach since ly is purely text based.

I want this too, thou I do not know how to program in zig but an image to ascii art is probably the best approach since ly is purely text based.

I third this, would like an ASCII splash on the login page. Something a little more personalized

I third this, would like an ASCII splash on the login page. Something a little more personalized
Owner

It may be possible to implement the .dur file format, as described here and brought to light in #743.

It may be possible to implement the `.dur` file format, as described [here](https://github.com/cmang/durdraw/blob/master/durformat.md) and brought to light in #743.
AnErrupTion changed title from is it possible to set image background (or gif animation) to [Feature] Custom animation support 2025-07-07 23:26:50 +02:00
AnErrupTion added this to the 1.3.0 milestone 2025-09-25 08:34:59 +02:00

We could use .so files.
Ly could invoke our .so's "draw" function, passing us screen dimensions and a buffer to draw to for each frame, then it can draw the boxes and other info over that.

Downside being that this would only offer support for compiled languages. That said, and perhaps this part is more of a community initiative than something for the main repo, i guess we could also create wrappers that call out to interpreters if wanted.

But perhaps a more secure option would be to use wasm? I doubt it'd be much, if at all, more of a hurdle for interpreter users either.
By no means a zig dev, but a brief search suggests it could work quite swimmingly. There's the standard bindings to the wasmer api; which should enable for the creation of a host that loads and executes 3rd party functions, and there's also zaw; a, less complete but, zero-allocation framework/protocol though I'm not sure it's exactly intended for such a use case. We'd probably need to buffer for it because of ansi codes.

https://github.com/zig-wasm/wasmer-zig-api
https://github.com/stylearcade/zaw/blob/main/docs/protocol-conduit.md

We could use .so files. Ly could invoke our .so's "draw" function, passing us screen dimensions and a buffer to draw to for each frame, then it can draw the boxes and other info over that. Downside being that this would only offer support for compiled languages. That said, and perhaps this part is more of a community initiative than something for the main repo, i guess we could also create wrappers that call out to interpreters if wanted. But perhaps a more secure option would be to use wasm? I doubt it'd be much, if at all, more of a hurdle for interpreter users either. By no means a zig dev, but a brief search suggests it could work quite swimmingly. There's the standard bindings to the wasmer api; which should enable for the creation of a host that loads and executes 3rd party functions, and there's also zaw; a, less complete but, zero-allocation framework/protocol though I'm not sure it's exactly intended for such a use case. We'd probably need to buffer for it because of ansi codes. https://github.com/zig-wasm/wasmer-zig-api https://github.com/stylearcade/zaw/blob/main/docs/protocol-conduit.md
Owner

We could use .so files.
Ly could invoke our .so's "draw" function, passing us screen dimensions and a buffer to draw to for each frame, then it can draw the boxes and other info over that.

I have some security & reliability concerns with this method, given that this would essentially allow arbitrary code execution. This'd be the best method customisability-wise, but I'm not sure the security sacrifice is worth it. Also, that means if the animation code segfaults, Ly is brought down too, which isn't great... not that Ly is the most reliable product ever, but if I can avoid more issues, I'll gladly do so. xD

> We could use .so files. Ly could invoke our .so's "draw" function, passing us screen dimensions and a buffer to draw to for each frame, then it can draw the boxes and other info over that. I have some security & reliability concerns with this method, given that this would essentially allow arbitrary code execution. This'd be the best method customisability-wise, but I'm not sure the security sacrifice is worth it. Also, that means if the animation code segfaults, Ly is brought down too, which isn't great... not that Ly is the most reliable product ever, but if I can avoid *more* issues, I'll gladly do so. xD

Very, very, fair! In case you missed it, I also suggested wasm.

Here's another potentially fruitful library for it:
https://github.com/malcolmstill/zware

Very, very, fair! In case you missed it, I also suggested wasm. Here's another potentially fruitful library for it: https://github.com/malcolmstill/zware
Owner

@kendfss wrote in #719 (comment):

Very, very, fair! In case you missed it, I also suggested wasm.

Here's another potentially fruitful library for it: https://github.com/malcolmstill/zware

Right, though I'm not sure if adding an entire WASM runtime for just a few cool pixels is worth it. Especially when there's #833 which implements what essentially is a GIF in a terminal.

@kendfss wrote in https://codeberg.org/fairyglade/ly/issues/719#issuecomment-8653566: > Very, very, fair! In case you missed it, I also suggested wasm. > > Here's another potentially fruitful library for it: https://github.com/malcolmstill/zware Right, though I'm not sure if adding an entire WASM runtime for just a few cool pixels is worth it. Especially when there's #833 which implements what essentially is a GIF in a terminal.

Great work the both of you! Excited to play with this!

Great work the both of you! Excited to play with this!
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
fairyglade/ly#719
No description provided.