Code Monkey home page Code Monkey logo

vifmimg's People

Contributors

anuvyklack avatar eladyn avatar hieulw avatar narukeh avatar presfil avatar sdushantha avatar thimc avatar tornaxo7 avatar xaizek avatar yusufaktepe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vifmimg's Issues

Preview doesn't work and gets stuck "cannot create .cache/vifm/ueberzug-19287" on WSL2 Deb bash Tmux

Been referenced here from There and when I install the two scripts in '/bin' when running vifm with vifmrun and preview and image with ++w++ it seems to just freeze and not do anything after I press ++ctrl+c++ once it doe's manage to unfreeze but with the following error massage:
/usr/bin/vifmimg: 7: cannot create /home/pong/.cache/vifm/ueberzug-19287: Interrupted system call

and I've installed ueberzugpp with their Deb .sh script and
$ ueberzug layer -h Does seem to echo me output.

Any idea why this is and how to fix it?

Should it work in Windows?

cool work, i am trying to move here from Far Manager.
I am very new.
The question:
Should it work in Windows 7, other Windows version ?
I can try all the things to install, but better is to know is it supposed to work also in Windows somehow

Non-blocking image load

When going over multiple images which takes some time to load I loose control over vifm until the all images are loaded. For example if each image would take one second to load and I press j 10 times in a directory with images I have to wait 10 seconds before I gain control again. This does not happen in for example fzfimg. Any idea how one could handle the loading of images without blocking input to vifm?

Clear image from screen when :shell command is run

Would it be possible to clear the image preview from the screen when the user runs the :shell (or :sh) command? I have nnoremap cd :shell<CR> in my vifmrc so that I can easily change directories to whatever directory I happen to have open at the time in vifm. The problem comes from having an image preview open and running the command, as the image preview doesn't go away after going back to the shell prompt. The only ways to solve the problem are to either toggle the preview window visibility via :view before using :sh or going to something like a directory or text file which doesn't use Ueberzug.

Edit: I found a workaround to doing it. I just use the following remap:

nnoremap cd :!$XDG_CONFIG_HOME/vifm/scripts/vifmimg clear & $SHELL<CR>

Where XDG_CONFIG_HOME is ~/.config

For me don't work.

Xubuntu 22.04
Copied vifmimg and vifmrun in to ~/.local/bin map.
Added rights to files.

sudo chmod -R ~/.local/bin

In vifm added fileviewer code from the documentation.

    fileviewer *.pdf
        \ vifmimg pdf %px %py %pw %ph %c
        \ %pc
        \ vifmimg clear

    fileviewer *.djvu
        \ vifmimg djvu %px %py %pw %ph %c
        \ %pc
        \ vifmimg clear

    fileviewer *.epub
        \ vifmimg epub %px %py %pw %ph %c
        \ %pc
        \ vifmimg clear

    fileviewer <video/*>
        \ vifmimg video %px %py %pw %ph %c
        \ %pc
        \ vifmimg clear

    fileviewer <image/*>
        \ vifmimg draw %px %py %pw %ph %c
        \ %pc
        \ vifmimg clear

    fileviewer <audio/*>
        \ vifmimg audio %px %py %pw %ph %c
        \ %pc
        \ vifmimg clear

    fileviewer <font/*>
        \ vifmimg font %px %py %pw %ph %c
        \ %pc
        \ vifmimg clear

Installed ueberzurg from here

https://software.opensuse.org/download.html?project=home%3Ajustkidding&package=ueberzugpp

Added scripts to PATH in zshrc

LOCAL_BIN_SCRIPTS="/home/serii/.local/bin/:${PATH}"
CARGO="/home/serii/.cargo/bin/:$PATH"
PATH=$LOCAL_BIN_SCRIPTS:$CARGO
export PATH;

But image preview don't work.

Vifmimg as a filepicker

Vifmimg doesn't preview images when using it as filepicker for an internet browser using the command urxvt -e vifmrun --choose-file=picked_file. When running the command in terminal the pictures preview on the parent terminal and not on the terminal running vifm.

Pipe broken

When I preview images vifm freezes and image isn't displayed.
When run from terminal it outputs this:
/usr/bin/vifmrun: line 14: 16287 Broken pipe tail --follow "$FIFO_UEBERZUG" 16288 Illegal instruction (core dumped) | ueberzug layer --silent --parser bash 2>&1 > /dev/null
I have copied vifmrun and vifmimg to /usr/bin/ which is already in $PATH and run
chmod +x /usr/bin/vifmimg
chmod +x /usr/bin/vifmrun
Opened vifm by vifmrun.
Also I can see that pipe is created in ranger.

python-ueberzug 18.1.3-2, vifm 0.10-1
Shell: bash 5.0.7
Terminal: urxvt - happens on all others that I have tested
OS: Manjaro

Image preview covers popup menu

If I have :view enabled and try to delete an image, the popup is shown, but then the image redraws on top of it.

Example:
image

seebye/ueberzug is no longer maintained

Hi,

As many of you probably know, the author of Ueberzug, seebye has decided to stop maintaining Ueberzug because of various reasons that I won't go in to here. You're free to read that bit for yourself.

Until there is a maintained fork of Ueberzug, I will stop any development for vifmimg and lfimg as I don't want to maintain anything that relies on projects that no longer receives updates.

I hope that everyone here understands the situation and I just want to thank each and every one of you who contributed.

seebye/ueberzug: https://github.com/seebye/ueberzug/blob/master/README.md

Combine video preview with text-based mediainfo

Is it possible to display a text-based preview like the output of mediainfo under a video preview?

I’ve tried editing vifmrc the following way, but it makes vifm hang.

fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
        \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
        \ vifmimg videopreview %px %py %pw %ph %c
        \ %pc
        \ vifmimg clear; mediainfo

If I replace what’s after the list of extensions with \ echo "test"; mediainfo, the output of both commands appear as expected, so I wonder if I’m using an incorrect syntax or it’s a limitation.

Anomaly of display of the images

Hi,
I did the installation as indicated, and under Kitty, it works.

However, I noticed a little annoying dysfunction: when browsing the images, some of them are displayed very briefly (or not at all) and are replaced by a black rectangle, and then you have to go back to the image, sometimes several times, to get the display.

This anomaly apparently occurs randomly, and not necessarily on the same files or filetypes.

Is this problem known? Does it have a solution?

[Edit]. I just noticed it also works under gnome-terminal (I read somewhere it was not compatible with ueberzug), with the same anomaly and also another one : the image is not properly sized, nor centered in the right pane (it is placed randomly in the right pane, and its position depends on the size of the window).

Thanks

ueberzugpp stuck vifm with vifmimg

I'm following vifmimg setup ueberzugpp for vifm. I removed -p json in

ueberzug layer -s <"$FIFO_UEBERZUG" -p json &

since -p json is not supported. I changed to max_width and max_height follow ueberzugpp suggestion.

When I open a pdf file, their is a thumbnail picture created in cache directory, which proof the other part works fine, but it the image do not shows up in vifm, and the vifm stucked. When I open a image, their also no image shows up, and the vifm also stucked.

I need help to setup ueberzugpp using vifm. Refer Not work in vifm and ueberzugpp stuck vifm

Test environment

system: ubuntu server 20.04
terminal: alacritty
vifm:

Version: 0.12.1
Git info: built out of repository
Compiled at: Feb 20 2023 13:53:33

Support of extended keys is on
Parsing of .desktop files is enabled
With GTK+ library
Without magic library
With X11 library
With dynamic loading of X11 library
With file program
With -n option for cp and mv
With remote command execution

[Bug] draw SVG & [Feature] combine with Identify header

[Bug] SVG

For me the image() function can't handle SVG files without conversion.

In vifmimg, I added an "svg" case which passes by a png conversion.

        "draw")
			FILE="$PWD/$6"
			image "$1" "$2" "$3" "$4" "$5" "$FILE"
			;;
        "svg")
			[ ! -f "$PCACHE" ] && \
				convert -background none "$6" "${PCACHE}.png"
			image "$1" "$2" "$3" "$4" "$5" "${PCACHE}.png"
			;;

In vifmrc:

" Images & SVG
filextype {*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm,*.ico,*.tif,*.svg},<image/*> {View in qimgv} qimgv %f,
fileviewer <image/svg\+xml> $HOME/.config/vifm/scripts/vifmimg svg %px %py %pw %ph %c %pc $HOME/.config/vifm/scripts/vifmimg clear
fileviewer <image/*> $HOME/.config/vifm/scripts/vifmimg draw %px %py %pw %ph %c %pc $HOME/.config/vifm/scripts/vifmimg clear

[Feature] Identify header for images

I wanted to combine the display of images and the output of "identify" as header.

In vifmimg, I added a new function image_margin_top() with a top margin of 2 Lines:

image_margin_top() {
		printf '{"action": "add", "identifier": "vifm-preview", "x": "%s", "y": "%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' "$2" "$(( $3 + 2 ))" "$4" "$(( $5 - 2 ))" "$6" > "$FIFO_UEBERZUG"
}

I modifies "draw" & "svg" cases to use this function and then call identify:

        "draw")
			FILE="$PWD/$6"
			image_margin_top "$1" "$2" "$3" "$4" "$5" "$FILE"
			identify "$FILE" | awk '{print $2,$3,$4,$5,$6,$7}'
			;;
        "svg")
			[ ! -f "$PCACHE" ] && \
				convert -background none "$6" "${PCACHE}.png"
			image_margin_top "$1" "$2" "$3" "$4" "$5" "${PCACHE}.png"
			identify "$PWD/$6" | awk '{print $2,$3,$4,$5,$6,$7}'
			;;

Example:

image

Add ability to cache the preview

Creating the preview might take some time for some some files and this slows down vifm when you are navigating through your files.
Would it be possible to create a directory in ~/.cache where vifmimg could store it's previews so that when vifmimg is trying to show a preview of file that it has made a preview of in the past, it can simply just use the image from the ~/.cache?

This is just a thought, let me know what you think :)

python38-python-xlib is needed

Thank you for your work.

It is not an issue of yours
... but, since i do not see 'issues' in https://github.com/seebye/ueberzug site and since many users will try your Code, here is my experience.
I fresh installed opensuse tubleweed, copying my old 'home' partition in it. I used vifm with w3mimgdisplay that worked ok once. I noticed that it is not working anymore, not in my fresh install nor in my old system (probably some update broke it). I decided to try 'ueberzug'. I 'pip installed' it as normal user. I tried the bash example in seebye's site and it didn't worked complaining about Xlib error not having permission to open display. Of course neither your code was working.
Despite the 'drop python-xlib' of setup.py that mentions the site, I installed the python38-python-xlib package, since fresh install on opensuse tubleweed uses python38 at the present. After that installation your 'Code' works flawlessly.
Probably the pip is not updated with resent code of seebye's work, or i should activate python39 before pip install ueberzug. I do not know. The fact is that a rolling distribution like tubleweed that has python38 as default can not use ueberzug and consequently your code out of the box. So,
python38-python-xlib is needed.

preview not showing but cache generating

I recently formated my system (mx linux 19.4 which is debian 10 buster based). Before formatting I had previews without no problem. Now, they all stopped working. I have installed all dependencies and made a minimal vifmrc with just fileviewer options. But still nothing is working. The thumbnails for pdf files are being generated in .cache/vifm but not showing in preview window.

vifmimg freezes when used with vifm inside tmux

I have the latest vifmimg scripts installed from the repository with make install and use the recommend configuration in my vifmrc. ueberzug version is 18.1.9 and my system is running Gentoo.
When I invoke vifm inside tmux with vifmrun and scroll to a file which is supported by vifmimg the terminal freezes and I can't do anything anymore. Only killing vifm helps. The terminal is kitty btw. but the same happens with alacritty ...

Doing the same outside tmux is no problem at all. How can I configure vifmimg that it at least throws an error message and let's me continue working?

/usr/bin/vifmimg: line 56 :: No such file or directory

When I try to image preview in vifm it says that the file or directory doesn't exist. I have put both vifmimg and vifmrun in /usr/bin and made them executable through sudo chmod 777. Any way to fix this? Also I'm using Manjaro if that helps.

Clearing preview for menus or dropping to shell

This script is great and I really appreciate your sharing it. Would have taken me weeks or months to cludge my way through getting something like this working (might have been beyond my abilities entirely, in fact). So thanks again, cheers!

Only hitch left on my path to vifm nirvana is that active previews cover vifm's menus (for example the sort menu 'S') such that I need to move off any previewable filetype in order to be able to see the menu properly. Corollary to this, the preview also sticks around if I drop to shell (with 's') covering some portion of the terminal. There doesn't seem to be any way to clear this. I understand this is just how ueberzug (or hacking image view into term at all) works, that it just covers the area specified and you don't get any kind of z-level control … but it would be great if I could maybe map a hotkey or something to blank/clear the preview manually? Hate to bother you with my ignorance, but I'm simply not savvy enough to know where to start with something like that and it might be a feature someone else would appreciate also.

vifmimg: line 11: No such file or directory

I am using the latest scripts and ran make install. I am using vifmrun to start vifm. This happends for both images and pdf. What can be the reason and how can I fix this?. Error shows like this

vifm consistently crashing after closing background process error popup

I can consistently make it crash by doing the following:

1. Open vifm using vifmrun, as per instructions
2. :view
3. Position cursor over a video file
4. Open the video using l (or right arrow key) (builtin mapping)
5. Close the video
6. Close the background process error popup either via <CR> or Esc or <C-C>
7. Crash

Minimal vifmrc:

fileviewer <video/*>
    \ vifmimg video %px %py %pw %ph %c
    \ %pc
    \ vifmimg clear

filetype <video/*> mpv %c &

I don't see if there are any logs, and I'm not certain how to run it all under gdb.

vifm hangs

Hi, thanks for the script.
I have a problem with the script that results in files not being previewed.

/home/baitinq/.config/vifm/scripts/vifmrun: line 1: 4224 Broken pipe tail --follow "$FIFO_UEBERZUG" 4225 Segmentation fault (core dumped) | ueberzug layer --silent --parser bash 2>&1 > /dev/null /home/baitinq/.config/vifm/scripts/vifmrun: line 4: 5581 Hangup vifm

Do you have any idea why this could be caused and any possible solutions?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.