this post was submitted on 28 Dec 2023
245 points (97.3% liked)

Linux

45582 readers
598 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I'm not sure this is the right community.

I've been hoping for a TUI frontend for Lemmy for a while, but unfortunately none came out and I've decided to build a proof of concept on my own.

It's written in python with pythorhead, blessed and chafa.py and it's quite janky.

you are viewing a single comment's thread
view the rest of the comments
[–] djtech 9 points 6 months ago (2 children)

For rendering high quality images in the terminal, check out the Kitty graphical protocol. I don't know if they are any python libraries to use, but I think that they are. P.S. This seems to work well https://stackoverflow.com/questions/58138638/how-to-display-graphical-images-in-kitty-terminal-using-python

[–] [email protected] 6 points 6 months ago (1 children)

I went with chafa as it's terminal agnostic and supports various modes.

Then again, I'm not really sure a tui frontend needs high quality image rendering. Earlier I even considered going completely 1bit braille or just ASCII just so that the image doesn't take all of the focus at the expense of the post body.

As mentioned by another commenter, I believe opening the full image in an external viewer is a much better solution, not to mention easier to implement.

[–] [email protected] 3 points 6 months ago (1 children)

You could also look into using sixel. It's kinda like the kitty protocol but older and terminal agnostic.

https://en.m.wikipedia.org/wiki/Sixel

[–] [email protected] 2 points 6 months ago (1 children)

Thanks, I've only heard of sixel, but never really read into it. Sounds promising.

[–] [email protected] 1 points 6 months ago

A suggestion is do it like neofetch and let the user choose. Amazing work.

[–] [email protected] 3 points 6 months ago (1 children)

does this protocol work for other terminals? such as alacritty, foot, urxvt, or even st (with appropriate patch ofc)?

[–] djtech 2 points 6 months ago

A quick research tells me that there aren't patches for other emulators, but the protocol seems well described, so making those patches is possible. I could also take a look at Alacritty source code and deicide if I could make this project work.