Open ktnlikeasmallcat opened 5 months ago
Hi!
Two thoughts:
Because the “add”-action does not show up in the logs, I would guess the problem is in the Joshuto config. Do you return 0
in the preview-script? (See the “❗Important”-Note in image_previews.md!) Is your max_preview_size
there big enough for your image? I set this number to an insane big value, so that the preview is processed for any file. (I think this max_preview_size
should actually be removed in Joshuto.)
If this does not lead you to the solution, maybe try to write some log-info from preview_file.sh
and on_preview_shown.sh
to some temp file (echo "yay" >> /tmp/something
) and check if these scripts are actually invoked.
Thanks for the guidance. It seems I'm unable to get uz++ showing anything at all using the json syntax on the command line. I might be doing it wrong, I'm using ueberzug layer
, hitting enter and pasting {"action": "add", "x": 10, "y": 10, "identifier": "test", "path": "~/Pictures/foo/bar.png"}
(I've tested several x,y values). It just hangs, so either I'm inputting the test wrong or something's gone sideways in uz++.
I'm working with some very modestly sized images.
I'd need to do the scripting in https://github.com/kamiyaa/joshuto/issues/366 in order to get that log info, right? It's somewhat dense to me at this moment, I'm having a hard time understanding what precisely would need to be done for that, but I'll revisit it and see if I can't wrap my head around it because the issues there look familiar to what I'm facing.
For now I'm simply using viu -b -w "${PREVIEW_WIDTH}" "${FILE_PATH}" && exit 0
in the preview.sh to create unicode block previews as a stopgap - I may also try to hack together something for getting a preview without block characters.
Hi again,
for testing if überzug++ works at all (and with which configuration), you may want to use this example wrapper script from überzug++'s repo.
I also had quite some trouble to get it working. Seems there are some pitfalls. I solved my problems by playing around with this img
-script. Images in the terminal are always a hack after all. 🙃
Yes, #366 exactly describes the test-logging I was talking about.
Let me try to list out the sequence of stuff that must work and can be tested by you:
show_image
function in there from a Joshuto sub-process like the preview-script or a shell
-call; I would skip this test in the beginning, just take care that the working Überzug++-configuration from the first step is used in the wrapper)preview.sh
, or whatever you called it) must be invoked by Joshuto for your images and it must return 0
; test this by getting some text-preview for your image, like some metadata or just the path or whatever into the 3rd, right-most paneIf this all works but you still don't have an image, there must be something fishy with the wrapper script or how the show_image
is called from the hook.
Ueberzug++ is able to display images, according to the wrapper you linked. That I'm able to use viu to preview the image also means that the preview.sh script is also functioning, so the thing that's left for me to do is the second and fourth points here, but how to run those tests more or less escapes me. I appreciate your patience, how do I go about doing those tests exactly? I've copied what's in joshuto.toml's preview area directly, and double checked it corresponds with the paths to the hook scripts.
Hi! Well, you could start with adding a line
date >> /tmp/on_shown_hook_called.log
at the top of your ~/.config/joshuto/on_preview_shown
.
Start Joshuto, move the cursor over some files that yield a text preview, and then check that the log-file has been created. Then just tail -f /tmp/on_shown_hook_called.log
in another terminal and move your cursor in Joshuto over some files to preview and check that the hook-script is called for each of them in the log output.
If that does work, remove that line from your hook script and put it into your wrapper-script on the top of your show_image
function and check if this function is called.
Let's think further once you're there.
You could also publish your dotfiles somewhere. If somebody has the time, he could have a look. Maybe you just missed the obvious. (Happens to me all the time...)
I just fixed what seems to be the same problem. Check that the size and position are set in on_preview_shown and if it still doesn't work check your preview_file for image/*) and point it towards your on_preview_shown. You can debug it with loads of echos like how DLFW suggested.
Hi there! I hope I'm overlooking something obvious. I'm using
joshuto-0.9.6
in alacritty in herbstluftwm on Void Linux kernel 6.6.16_1, and I'm unable to get either ueberzug or ueberzug++ to preview jpg or png images in X11. I compiled U++ with opencv on (just the default flags).I have
libsixel-1.10.3_1
andchafa-1.14.0_1
installed, as well asopencv4-4.6.0_6
,opencv-4.6.0_6
(also libopencv for both). Should I pick one instead of having both versions?I've tested each ueberzug using default configs for joshuto with the other removed (checking using
which ueberzug
) and I've tried just about every combination of options I can.j
, which is in my$PATH
, and~/.config/joshuto/on_preview_shown
&~/.config/joshuto/on_preview_shown
are all executable, and the lines:are under
[preview]
in joshuto.toml, under the default lines.Here is a log for ueberzug++ with default options, I'm exiting with q each time, and trying to preview a file in my home directory using the wrapper :
... with
--no-opencv
removed fromj
:... with
-o x11
.--no-opencv
is removed:... with
-o chafa
.--no-opencv
is removed:I suppose I'm getting the furthest on this last one, but it still doesn't preview. I have the terminal screen-sized.
I'm at a bit of a loss about what to try next. Is this a better issue for ueberzug++? Is there any more info I can provide that might be helpful?
Thanks a lot in advance, and thanks for this great program. I'm doing a fresh install of my OS -- I had it working one the last install with both U and U++, but I've done something wrong this time.