Top
Best
New

Posted by mmulet 4 days ago

Show HN: Term.everything – Run any GUI app in the terminal(github.com)
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.

1049 points | 142 commentspage 4
lazyfanatic42 2 days ago|
It is funny but this is what I wished things did when I first started using Linux back in the day. '98-'99 timeframe, then I "learned" better that there was Xorg/X11,etc.
xiphias2 2 days ago||
- Can you run a compositor inside a compositor? I'd love to just ssh to a server and run hyprland

- doesTerm.everything run inside tmux with automatic window resizing? I guess not, but it would be cool

mmulet 2 days ago|
1. Yes, but it depends on your compositor because your compositor needs to be able to run as a nested Wayland client. I think there is support for this in wlroots based Wayland compositors, but I'm not sure if hyperland supports it.

2. I think it will work, but I haven't tried. I redraw the terminal window every time the "termed" window updates. So, if you are playing a video for example and you dynamically resize the window, it should update the size automatically. If you are viewing a static window it might not.

chaps 2 days ago||
Neat! I did a similar project many years ago just to see if I could with ANSI color stuff to animate video in my terminal. Worked really well, but it looked like absolute butt (unlike this project).

Nicely done!

maxglute 2 days ago||
Stupid, love it. Occasionally I'll use shaderglass ascii shader on oled screen to play videos with pixel ratio that makes UI unreadable, but it's charming experience.
tclover 2 days ago||
I tried recently once again to ditch Windows for Linux. Everything kinda worked, but the MediaTek Wi-Fi drivers were janky and my speed was like 10x slower than it should’ve been. After spending about 10 hours messing around with configs, I realized I was doing literally everything except what I actually wanted to do when I turned on the PC… so I just went back and installed LTSC Windows again.
saghm 2 days ago|
I don't really understand the relevance of this comment to this thread, but since it's here...I remember running into something somewhat similar when trying to dual-boot Windows for something on a machine I already had Linux installed on, and while I can't remember whether it was actually MediaTek or not, I think it might have been. If my recollection is correct, I ended up figuring out that having the wifi configured to 1 Gbps in Windows somehow reverted the wifi to only 100 Mbps in Linux, and the only way for me to fix it was to boot back into Windows and switch it to whatever it had been by default (I think 100 Mbps?). Not sure if this is something you care enough to actually try out or not, but I figured it couldn't hurt to mention!
mathfailure 2 days ago||
Does running something via Term.everything consume more or less resources, than running that something directly?
mmulet 2 days ago|
Depends on what resolution your terminal is set to. (Not the resolution of the GUI app you use, just the resolution you display it). At low resolution (640x480) it’s pretty performant, but at 4K I can hear my fans going full blast.
watersb 2 days ago||
I love this.

I would go for weeks just in a large framebuffer terminal, no GUI running. And I still run some servers that way.

Terminally insanely great!

alkh 2 days ago||
This is so cool, thanks for sharing! Having this on a Mac would be great but I understand that this might be a huge undertaking :)
mmulet 2 days ago|
I definitely want to make a macOS version, but I haven’t even looked into it yet. So, I don’t know the level of hacking required. It definitely doesn’t sound like anything Apple would have an api for, so it would probably be a vnc or accessibility api trick.
krackers 2 days ago||
I think there is an API (that was added with sidecar) to create a virtual display. So at best you could retrieve the framebuffer and then display that. I don't think there is an easy exposed way to get per-window information, aside from doing a screencapture (which likely would not work if you also wanted to hide the window).
mmulet 2 days ago||
Interesting… do you have a link to the docs? The easiest thing prob would be to set the window to be fullscreen, but on that virtual display. That would accomplish per window screen capture.
krackers 2 days ago||
It's a private API CGVirtualDisplay, but mostly well reverse engineered. Here's one example I found of a wrapper library

https://github.com/enfp-dev-studio/node-mac-virtual-display/...

mmulet 2 days ago||
100. Thanks!
teknopaul 2 days ago|
Someone needs to make bash_completion really trivial to write.

It isn't: and even copy paste is hard. Clever people write apps that are bash_completion friendly.

If first main arg is bash friendly

mycli myfunc ...

Myour whole cliapp becomes "discoverable" with one tab keystroke that you probably already typed hopefully anyway.

Never need to advertise a new feature.

Deprecate by removing from completion without breaking scripts.

Then _everything_ already is in your cli, because someone already did it.

camdroidw 2 days ago|
Read the replies to his comment: https://news.ycombinator.com/item?id=44854035#44854278
More comments...