alpha-nvim
alpha-nvim copied to clipboard
feature request: image support
Hi, would it be possible to implement image support? https://github.com/edluffy/hologram.nvim can help with displaying the images
jeez, so many kitty features simultaneously impress me and turn me off of kitty.
you should be able to whipup a rather hacky solution with the current set of features. the ui building api should already be extendable, but since hologram.nvim seemingly doesn't have a way of returning how many rows and columns an image takes up calculating how much space to allocate seems like it would be difficult/impossible. i might try to figure something out if i have spare time
Yeah, the previous dashboard plugin (dashboard.nvim) kindof has image support. You could use a floating window running a terminal in place of the dashboard text, and then use something like uzerbeg to display the images. It was really hacky and barely worked though
using ueberzug ( for linux ) would be nice since it works on every terminal :D
dashboard-nvim (which this plugin is not a successor to, btw!) presumably did the terminal previewer for exactly this reason. there are simply too many competing standards.
my approach to designing this api was such that functionality could be added by another plugin, i think i will write 1 such plugin and any further implementations can be contributed :)
i can't seem to get hologram to work at all, let alone with alpha :/
i can't seem to get hologram to work at all, let alone with alpha :/
try using ueberzug to display stuff ._.
A lil script taking from telescope-media repo
unfortunately ueberzug also doesn't seem to work for me i read that maybe it doesn't support wayland but since they have seemingly closed their issue tracker there's no way for me to know
unfortunately ueberzug also doesn't seem to work for me i read that maybe it doesn't support wayland but since they have seemingly closed their issue tracker there's no way for me to know
which distro?
according to the repo info section:
...display images in combination with X11 I'm assuming that means no wayland support
The only cross-platform ways I can think of are
- kitty + kitty image stuff
- sixel-compatible terminal + sixel image stuff
I think the best solution would be to create a successor to hologram.nvim, but sounds like quite a bit of work and would end up being extremely complicated if we were to support multiple image protocols.
The easiest (but hackiest) way is to just open a floating neovim terminal window and run uberzug/sixel/kitty-image. Since the dashboard doesn't scroll, maybe you/we could consider an option to replace the dashboard ASCII with a terminal instead, where the user could run anything?
sixel and kitty stuff are very terminal specific , not all terminals support sixel graphics which is upsetting :(
sixel and kitty stuff are very terminal specific , not all terminals support sixel graphics which is upsetting :(
there is not a good cross platform way of displaying images in a terminal. there are simply too many competing standards and none of them are very complete, which is why dashboard does the floating terminal window thing
sixel and kitty stuff are very terminal specific , not all terminals support sixel graphics which is upsetting :(
there is not a good cross platform way of displaying images in a terminal. there are simply too many competing standards and none of them are very complete, which is why dashboard does the floating terminal window thing
yes , but ueberzug works on all terminals on linux ( but not wayland )
honestly maybe chafa is the way to go? You don't get a proper image, its made up of unicode blocks. Benefit being that every single terminal will work, the drawback is a much lower resolution image
this seems promising https://github.com/bytesnake/vim-graphical-preview
this seems promising https://github.com/bytesnake/vim-graphical-preview
ig only a few terminals have sixel graphics support
the upshot being that it actually works : )
What about to steal dashboard code?
it's already in alpha https://github.com/goolord/alpha-nvim/pull/124 @EpsilonKu
No, I mean ready ueberzug script.
does dashboard integreate ueberzug now?
https://github.com/glepnir/dashboard-nvim/commit/0c3fb6e7a430859b8c1b605fa9fdcf38df0dc079 . Kinda yeah
well, ueberzug doesn't work on my machine, so I have no way to test it. but if someone submits a PR I'll happily approve it. the terminal PR should be a good example of how to extend the alpha api.
well, ueberzug doesn't work on my machine, so I have no way to test it. but if someone submits a PR I'll happily approve it. the terminal PR should be a good example of how to extend the alpha api.
how did you test it?
How about use Chafa to convert an image into graphics formats or ANSI/Unicode character art? It can display in terminal. There are also some discussion about this in dashboard-nvim
if that's what you want to do you can use the terminal element https://github.com/goolord/alpha-nvim/blob/main/doc/alpha.txt#L137-L159
this program supports Kitty, Sixel, iTerm and Unicode blocks with truecolor/ansi256 support otherwise. that's pretty much all the terminal picture protocols: https://github.com/emsquid/pic not sure if it is helpful, but thought i would share it here anw