CSS Animations #4540
Closed
jmrepetti
started this conversation in
Show and tell
CSS Animations
#4540
Replies: 2 comments
-
|
By the way, you can do this in the whole bar. Noice.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Just read the Styling section now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone:
I started using Niri and end up customizing Waybar too much. I love it. I think there should be Waybar Jam day.
I wanted to display some animations based on a PNG sprite-sheet. Wait, my first attempt was to write a CFFI module, in GO, pf I died so I went back with C, simple. I was able to display an animation (the same animation you can see below) by reading fragments from a Pixbuf, and it worked. The only "problem" is that Waybar starts consuming a bit more CPU, around 5%. I thought I was doing something wrong; after all, showing an animated sprite on Waybar is just decoration. You might find some utility, perhaps changing the animation based on events. I don’t know.
Then I thought, what could CSS do for me? I was able to set a background image from a URL, define some keyframes, and voila! It worked perfectly. I’m not sure I’ll use this, but it’s possible.
One or two things, Waybar consume a bit more of CPU when doing animations whether using de CFFI module or CSS animation. Probably is normal.
The other thing is that you can load an image from a remote URL, maybe we have to be careful when loading this resoruces, or is just me paranoid. Anyway here is the code:
The module is just a place holder:
And the style:
How it looks:
running.mp4
Beta Was this translation helpful? Give feedback.
All reactions