←back to thread

1080 points mmulet | 5 comments | | HN request time: 0s | source

I made a built-from scratch Wayland Compositor to display any GUI app* in the terminal! I think there is a lot of unexplored potential in custom Wayland compositors, a lot of really cool things you can embed existing applications into! So, I started with embedding apps into the terminal because that is the easiest input/output (output is just utf-8 and I use the great `chafa` library for that, and I just read from stdin for the input).

If you have any other ideas for cool Wayland compositors, let me know. I purposedly wrote 80% the app in Typescript to appeal to the most developers and attract cool contributions (I do all drawing with the familiar Canvas2D api, so if there is interest, I can also fork this out into a cool Terminal canvas, let me know!)

I have a blog post here about how I did it, but it’s pretty high level and non technical, so please ask if you have any questions.

[How I Did It](<https://github.com/mmulet/term.everything/blob/main/resource...>)

*technically only Wayland apps and x11 apps with Xwayland. But on Linux that’s mostly everything.

Show context
nick__m ◴[] No.45200895[source]
That's awesomely useless, it straddles the line between programming and art.

I am sure it was a great and fun learning experience.

Well done !

replies(3): >>45201051 #>>45203027 #>>45204865 #
actsasbuffoon ◴[] No.45201051[source]
Yeah, I can’t explain why this project makes me so happy because I struggle to think of any time where I’d need this, but it puts a big, dumb grin on my face.
replies(4): >>45201232 #>>45201507 #>>45202762 #>>45204989 #
1. msdz ◴[] No.45204989[source]
It's like a more generalized browsh[1].

[1] https://www.brow.sh/

replies(1): >>45205906 #
2. tombh ◴[] No.45205906[source]
I think one significant difference though is that Browsh renders actual text for text content, so you can copy and paste, etc.
replies(1): >>45205955 #
3. mmulet ◴[] No.45205955[source]
You will be able to copy/paste with term.everything once I implement the Wayland copy/paste interface (wl_data_device_manager).
replies(1): >>45210557 #
4. tombh ◴[] No.45210557{3}[source]
OMG! That'd be AMAZING. But it still wouldn't render GUI text as terminal font text right?
replies(1): >>45212032 #
5. mmulet ◴[] No.45212032{4}[source]
That’s right, it will still be pixelfied text. We could run ocr on the images then convert to text, but that’s an entirely new can of worms. Make a feature request issue on GitHub if you’re interested,