Live data from Hacker News

Texttop – An interactive X Linux desktop rendered in TTY and streamable over SSH

github.com

71–80 of 99 posts

Re: Texttop – An interactive X Linux desktop rendered in TTY and streamable over SSH

#71
post #40

Author here. Surprised to see this here as I've been literally spending the last 2 weeks on a complete rewrite from scratch that actually layers REAL text over the blocks. You can get an idea of my approach with this function: https://github.com/tombh/texttop/blob/webext-rewrite/webext/... After the success of hitting the front page here last year, I really wanted to sit down and do this properly. So not only am I wo…

Have you thought about adding sound?

Either something like Opus, or...

You could do a decomposition of the audio signal and send a small array of {frequency, amplitude} pairs for each frame, then ramp to each new pair as they arrive.

If you do this fast enough then you get just enough of the timbre of the original to make a listener think they are hearing the "right" thing for a video they already know.

Even with a single oscillator you can get some interesting sounds this way.

edit: syntax error

Re: Texttop – An interactive X Linux desktop rendered in TTY and streamable over SSH

#72
post #51

I did project with Webkit that renders to the terminal: https://github.com/callesg/termkit

Waat! We need to talk - I'm taking a very similar approach in my rewrite. There are some very interesting algorithm problems. Eg; I'm actually comparing pixels in 2 screenshots --with and without text rendered--, in order to get text colour and visibility. This way is actually more performant than using `getElementAt(x, y)` and `getComputedStyle(element)`.

I rewrote mine to. One big problem i hit before rewriting was performance and also css :after classes they are not reachable in the DOM if I remember correctly. So I resorted to patching phantom to give me access to the WebKit render tree.(which is a tree similar to the Dom tree but not the same.

I can't remember if there was some big issue that eventually made me stop developing. I think the final issue was characters with dual width like many Chinese characters the gui library blessed did not understand the concept of characters with non standard width and a single such character would destroy the entire layout. And issues with correlting the render tree and the Dom tree.

Re: Texttop – An interactive X Linux desktop rendered in TTY and streamable over SSH

#73
post #27

Earlier quoted context omitted.

HN Tabs are like an unstoppable cancer. I'm on XFCE and I have a whole workspace dedicated to over a year's worth of articles, books, discussions, etc from HN that "I'll eventually get around to reading".

I use https://www.linkpack.io/ on iOS as my black hole for links.

Didn't know about that one. Pocket would also work, esp if you're using Firefox. Also works on the Kobo e-reader.

Other options I'm aware of are conventional bookmarks, and OneTab.

Re: Texttop – An interactive X Linux desktop rendered in TTY and streamable over SSH

#74
post #34
post #19

Earlier quoted context omitted.

> sometimes I don't have very good Internet. If all I have is a 3kbps connection I don't think X would handle that very well, and you may not have an X server at the other side.

3 kbps is not enough for smooth TTY text-only ssh either...

I've done pretty productive work over much tighter links than that. Think 300bps.

One of the systems I'm responsible for currently can only be reached over a 1200bps dialup connection.

Re: Texttop – An interactive X Linux desktop rendered in TTY and streamable over SSH

#75
post #45
post #38

Given the quality of text (or the requirement to zoom) I'm not sure what the fuss is about. It looks abysmal, and having to zoom all the time is a habit I am glad we got rid of due to higher resolutions. Though still existing on mobile devices it is also user-friendlier to zoom there, and the reason for the feature is the device is more mobile. You could already run a browser in a framebuffer for ages. Which means yo…

I'm actually in the middle of a complete rewrite (I was hoping to stay under the radar until then). I'm ditching X11 and ffmpeg and actually rendering real text as a layer over the TTY blocks. See: https://github.com/tombh/texttop/blob/webext-rewrite/webext/...

Have you considered using libcaca for some use cases? Might be appropriate for images/videos.

Have you (or anyone else) tried Texttop over Tor + SSH?

NX (FreeNX) and X2Go was already mentioned in the previous thread [1]. I've used NX successfully over 32 kbit/sec upload in 2005 (server in NL, client in CA/US). Latency was acceptable. But we're not talking about network speeds or latencies like 2G/Edge (which seems to be your use case). They support resuming of sessions. In other words, like RDP. And with regards to RDP: you can decrease the image quality to make it more bearable. Nowadays, open source implementations are available. If you're on very slow links you can also perhaps enable (more) compression, at the cost of more CPU power it might still actually decrease latency. Not sure if LZMA2 is used for compression in this context these days.

Good luck with your project!

[1] https://news.ycombinator.com/item?id=11744788

Re: Texttop – An interactive X Linux desktop rendered in TTY and streamable over SSH

#76
post #57
post #40

Author here. Surprised to see this here as I've been literally spending the last 2 weeks on a complete rewrite from scratch that actually layers REAL text over the blocks. You can get an idea of my approach with this function: https://github.com/tombh/texttop/blob/webext-rewrite/webext/... After the success of hitting the front page here last year, I really wanted to sit down and do this properly. So not only am I wo…

You might get a slightly better resolution with the approach taken here: https://github.com/stefanhaustein/TerminalImageViewer (= find best matching block graphics character for most prominent colors in a cell; there is a comparison to half blocks at the end).

Cool, TIV looks great! (Just compiled, ran, and tested it.)

I thought [cacaview](https://github.com/cacalabs/libcaca) was the only terminal image viewer player in town with their attendant `cacaview' prog. I'd very much appreciate it if anyone here knows of any other libs or especially the sanest way to do this in either C/C++ or Ruby … It's for a terminal-based project I have in mind :)

Re: Texttop – An interactive X Linux desktop rendered in TTY and streamable over SSH

#77
post #51

Earlier quoted context omitted.

Waat! We need to talk - I'm taking a very similar approach in my rewrite. There are some very interesting algorithm problems. Eg; I'm actually comparing pixels in 2 screenshots --with and without text rendered--, in order to get text colour and visibility. This way is actually more performant than using `getElementAt(x, y)` and `getComputedStyle(element)`.

I rewrote mine to. One big problem i hit before rewriting was performance and also css :after classes they are not reachable in the DOM if I remember correctly. So I resorted to patching phantom to give me access to the WebKit render tree.(which is a tree similar to the Dom tree but not the same. I can't remember if there was some big issue that eventually made me stop developing. I think the final issue was characte…

Now I remember the main problem before switching to the render three was text rows. there is no good way of knowing where a text line will break without resorting to the render tree or to use some form of ocr.

Re: Texttop – An interactive X Linux desktop rendered in TTY and streamable over SSH

#78
post #57

Earlier quoted context omitted.

You might get a slightly better resolution with the approach taken here: https://github.com/stefanhaustein/TerminalImageViewer (= find best matching block graphics character for most prominent colors in a cell; there is a comparison to half blocks at the end).

Cool, TIV looks great! (Just compiled, ran, and tested it.) I thought [cacaview]( https://github.com/cacalabs/libcaca ) was the only terminal image viewer player in town with their attendant `cacaview' prog. I'd very much appreciate it if anyone here knows of any other libs or especially the sanest way to do this in either C/C++ or Ruby … It's for a terminal-based project I have in mind :)

Some alternatives are listed in this askubuntu thread: https://askubuntu.com/questions/97542/how-do-i-make-my-termi...

Re: Texttop – An interactive X Linux desktop rendered in TTY and streamable over SSH

#79

Earlier quoted context omitted.

I rewrote mine to. One big problem i hit before rewriting was performance and also css :after classes they are not reachable in the DOM if I remember correctly. So I resorted to patching phantom to give me access to the WebKit render tree.(which is a tree similar to the Dom tree but not the same. I can't remember if there was some big issue that eventually made me stop developing. I think the final issue was characte…

Now I remember the main problem before switching to the render three was text rows. there is no good way of knowing where a text line will break without resorting to the render tree or to use some form of ocr.

Ah yes, that was a big hurdle, but that's actually fully supported now with DOM Ranges - basically codified selection boxes, those regions that highlight when you select with a mouse. There's still some extra leg work though to render whitespace in the same way as the browser.

Re: Texttop – An interactive X Linux desktop rendered in TTY and streamable over SSH

#80
post #79

Earlier quoted context omitted.

Now I remember the main problem before switching to the render three was text rows. there is no good way of knowing where a text line will break without resorting to the render tree or to use some form of ocr.

Ah yes, that was a big hurdle, but that's actually fully supported now with DOM Ranges - basically codified selection boxes, those regions that highlight when you select with a mouse. There's still some extra leg work though to render whitespace in the same way as the browser.

I did that to if you are referring to getBoundingClientRect & getClientRects, before I switched over to the render tree.

It does work perfecly for single line text but not multi line text. The rect will become larger than the text and you won't know where each line starts.

Well that is what I remember happening.

Post reply on HN