fastfetch-cli / fastfetch

A maintained, feature-rich and performance oriented, neofetch like system information tool.
MIT License
11k stars 425 forks source link

[FEAT] animated logos #1423

Closed acxz closed 4 hours ago

acxz commented 8 hours ago

Be sure to read FAQ before submitting a new issue.

Wanted features:

Right now we support static logos of various formats. It would be wonderful to support animated logos such as .gif files.

Motivation:

The motivation here is that I have a shell script, pokeshell, which supports the output of both static and animated images to the terminal via chafa. I can pipe the static output just fine with pokeshell pikachu | fastfetch --file-raw -, but pokeshell -a pikachu | fastfetch --file-raw - just clears the current terminal screen. (i.e. pikachu.gif | fastfetch --file-raw -)

pokeshell pikachu | fastfetch --file-raw -: image

Here is the animated file that I would like to show in fastfetch: pikachu.gif

How it looks by itself:

https://github.com/user-attachments/assets/8dcf45c2-fba0-4023-864c-a83674c51199

And when trying to use the file with fastfetch: image

CarterLi commented 4 hours ago

gifs only work with iTerm image protocol. In WSL2, you may install Wezterm inside Linux and use

{
  "logo": {
    "padding": {
      "top": 2
    },
    "source": "/path/to/pikachu.gif",
    "type": "iterm",
    "width": 20
  }
}

https://github.com/user-attachments/assets/aebbdd56-612f-4662-853a-b1aa91467f92

CarterLi commented 4 hours ago

How it looks by itself:

I assume the program supports the animation by drawing every frame manually. This method doesn't work with fastfetch because fastfetch exits immediately after all modules are printed.

CarterLi commented 4 hours ago

I tested your script and confirmed your script keeps running if I enables animation mode. You may take a look at the iterm image protocol which provides much higher resolution and is much simpler to use.

acxz commented 4 hours ago

I didn't think to check iterm... Thanks for that. Is there no plan to support other animation protocols, like kitty or with native chafa output (via redrawing fastfetch output, maybe)?

acxz commented 4 hours ago

The script actually uses chafa or timg, both of which have support for iterm. I'm testing with a limited character set right now.

CarterLi commented 3 hours ago

Is there no plan to support other animation protocols, like kitty or with native chafa output (via redrawing fastfetch output, maybe)?

No plan. Fastfetch is designed to exit as fast as possible. Redrawing is not an option here.

native chafa output

chafa is not an image protocol. It just print regular texts.

acxz commented 3 hours ago

also side note, in the config file could I list an arbritary command that outputs a filename? i.e. say if I had a pokeshell --filename pikachu which outputs ~/.cache/pokeshell/pikachu.gif. Could I do "source": "pokeshell --filename pikachu"?

acxz commented 3 hours ago

Does kitty require redrawing? I thought it was more similar to iterm in that regards?

CarterLi commented 3 hours ago

Could I do "source": "pokeshell --filename pikachu"?

You may use command substitution. For example "source": "$(pokeshell --filename pikachu)"

See also https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options

CarterLi commented 3 hours ago

Does kitty require redrawing? I thought it was more similar to iterm in that regards?

Kitty has its own animation protocol that I didn't investigate. I tested this command with 0.37.0 and it works for me

kitten icat -n --align left ~/pikachu.gif | fastfetch --raw -