Most active commenters
  • mmulet(5)

←back to thread

1080 points mmulet | 25 comments | | HN request time: 0.634s | source | bottom

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.

1. 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 #
2. 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 #
3. mmulet ◴[] No.45201232[source]
<3
replies(1): >>45202269 #
4. snozolli ◴[] No.45201507[source]
It reminds me a bit of chindōgu, the Japanese art (?) of useless inventions. There's a particular delight to ingenious, but absurd or useless creations.
replies(3): >>45201992 #>>45203361 #>>45203688 #
5. k-warburton ◴[] No.45202269{3}[source]
I came here to make the same comment. I want to try this myself just for the fun of it and the grin it will put on my face. Nice work!
replies(1): >>45202357 #
6. mmulet ◴[] No.45202357{4}[source]
You can have a <3 too!
7. pawelduda ◴[] No.45202762[source]
Well, you can run apps on any less capable device with ssh and proper terminal display. You can limit data usage by offloading video buffering to the host (however not sure if that's net positive saving). And put the host behind VPN to avoid getting region blocks.
replies(2): >>45203120 #>>45205606 #
8. GTP ◴[] No.45203027[source]
Well, not 100% useless: I can see its use for applications running inside Docker containers. Yes, there are ways to have GUI applications rendered from the inside of a container, but maybe this is easier than getting the Dockerfile right.

EDIT: nevermind, doing this with Docker seems much easier than I expected [0]. I'll try it tomorrow, I'm curious to see if the proposed solution works on Windows as well.

[0] https://medium.com/@priyamsanodiya340/running-gui-applicatio...

replies(1): >>45207471 #
9. unleaded ◴[] No.45203120{3}[source]
Oops, we've invented X
10. anthk ◴[] No.45203361{3}[source]
Emacs it's full of chindogus. Also, there's geekcode, xroach, megahal/hailo, xneko, aatv and mplayer rendering videos over aalib, aaquake, eforth running in the subleq virtual machine...
replies(2): >>45203831 #>>45203832 #
11. hnlmorg ◴[] No.45203688{3}[source]
That’s a term I’ve not heard in literally decades.

Thanks for the reminder

12. DiggyJohnson ◴[] No.45203831{4}[source]
I’m a fan of `xeyes`
replies(1): >>45204254 #
13. hiccuphippo ◴[] No.45203832{4}[source]
I remember watching the World Cup over telnet with one of those aalib libraries years ago. The signal arrived 5 seconds earlier than the TV :)
replies(1): >>45205007 #
14. watersb ◴[] No.45204254{5}[source]
xeyes can be Actually Useful; two eyes always looking at the cursor...

your animal brain hardwired to discern the direction of gaze of the eyes facing you (citations appreciated)...

Helps me find the mouse cursor on a big screen if I lose track, even with small parallax angle.

On macOS, I just wiggle the mouse back and forth, and the cursor gets really big, it pops out at you.

I generally don't keep `xeyes` running. But it's a righteous, venerable hack.

replies(1): >>45232929 #
15. dmayle ◴[] No.45204865[source]
Definitely not useless!

I run a ttyd server to get terminal over https, and I have used carbonyl over that to get work done. That's limited to a web browser (to get access to resources not exposed via the public internet), so having full GUI support is very useful

16. msdz ◴[] No.45204989[source]
It's like a more generalized browsh[1].

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

replies(1): >>45205906 #
17. anthk ◴[] No.45205007{5}[source]
With a small framebuffer font aatv was almost watchable over a distance, but OFC fbtv made it obsolete, and ditto with mplayer -vo aalib as movies worked in the framebuffer just as fine as X.

But I remember the BB demo and I still remember these catchy s3m modules...

https://aa-project.sourceforge.net/bb/

And, well, not AA, but I still play today tons of text adventures and roguelikes (and BSDgames and such), and my main X environment it's CLI/TUI based except for CWM (Window manager), MPV/MuPDF/NSxiv (images) and djview4 for DJVU files..

18. blooalien ◴[] No.45205606{3}[source]
I actually used to tunnel Netscape Navigator via SSH to my Commodore Amiga desktop via an Xorg server way back in the 56K phone modem Internet days from my ISP's SSH user account login, since Amiga didn't have Netscape (and even if it did, the Amiga likely would have choked on it, massive and bloated as Netscape was), and the browser AmigaOS did have just wasn't up to the task of normal day-to-day usage of the Web as it existed back then. Fun times.

Sure am glad of the broadband Internet and modern "powerhouse" PCs we have so readily available today. Hell, even the computer most everyone carries in their pocket these days is infinitely more powerful than the average desktop machines of my childhood. :)

19. tombh ◴[] No.45205906{3}[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 #
20. mmulet ◴[] No.45205955{4}[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 #
21. nicce ◴[] No.45207471[source]
Windows had Wayland support before most distros! Rather surprising.
replies(1): >>45208926 #
22. 0points ◴[] No.45208926{3}[source]
> Windows had Wayland support before most distros! Rather surprising.

WSL had non-accelerated wayland support at one point in time.

Was it before "most distros"?

I don't understand what you think that amounts to.

Wayland support in Linux-land typically means that the software supports running in your wayland compositor.

Windows famously is not a wayland compositor, no matter how much you try to bend reality.

23. tombh ◴[] No.45210557{5}[source]
OMG! That'd be AMAZING. But it still wouldn't render GUI text as terminal font text right?
replies(1): >>45212032 #
24. mmulet ◴[] No.45212032{6}[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,
25. vrighter ◴[] No.45232929{6}[source]
you can also do the mouse wiggle thing on kde. And unlike macs, the cursor never stops growing until you stop shaking. You can literally get it to cover the whole screen. So funny for me