https://github.com/sayanarijit/previuwu
[PoC] An all-in-one preview window for the furries
https://github.com/sayanarijit/previuwu
Last synced: 8 months ago
JSON representation
[PoC] An all-in-one preview window for the furries
- Host: GitHub
- URL: https://github.com/sayanarijit/previuwu
- Owner: sayanarijit
- License: apache-2.0
- Created: 2022-07-24T07:33:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-27T06:40:46.000Z (over 3 years ago)
- Last Synced: 2025-03-18T21:47:10.835Z (9 months ago)
- Language: Rust
- Homepage:
- Size: 53.7 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# previuwu
An all-in-one preview window for the furries.
Uses [egui][3] to render the preview window.
STATUS: Proof of Concept (⚠️ heavy work in progress).
### Demo
#### Preview texts
https://user-images.githubusercontent.com/11632726/180646344-4cd4e487-9dd9-49a7-9e90-a1baac291124.mp4
#### Preview images
https://user-images.githubusercontent.com/11632726/180646954-3a4e8a39-0400-4a24-bc4b-23f7dda9f8bc.mp4
### Install
Better don't install it as of now, unless you want to contribute.
```bash
cargo install --git https://github.com/sayanarijit/previuwu
```
### Usage
Preview a single file:
```bash
previuwu /path/to/file
```
Allow streaming input from stdin:
```bash
previuwu /path/to/file --pipe -
```
Also allow streaming input from a named [pipe][1]:
```bash
# mkfifo path/to/input.fifo
previuwu /path/to/file --pipe - --pipe path/to/input.fifo
```
### Use Case
Run a slide show of the contents in your $PWD:
```bash
ls -1 | while read -r file; do echo "$file"; sleep 1; done | previuwu -p -
```
Example usage with [xplr][2] and [nnn][4]:
```bash
# Create a fifo file
mkfifo /tmp/previuwu.fifo
# Run previuwu in background (will close automatically when done)
previuwu --pipe /tmp/previuwu.fifo &
# Run xplr with fifo enabled
xplr --on-load 'StartFifo: /tmp/previuwu.fifo'
# Run nnn with fifo enabled
NNN_FIFO=/tmp/previuwu.fifo nnn
```
### Supports
I plan to support as many input types as possible.
- [x] Stdin
- [x] Named Pipes (fifo)
- [ ] Socket
- ...ideas?
Very basic (ugly) support for the following file types has been implemented:
- [x] Directory
- [x] Text
- [x] Images
- ...contribute?
### Contribute
First of all, thank you.
Please go through `src/preview` and try to implement loading and/or rendering as many file types as you can.
Loading is the easy part. Rendering might require some experience with [egui][3].
Some files can be really slow to load/render in development mode (`cargo run`). Try running in release mode (`cargo run --release`).
[1]: https://man7.org/linux/man-pages/man7/fifo.7.html
[2]: https://xplr.dev
[3]: https://github.com/emilk/egui
[4]: https://github.com/jarun/nnn