jstkdng / ueberzugpp Goto Github PK
View Code? Open in Web Editor NEWDrop in replacement for ueberzug written in C++
License: GNU General Public License v3.0
Drop in replacement for ueberzug written in C++
License: GNU General Public License v3.0
i would like to get some help on how i could simply display an image in the terminal, by specifying its position, something that was done in Luke Smith's video using the original ueberzug:
#!/bin/bash
source "`ueberzug library`"
ImageLayer 0< <(
ImageLayer::add [identifier]="example0" [x]="$2" [y]="$3" [max_width]="$5" [max_height]="$4" [path]="$1"
read
)
Currently the -h command is a bit unintuitive, there is no mention of
ueberzug layer -h, tmux -h or cmd -h, commands which I only found by looking at this git repo.
The help menu for tmux -h or cmd -h are pretty bare as well.
I'd be willing to add more information to the -h commands(Though I personally don't find SUBCOMMAND -h intuitive) and I would also be willing to write up a manpage if given some direction on where to look.
i successfully compiled ueberzug on manjaro,
but when i run it, it gives out these errors!
unable to load "/usr/lib/vips-modules-8.14/vips-poppler.so" -- libpoppler-glib.so.8: cannot open shared object file: No such file or directory
(process:55262): VIPS-WARNING **: 11:14:11.063: unable to load "/usr/lib/vips-modules-8.14/vips-openslide.so" -- libopenslide.so.0: cannot open shared object file: No such file or directory
I installed the AUR package then I ran ueberzug layer
command and entered the following input:
{"action": "add", "x": 0, "y": 0, "path": "/home/mahor/a.jpg"}
But I'm not successful displaying the a.jpg
picture. I'm getting this output:
{"action":"add","path":"/home/mahor/a.jpg","x":0,"y":0}
terminate called after throwing an instance of 'nlohmann::json_abi_v3_11_2::detail::type_error'
what(): [json.exception.type_error.302] type must be number, but is null
[1] 185831 IOT instruction (core dumped) ueberzug layer
I tried the same input with ueberzug
and it worked fine.
First off, let me thank you for this tool. I wish you luck with the future development of it.
I have two questions, both regarding transparency. I am using st terminal with alpha patch installed (picom dependent).
Is there a way to prevent ueberzug++ from painting black parts of the terminal that are not used for rendering of the image?
Is it possible and if so then do you plan to add support for transparent images, e.g. PNG with alpha channel?
The Tux image I've used could be found here.
Hi!
I tried to install your program via your AUR package and this is the error I've got:
/usr/bin/ld: warning: libavcodec.so.60, needed by /usr/lib/libopencv_videoio.so.4.7.0, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libavformat.so.60, needed by /usr/lib/libopencv_videoio.so.4.7.0, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libavutil.so.58, needed by /usr/lib/libopencv_videoio.so.4.7.0, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libswscale.so.7, needed by /usr/lib/libopencv_videoio.so.4.7.0, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/lib/libopencv_videoio.so.4.7.0: undefined reference to `av_codec_is_decoder@LIBAVCODEC_60'
/usr/bin/ld: /usr/lib/libopencv_videoio.so.4.7.0: undefined reference to `av_write_trailer@LIBAVFORMAT_60'
/usr/bin/ld: /usr/lib/libopencv_videoio.so.4.7.0: undefined reference to `av_hwdevice_find_type_by_name@LIBAVUTIL_58'
/usr/bin/ld: /usr/lib/libopencv_videoio.so.4.7.0: undefined reference to `av_hwframe_constraints_free@LIBAVUTIL_58'
/usr/bin/ld: /usr/lib/libopencv_videoio.so.4.7.0: undefined reference to `avcodec_parameters_copy@LIBAVCODEC_60'
...
I assume your PKGBUILD misses some dependency.
swayimg has support for SwayWM and Hyperland, it works somewhat like an Xorg borderless window (even though you can still select it and move it about), ytfzf already support it, it can help support Tmux on Wayland
I see a <zmq.hpp>
as an #include in application.cpp
but don't have that file in a recent clone.
Long term user of
https://github.com/gokcehan/lf/tree/c0c85f206fbd5011c10cc839ced94acb444a1b9a
with
https://github.com/slavistan/howto-lf-image-previews
any easy way to implement ueberzugpp as a replacement?
Building the project from source, I've found that src/canvas/x11/x11.hpp
is missing the include for <thread>
. Otherwise the build works fine.
On another note, some dependencies could also be included using FetchContent
. This would avoid the need to install all dependencies manually beforehand. For example the cli11
lib is not available in the stable Debian package index, so I included it like this instead:
include(FetchContent)
FetchContent_Declare(
cli11
GIT_REPOSITORY https://github.com/CLIUtils/CLI11
GIT_TAG v2.2.0
)
FetchContent_MakeAvailable(cli11)
I'm curious about this bug, is it sourced from ytfzf or from ueberzugpp, ueberzug preview thumbnail for ytfzf only loads once and when selecting another video the thumbnail doesn't load.
and when i quit ytfzf that thumbnail don't disappear in the terminal.
sorry in advance because I'm also not very familiar with the code, maybe you can give some input, however this tool is awesome
fzf --preview='ueberzugpp cmd -s $SOCKET -i fzfpreview -a add -x $X -y 1 --max-height $FZF_PREVIEW_COLUMNS --max-height $FZF_PREVIEW_LINES -f {}' --reverse "$@"
It seems that there need to replace one --max-height
with --max-width
to get the script work,
so
fzf --preview='ueberzugpp cmd -s $SOCKET -i fzfpreview -a add -x $X -y 1 --max-width $FZF_PREVIEW_COLUMNS --max-height $FZF_PREVIEW_LINES -f {}' --reverse "$@"
Anyway, thanks for writing this tool
Getting the following error when building c9478aa:
[ 244s] [15/17] Building CXX object CMakeFiles/ueberzug.dir/src/application.cpp.o
[ 244s] FAILED: CMakeFiles/ueberzug.dir/src/application.cpp.o
[ 244s] /usr/bin/c++ -DFMT_SHARED -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -I/home/abuild/rpmbuild/BUILD/ueberzugpp-2.5.0+git20230305.c9478aa/include -I/home/abuild/rpmbuild/BUILD/ueberzugpp-2.5.0+git20230305.c9478aa/build/release -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -isystem /usr/include/libmount -isystem /usr/include/blkid -isystem /usr/include/libgsf-1 -isystem /usr/include/libxml2 -isystem /usr/include/orc-0.4 -isystem /usr/include/OpenEXR -isystem /usr/include/Imath -isystem /usr/include/openjpeg-2.5
-isystem /usr/include/librsvg-2.0 -isystem /usr/include/gdk-pixbuf-2.0 -isystem /usr/include/libpng16 -isystem /usr/include/cairo -isystem /usr/include/pixman-1 -isystem /usr/include/freetype2 -isystem /usr/include/cfitsio -isystem /usr/include/pango-1.0 -isystem /usr/include/harfbuzz -isystem /usr/include/fribidi -isystem /usr/include/botan-2 -isystem /usr/include/pgm-5.2 -g -pthread -std=gnu++20 -MD -MT CMakeFiles/ueberzug.dir/src/application.cpp.o -MF CMakeFiles/ueberzug.dir/src/application.cpp.o.d -o CMakeFiles/ueberzug.dir/src/application.cpp.o -c /home/abuild/rpmbuild/BUILD/ueberzugpp-2.5.0+git20230305.c9478aa/src/application.cpp
[ 244s] /home/abuild/rpmbuild/BUILD/ueberzugpp-2.5.0+git20230305.c9478aa/src/application.cpp: In member function 'void Application::handle_tmux_hook(const std::string&)':
[ 244s] /home/abuild/rpmbuild/BUILD/ueberzugpp-2.5.0+git20230305.c9478aa/src/application.cpp:101:27: error: no matching function for call to 'Dimensions::reload(int, int)'
[ 244s] 101 | dimensions->reload(terminal.width_pixels(), terminal.height_pixels());
[ 244s] | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 244s] In file included from /home/abuild/rpmbuild/BUILD/ueberzugpp-2.5.0+git20230305.c9478aa/include/image.hpp:25,
[ 244s] from /home/abuild/rpmbuild/BUILD/ueberzugpp-2.5.0+git20230305.c9478aa/include/application.hpp:20,
[ 244s] from /home/abuild/rpmbuild/BUILD/ueberzugpp-2.5.0+git20230305.c9478aa/src/application.cpp:17:
[ 244s] /home/abuild/rpmbuild/BUILD/ueberzugpp-2.5.0+git20230305.c9478aa/include/dimensions.hpp:28:10: note: candidate: 'void Dimensions::reload()'
[ 244s] 28 | void reload();
[ 244s] | ^~~~~~
[ 244s] /home/abuild/rpmbuild/BUILD/ueberzugpp-2.5.0+git20230305.c9478aa/include/dimensions.hpp:28:10: note: candidate expects 0 arguments, 2 provided
[ 247s] [16/17] Building CXX object CMakeFiles/ueberzug.dir/src/main.cpp.o
[ 247s] ninja: build stopped: subcommand failed.
If I clear out the two int items in application.cpp:101, it builds - no idea on the implications of that though 😉
647a965 builds fine.
cmake -DCMAKE_BUILD_TYPE=Release ..
works fine, but cmake --build .
gives the error message below. I don't even use Sway (I'm on Pop!_OS 22.04).
/tmp/ueberzugpp/src/canvas.cpp: In static member function ‘static std::unique_ptr<Canvas> Canvas::create()’:
/tmp/ueberzugpp/src/canvas.cpp:53:33: error: ‘SwayCanvas’ was not declared in this scope; did you mean ‘Canvas’?
53 | return std::make_unique<SwayCanvas>();
| ^~~~~~~~~~
| Canvas
/tmp/ueberzugpp/src/canvas.cpp:53:44: error: no matching function for call to ‘make_unique<<expression error> >()’
53 | return std::make_unique<SwayCanvas>();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/11/memory:76,
from /tmp/ueberzugpp/include/image.hpp:20,
from /tmp/ueberzugpp/include/canvas.hpp:20,
from /tmp/ueberzugpp/src/canvas.cpp:17:
/usr/include/c++/11/bits/unique_ptr.h:961:5: note: candidate: ‘template<class _Tp, class ... _Args> typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...)’
961 | make_unique(_Args&&... __args)
| ^~~~~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:961:5: note: template argument deduction/substitution failed:
/tmp/ueberzugpp/src/canvas.cpp:53:44: error: template argument 1 is invalid
53 | return std::make_unique<SwayCanvas>();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/11/memory:76,
from /tmp/ueberzugpp/include/image.hpp:20,
from /tmp/ueberzugpp/include/canvas.hpp:20,
from /tmp/ueberzugpp/src/canvas.cpp:17:
/usr/include/c++/11/bits/unique_ptr.h:967:5: note: candidate: ‘template<class _Tp> typename std::_MakeUniq<_Tp>::__array std::make_unique(std::size_t)’
967 | make_unique(size_t __num)
| ^~~~~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:967:5: note: template argument deduction/substitution failed:
/tmp/ueberzugpp/src/canvas.cpp:53:44: error: template argument 1 is invalid
53 | return std::make_unique<SwayCanvas>();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/11/memory:76,
from /tmp/ueberzugpp/include/image.hpp:20,
from /tmp/ueberzugpp/include/canvas.hpp:20,
from /tmp/ueberzugpp/src/canvas.cpp:17:
/usr/include/c++/11/bits/unique_ptr.h:973:5: note: candidate: ‘template<class _Tp, class ... _Args> typename std::_MakeUniq<_Tp>::__invalid_type std::make_unique(_Args&& ...)’ (deleted)
973 | make_unique(_Args&&...) = delete;
| ^~~~~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:973:5: note: template argument deduction/substitution failed:
/tmp/ueberzugpp/src/canvas.cpp:53:44: error: template argument 1 is invalid
53 | return std::make_unique<SwayCanvas>();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
gmake[2]: *** [CMakeFiles/ueberzug.dir/build.make:258: CMakeFiles/ueberzug.dir/src/canvas.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:222: CMakeFiles/ueberzug.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2
I discovered Ueberzug as a dependency for the Termusic player, but as I'm using Wayland sessions, I could unfortunately discover it doesn't work in many cases I'll list below. This sometimes trigger an error message, sometimes not depending on the cases.
From what I read to some places, it looks like it's currently (or actually the python project was, but this one is supposed to work pretty much the same way from what I understand) pretty tied to Xorg, and therefore bound to issues with Wayland.
On a Wayland session, I could indeed see that it doesn't work within Alacritty, nor does it in Gnome's new Console
. I didn't checked the old gnome-terminal
, but I guess the same issue is to be expected.
For some reason I can't explain (and I would be really curious about it), Wezterm manage to have ueberzug to work even when ran as a Wayland program (I could check it wasn't from XWayland).
Another case to consider is the one of terminal multiplexers: even in a working terminal such as Wezterm, tmux or zellij for example could be verified as having the album art not working, despite it seemed to show no error.
Target "ueberzug" links to target "X11::xcb" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?
libx11-xcb-dev
already installed.
Test system: Ubuntu 20.04 server
(this has nothing to do with the slowness bug)
I following vifmimg setup ueberzug for vifm. remove -p json
in https://github.com/thimc/vifmimg/blob/6e4c562c302405c27f0de7c5c1a335ce1a5765e2/vifmrun#L16
since -p json is not supported.
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.
system: ubuntu server 20.04
terminal: alacritty
vifm: v0.12.1
I am not 100% sure this is an ueberzugpp issue, but I think it is.
I switched over to kitty a few months ago since ueberzug died, and now kitty is having some integration issues with vifm preview in the latest versions. I found your fork and was super excited since I enjoy tmux more than kitty. I did however find an issue, if this is not an ueberzug issue, please let me know..
I am using tmux for an essentially tabbed window, however, when i switch 'windows' on tmux, the image overlay remains
see attached
i know that when the original version of ueberzug was working, it cleared the image on change of the screen/terminal.
any advice or suggestions would be appreciated!
also, thank you so much for taking the torch on!
in ranger, it's reasonably fast.
in lobster, it's annoyingly slower and it seams to be fine on a fast machine.
most likely, it's a bug in ueberzugpp
This could be a cousin of the previous bug. An other synchronization issue. #54
I have installed vips but I get this error I'm probably doing something wrong but I'm not sure what it is:
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_X11=OFF -DENABLE_OPENCV=OFF ..
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found OpenSSL: /opt/homebrew/opt/openssl/lib/libcrypto.dylib (found version "3.1.0")
-- Build spdlog: 1.11.0
-- Build type: Release
-- Checking for module 'vips-cpp'
-- Found vips-cpp, version 8.14.2
-- Checking for module 'libsixel'
-- Found libsixel, version 1.10.3
-- Checking for module 'libzmq'
-- Found libzmq, version 4.3.4
-- Configuring done (4.3s)
CMake Error in CMakeLists.txt:
Imported target "PkgConfig::VIPS" includes non-existent path
"/usr/include"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
CMake Error in CMakeLists.txt:
Imported target "PkgConfig::VIPS" includes non-existent path
"/usr/include"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
I have:
which vips 4s
/opt/homebrew/bin/vips
pkg-config --list-all | grep vips
vips-cpp vips-cpp - C++ API for vips8 image processing library
vips vips - Image processing library
after running this build command on mac : cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 ..
, i get the following error:
CMake Error at CMakeLists.txt:39 (find_package):
By not providing "FindTBB.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "TBB", but
CMake did not find one.
Could not find a package configuration file provided by "TBB" with any of
the following names:
TBBConfig.cmake
tbb-config.cmake
Add the installation prefix of "TBB" to CMAKE_PREFIX_PATH or set "TBB_DIR"
to a directory containing one of the above files. If "TBB" provides a
separate development package or SDK, be sure it has been installed.`
The code currently assumes that status bar is at the bottom, but that's not always so. It can also take multiple lines (not my case, but should probably be handled as well).
tmux display -p '#{status},#{status-position}'
can be used to determine whether the status bar is enabled, at the top and also its height.
Not clear where the problem is. But since about 2 days I have a black preview image for all images in lf using uebrzugpp and ctpv
works fine with the old ueberzug method. But it quickly brakes with the new ueberzugpp method. Tested on Debian 11 64bits.
+ choice=
+ ueberzugpp cmd -s /tmp/ueberzugpp-21889.socket -a exit
terminate called after throwing an instance of 'std::system_error'
what(): Connection refused
Aborted
the config bypasses the issue.
{
"layer": {
"no-opencv":true
}
}
Terminals can do various strange things that ueberzugpp can't detect. Like tabs, or splitting tabs in new windows etc.... Then you are left with a ueberzugpp window floating at some odd place.
It would be nice, if we could close ueberzugpp window with an optional little red X on a corner.
This is Larry Hao from Termusic, I met several problem during the process of replacing ueberzug with ueberzugpp.
[2023-03-29 10:42:12.476] [main] [info] TERM="xterm-256color", TERM_PROGRAM="", OUTPUT="x11"
[2023-03-29 10:42:12.477] [main] [info] Listenning for commands on socket /tmp/ueberzugpp-27997.socket.
[2023-03-29 10:42:12.629] [main] [info] Command received: {"action":"remove","identifier":"cover"}
[2023-03-29 10:42:12.629] [main] [info] Removing image.
[2023-03-29 10:42:12.629] [main] [info] Command received: {"action":"add","height":17,"identifier":"cover","path":"/home/tramhao/.cache/termusic/termusic_cover.jpg","scaler":"forced_cover","width":35,"x":104,"y":14}
[2023-03-29 10:42:12.632] [main] [info] Image is not cached. Loading with opencv.
[2023-03-29 10:42:14.963] [main] [info] Command received: {"action":"remove","identifier":"cover"}
[2023-03-29 10:42:14.964] [main] [info] Removing image.
[2023-03-29 10:42:15.061] [main] [info] Command received: {"action":"add","height":17,"identifier":"cover","path":"/home/tramhao/.cache/termusic/termusic_cover.jpg","scaler":"forced_cover","width":35,"x":104,"y":14}
[2023-03-29 10:42:15.062] [main] [info] Image is not cached. Loading with opencv.
Is it because opencv is not loading it correctly?
Thanks so much for your help!
can we get a package for debian and ubuntu please?
if you don't want to deal with this, i could make those myself if that's alright, however i have no experience with creating packages for those distributions
I'm having an issue with previewing PDFs using Sixel on LF (without Sixel it works fine), if in the directory there is no file in PDF format then it will work fine.
the image preview renders fine but it will overwrite with other images when viewing previews of other formats, and if you continue to force navigation for previews then the LF container will be overwritten by logs.
testing materials:
TE = alacrritty (sixel version)
utility = LF (sixel version)
here is my LF preview config
when i do so it gives me this error:
terminate called after throwing an instance of 'std::runtime_error'
what(): UNABLE TO CALCULATE TERMINAL SIZES
I have build it from source with this:
git clone https://github.com/jstkdng/ueberzugpp.git
cd ueberzugpp
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_X11=OFF -DENABLE_OPENCV=OFF ..
cmake --build .
and I tried to use the json in the readme file:
mkfifo fifo
fifo=$(realpath fifo )
ueberzug layer <"$fifo" -p json &
echo '{"action":"add","identifier":"preview","max_height":50,"max_width":50,"path":"/home/name/pic/wallpaper/map.jpg","x":0,"y":0}' > fifo
it gave me this response:
terminate called after throwing an instance of 'std::runtime_error'
what(): UNABLE TO CALCULATE TERMINAL SIZES
[1] + IOT instruction ueberzug layer < "$fifo"
Thanks for your efforts.
I believe the author of ueberzug had very clear and sincerely good reasons to put the project to rest. From the README:
it was thought to help during the time in which these protocols are supported to rarely.
...
Such an tool may also increase the adoption time of these image protocols which is why I suggest not to fork this project,
but to move to one of the terminal emulators which have image support.
The sudden absence of ueberzug might seems harsh on project already depending on it but it's for the better. The earlier those projects move on to well-established protocols (rather than "hacks"), the better. This will also encourage terminal emulator developers to adopt and implement these protocols.
If this project goes on, I fear the efforts and intentions of ueberzug's author will all come to nought. I hate to be that dude that tells someone to stop a project they feel they should work on but please, think about the implications.
Thank you.
I want to try build on Debian 11 Stable:
when i use command: cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_X11=ON -DENABLE_OPENCV=OFF ..
get error message:
CMake Error at CMakeLists.txt:39 (find_package):
By not providing "Findcppzmq.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "cppzmq", but
CMake did not find one.
I use Joshuto file manager. It provides instructions to preview with ueberzug.
I rewrote the scripts to use ueberzugpp with the socket and the binary's cmd input, it works, but when I loop fast between pictures, ueberzugpp stop displaying anything.
After the bug, "add" commands and "Loading image" are still logged but it does not display any picture and there is no anymore "remove" commands logged.
It may be a problem with the way that Joshuto use hook scripts to deal with add/remove actions and I can open an issue there but I wanted to check with you first.
Wrapper script (without --no-cache):
#!/usr/bin/env bash
set -o noclobber -o noglob -o nounset -o pipefail
export LC_ALL="C.UTF-8"
export TZ=:/etc/localtime
if [[ -n "${DISPLAY}" ]] && command -v ueberzugpp > /dev/null; then
export _UB_ID="${$}"
export _UB_TMP="$(mktemp -d -t ueberzugpp-${_UB_ID}-XXXXXX)"
export _UB_PID_FILE="${_UB_TMP}/$(uuidgen)"
function stop_ueberzugpp {
ueberzugpp cmd -s "${_UB_SOCKET}" -a exit
rm -Rf "$_UB_TMP" "$_UB_SOCKET"
}
ueberzugpp layer --no-stdin --silent --use-escape-codes --output x11 --pid-file "${_UB_PID_FILE}"
export _UB_PID=$(cat "${_UB_PID_FILE}")
export _UB_SOCKET=/tmp/ueberzugpp-${_UB_PID}.socket
trap stop_ueberzugpp EXIT QUIT INT TERM
fi
joshuto "$@"
exit ${?}
Hook : on_preview_shown:
#!/usr/bin/env bash
if [[ -S "$_UB_SOCKET" ]]; then
_MIMETYPE=$(file --mime-type -Lb "${1}")
case "${_MIMETYPE}" in
image/*)
ueberzugpp cmd -s "${_UB_SOCKET}" -i preview -a add \
-x ${2} -y $(( ${3} + 3 )) \
--max-width ${4} --max-height $(( ${5} - 3 )) \
-f "${1}" ;;
*)
exit 1 ;;
esac
else
exit 1
fi
Hook : on_preview_removed:
#!/usr/bin/env bash
if [[ -S "$_UB_SOCKET" ]]; then
ueberzugpp cmd -s "${_UB_SOCKET}" -i preview -a remove
else
exit 1
fi
Modified mimetype case in preview_file.sh:
## Image
image/*)
exiftool "${FILE_PATH}" | grep -E '^Image Size|^Image Size|^File Type\s\s' | awk '{print $1,$2,$3,$4}' && exit 0
exit 4 ;;
Since automated build systems (generally) wouldn't reach out to the internet, this isn't working:
[ 99s] [1/9] Creating directories for 'gsl-populate'
[ 99s] [1/9] Performing download step (download, verify and extract) for 'gsl-populate'
[ 99s] dst='/home/abuild/rpmbuild/BUILD/ueberzugpp-2.8.2+git20230513.804060e/build/release/_deps/gsl-subbuild/gsl-populate-prefix/src/v4.0.0.tar.gz'
[ 99s] -- Using src='https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz'
[ 99s] -- Using src='https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz'
[ 99s] -- Using src='https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz'
[ 99s] -- Using src='https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz'
[ 99s] -- Using src='https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz'
[ 99s] -- Using src='https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz'
[ 99s] CMake Error at gsl-subbuild/gsl-populate-prefix/src/gsl-populate-stamp/download-gsl-populate.cmake:170 (message):
[ 99s] error: downloading 'https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz' failed
[ 99s] error: downloading 'https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz' failed
[ 99s] error: downloading 'https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz' failed
[ 99s] error: downloading 'https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz' failed
[ 99s] error: downloading 'https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz' failed
[ 99s] error: downloading 'https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz' failed
[ 99s] FAILED: gsl-populate-prefix/src/gsl-populate-stamp/gsl-populate-download /home/abuild/rpmbuild/BUILD/ueberzugpp-2.8.2+git20230513.804060e/build/release/_deps/gsl-subbuild/gsl-populate-prefix/src/gsl-populate-stamp/gsl-populate-download
[ 99s] cd /home/abuild/rpmbuild/BUILD/ueberzugpp-2.8.2+git20230513.804060e/build/release/_deps && /usr/bin/cmake -P /home/abuild/rpmbuild/BUILD/ueberzugpp-2.8.2+git20230513.804060e/build/release/_deps/gsl-subbuild/gsl-populate-prefix/src/gsl-populate-stamp/download-gsl-populate.cmake && /usr/bin/cmake -P /home/abuild/rpmbuild/BUILD/ueberzugpp-2.8.2+git20230513.804060e/build/release/_deps/gsl-subbuild/gsl-populate-prefix/src/gsl-populate-stamp/verify-gsl-populate.cmake && /usr/bin/cmake -P /home/abuild/rpmbuild/BUILD/ueberzugpp-2.8.2+git20230513.804060e/build/release/_deps/gsl-subbuild/gsl-populate-prefix/src/gsl-populate-stamp/extract-gsl-populate.cmake && /usr/bin/cmake -E touch /home/abuild/rpmbuild/BUILD/ueberzugpp-2.8.2+git20230513.804060e/build/release/_deps/gsl-subbuild/gsl-populate-prefix/src/gsl-populate-stamp/gsl-populate-download
I'm not sure what this is and/or if it can be provided by an existing package.
Is there a flag to disable this or any more info on what it provides?
how should i config to use windows terminal with wsl2? my wslg is archlinux ,i had "yay -S install ueberzugpp "
but can not preivew my image in ranger when i set "set preview_images true,
set preview_images_method ueberzug" , any alse should i to set?
error
"terminate called after throwing an instance of 'std::runtime_error'
what(): UNABLE TO CALCULATE TERMINAL SIZES
fish: Job 1, 'ueberzugpp layer' terminated by signal SIGABRT (Abort)"
when i cod " ueberzugpp layer"
Fewer dependencies is nice, but...
v2.8.4:
ueberzug layer < /dev/null
# ueberzugpp exits
v2.8.5:
ueberzug layer < /dev/null
# ueberzugpp consumes 100% of a CPU
Also first command sent to stdin
seems to be ignored, but I don't know if that's related, might be a separate issue. The issue with the hang is that if stdin
source is closed or has nothing, ueberzug
still tries to read from it.
In this example, I use groups for my windows, and the problem is that with the wayland
image output method, the window stays on top, no matter what. There were also other cases where similar unwanted (for me) behavior happened, but I could not reproduce it yet. I am unsure whether I should report this here or maybe on the hyprland repo. I am also unsure whether this is within the scope of this project.
I am using Hyprland with kitty and lf (with integration script given by you), Ueberzugpp(aur version) seems to display images fine in normal terminal size, but whenever I open another terminal in tiling on the side of current terminal the image misplaces itself.
as you can see in the image the as soon as the new terminal(empty terminal on the left) is opened the image misplaced itself to some weird location instead of staying on its correct place in the right terminal with lf.
this also happens whenever I switch to floating mode of terminal or try to resize the terminal in anyway and it happens in all of the terminals ( I also tried it in foot and alacritty)
This does not happens in xorg window managers like bspwm.
Trying to build gives the following error on me. I am using fedora 37. I don't know anything about building a C package. Sorry if that's a simple error to fix. i just wanted to share the error i got so that it will be helpful for beginners who are getting similar errors as me.
CMake Error at CMakeLists.txt:39 (find_package):
By not providing "FindTBB.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "TBB", but
CMake did not find one.
Could not find a package configuration file provided by "TBB" with any of
the following names:
TBBConfig.cmake
tbb-config.cmake
Add the installation prefix of "TBB" to CMAKE_PREFIX_PATH or set "TBB_DIR"
to a directory containing one of the above files. If "TBB" provides a
separate development package or SDK, be sure it has been installed.
in the example fzfub script, the following error shows up when running it:
The following arguments were not expected: /tmp/.97473D95-EBC3-48D1-82BA-E35BB1BFF4CF --pid-file
this is on version 2.8.0 of ueberzugpp, installed with homebrew
I tried replacing ueberzug with ueberzugpp, and every other program (e.g. ranger, ncmpcpp-ueberzug) is working as expected, but tmux is displaying messages in only two windows blocking the windows. When switching back to ueberzug the messages disappears.
Os: Arch 6.1.26-1-lts
tmux: 3.3a
ueberzugpp: 2.8.2
i am trying to setup image preview in lf using ueberzugpp on wayland, however i cannot get it to work. i copied all the 3 files in the lf
directory provided by this repository: cleaner, previewer and lfub, however images just don't show up (other previews seem to work fine)
this is my lfrc:
set previewer ~/.config/lf/preview
set cleaner ~/.config/lf/cleaner
set drawbox
i am not sure what to try next
When using programs like ranger and ytfzf that display image previews, they don't display the images in the correct position when terminal padding is enabled. I have tested this with both ranger and ytfzf in the alacritty, st, and kitty terminals. It displays the image as if no padding was applied to the terminal, meaning the text is offset and everything looks weird. This issue doesn't happen with normal ueberzug.
Just curious if this is going to be a mainstay? Only because most build environments (like https://build.opensuse.org) can't download additional source @ build time via the internet. It would be possible to get those sources ahead of time and include them in the build, but I don't want to dissect CMakeLists.txt
to attempt to make that work if it's not something for the long term (a la "test fetchcontent").
it says to run --help but there is nothing there to help, test on st
and kitty
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.