ueberzug | command line util which allows to display images | Command Line Interface library
kandi X-RAY | ueberzug Summary
kandi X-RAY | ueberzug Summary
ueberzug is a command line util which allows to display images in combination with X11
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Setup tmux hooks
- Send signal to target process
- Returns True if two PIDs are the same
- Get the command for a process
- Returns a list of parent window info
- Get parent PIDs of a process
- Find the first pty of a list of pids
- Append an item to the collection
- Query windows
- Draw the image
- Return the path to a pty slave
- Scale an image to a given position
- Process commands from stdin
- Return the parent PID of a process
- Context manager for lazy drawing
- Returns the offset of the current window
- Send a SIGUSR1 signal to target
- Get client ids
- Register a command hook
- Load an image
- Start thread count
- Load an image from path
- Get the session id
- Register an error handler
- Set visibility
- Crop the given image
ueberzug Key Features
ueberzug Examples and Code Snippets
Community Discussions
Trending Discussions on ueberzug
QUESTION
With the ueberzug library, it is possible to overlay images in terminal windows under X11. The library is written in python - examples for how to use the library are provided for bash and python.
To overlay an image in the terminal, one can simply run ueberzug layer
and then enter a json formatted string like {"action": "add", "x": 0, "y": 0, "identifier": "test", "path": "/tmp/image.jpg"}
. This works flawlessly.
I am trying to call this process in C. If I understand it correctly, I just have to spawn a new process, and then write to its stdin, which is normally a simple task.
However, in my case I can see the image flicker up for a fraction of a second before the application terminates. This is my code:
...ANSWER
Answered 2021-Dec-03 at 15:11To summarize the comments, the following solution based on yours works:
- By
popen
you fork a process, create a bidirectional pipe and start the command in the sub-shell - Subsequently, one writes to the pipe, issueing commands to ueberzug
- the pipe however has to be
fflush
ed, otherwise it's transferred only when the process exits - the signal handler catches the ueberzug child-process if the sub-shell is killed/quits
Meanwhile, main
may continue running your code. The code below cycles through 3 images.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ueberzug
Install by using pip: The package is named ueberzug
Packages of linux distributions: At least one packager applies patches to my code. So if there are issues uninstall it and install it via pip. Actually I think it's not fine that they call it ueberzug after changing the code. As bugs introduced by them look like they are part of my work.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page