-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add Überzug image support #1172
Comments
I don't like the idea of sourcing the library. Also it looks like it requires |
Oh yes, there is. I nearly gave up on searching for it. I loved seeing these useless messages:
Sooo helpful... but whatever, so there is one quick dirty example: #!/usr/bin/env bash
function ImageLayer {
ueberzug layer -sp json
}
# ~/ doesn't work
path_to_image="/home/dawidpotocki/.config/wallpaper"
x_padding=0
y_padding=0
function add_image {
echo "{\"action\": \"add\", \"identifier\": \"image\", \"x\": $x_padding, \"y\": $y_padding, \"path\": \"$path_to_image\"}";
}
ImageLayer -< <(
add_image
read
)
There is probably some way to make it more clean, but I'm just too stupid for that :P. |
Would be great to support a backend that works on all terminals unlike literally every other backend |
@ShayBox Sorry to butt in here, but -- does Chafa fail on your terminal? It really shouldn't. |
I'm unaware of that backend, I tried all the ones listed on the GitHub repo wiki, ascii and caca work but they're ascii, w3m will flicker showing the image but won't stay, my terminal is st.
EDIT: Sorry, github reply emails included that part
EDIT2: Tested it, it does not work.
EDIT3: I found out that chafa requires the chafa package, the wiki doesn't list chafa as a backend so I didn't know that, it works now, still ascii so not what I'm looking for but it works.
|
From what I see Chafa is showing images in "ascii", so it isn't really good solution. |
Chafa shows the image in the terminal using terminal characters. w3m and Überzug open a new X11 window on top of the terminal. The flickering in w3m is probably caused by changes in window stacking or some other bug. That's beside the point, though -- @ShayBox said every backend fails, and I was curious if that included Chafa. If so, they should probably open a separate bug for that as it's designed to work with every terminal, over ssh, etc. Edit: Thanks for checking, @ShayBox! Sorry again for the noise. |
Thanks to @seebye and @dawidpotocki I got this to work. I will provide a patch (as a txt file cus github). There are 2 issues (though not a big deal, nor I think even possible to fix due to the nature of uberzug itself)
|
you cannot type while uberzug is running
You mean having picture with your shell prompt? Because you actually can
type when script is running.
if you scroll then the image moves with your scroll
I think that would not be a big issue.
|
@dawidpotocki Well I suppose that having uberzug run in the background instead would be better and fix issue 1. Tho I am not so sure where to do that. |
Much more elegant. Thank you @seebye |
I will look into this. 👍 |
Has there been any progress on this? The git version of ranger allows you to use ueberzug for image previews, could that code be used in neofetch? |
I have no interest in this feature whatsoever, however I will accept a pull request adding this functionality to No one other than myself has actually attempted to add support for this backend or asked for my help in doing so. The main issue I have with Uberzug is the lack of it being able to be run as a one-off command. It needs to run as a daemon and I'm not sure if this model will fit the way images are handled in Neofetch. I'm open to pull requests and willing to help someone get this merged. |
As no one seems to want to implement this, discussion can now take place here: #1392 |
Überzug is command line Python3 util which allows to draw images on terminals. In my experience it is more reliable than w3m and works in pretty much any terminal (tested on st, termite, urxvt, kitty, alacritty, gnome-terminal, konsole, lxterminal, xterm).
This is example of simple displaying image using Überzug in bash:
So I guess it wouldn't be that hard to implement it?
The text was updated successfully, but these errors were encountered: