
Show HN: Texttop – Interactive desktop rendered in TTY with ASCII - tombh
https://github.com/tombh/texttop
======
xvilka
May be image quality could be improved by using whole unicode set, rather than
just plain ASCII. E.g. braille-fonts, like in blessed-contrib[1].

[1] [https://github.com/yaronn/blessed-
contrib](https://github.com/yaronn/blessed-contrib)

~~~
StavrosK
Aw, this is great but node.js is putting me off it :/ I was hoping I wouldn't
have to install something so heavy for such a small utility...

~~~
yaronn01
so try [https://github.com/yaronn/wopr](https://github.com/yaronn/wopr)

~~~
StavrosK
That's interesting, but not very well-suited to real-time dashboards, is it?
Seems to be for one-offs.

~~~
yaronn01
curling the markup is not for realtime. sometimes you can get away with
curling in a loop with some sleep, and depending on the latency / scale you
will get the same effect. however blessed-contrib can also be used as a server
side component where clients curl for its endpoint (which is different than
curling a static markup). that way it can return a live stream of data. you
would use the same approach as
[https://github.com/yaronn/wopr/blob/master/server/server.js#...](https://github.com/yaronn/wopr/blob/master/server/server.js#L27)
where your present method implementation will run in some loop / timeout and
keep sending data (by calling screen.render).

------
dhotson
This is so cool, very nice work! :D

I've been playing with writing little custom SSH server stuff recently as
well—try this for example:

ssh hello.dn.ht

One thing I've been testing to get some extra vertical resolution on graphical
stuff is the unicode half block character
([https://en.wikipedia.org/wiki/Block_Elements](https://en.wikipedia.org/wiki/Block_Elements))
with a separate foreground and background color. Works ok, but background
color can bleed through depending on the font you use.

~~~
tombh
Haha Wasn't expecting that, very cool! How did you do that? Have you some code
somewhere? Thanks for the praise :) A big part of pushing forward with this
was seeing the quality of @jart's hiptext[1] renderings, I find it creates
much more aesthetically pleasing ASCII images than libcaca and libaa. It only
uses those block elements, like your webcam video.

[1] [https://github.com/jart/hiptext](https://github.com/jart/hiptext)

~~~
dhotson
Ok yeah wow, hiptext's output looks pretty fantastic. :)

I'm using my own text webcam thing:
[https://github.com/dhotson/txtcam](https://github.com/dhotson/txtcam) .. not
too fancy, just using greyscale with some shading characters to do some basic
"dithering".

Also, if you're on Mac OSX and using iTerm2 version 3, you might be interested
in its 24bit colour support. It's not that widely supported yet in other
terminals unfortunately though:
[https://gist.github.com/XVilka/8346728](https://gist.github.com/XVilka/8346728)

~~~
tombh
Oh, that textcam code isn't too complicated and you get a really good effect
from it.

I never even knew that there was true colour support in terminals, let alone
how many terminals support it! Hmm, so I'd need to figure out if SSH sends the
terminal's ability to render true colour. And then also update hiptext. It
would make a really big difference to the "readability" of the texttop output.

------
SirRockALot
I implemented this neat trick that gives 4x spatial and 2x color resolution
using Unicode Block characters

[http://www.blitzcode.net/rust.shtml#term_gfx](http://www.blitzcode.net/rust.shtml#term_gfx)

[https://github.com/blitzcode/term-
gfx/blob/master/src/main.r...](https://github.com/blitzcode/term-
gfx/blob/master/src/main.rs)

I think it could work great for your software.

~~~
tombh
Is that similar to this do you
think?[https://github.com/jart/hiptext/blob/d50329e3b975ffac0209c0a...](https://github.com/jart/hiptext/blob/d50329e3b975ffac0209c0ade91120cec499918f/hiptext.cc#L134)
Where `kUpperHalfBlock = L'\u2580'`

Because Hiptext is already supporting it, but when I enable the flag to
support it, it crashes in Alpine, but not in my local env :/

~~~
tombh
OMG, no, it's not the same, you go even further with 4 colours per char!!
[https://github.com/blitzcode/term-
gfx/blob/master/src/main.r...](https://github.com/blitzcode/term-
gfx/blob/master/src/main.rs#L59)

~~~
SirRockALot
You still only get 2 colors (bg & fg), but you get to chose for each of the 4
sub-pixel, it's a bit like DXTC texture compression

------
tombh
Forgot to put the word "interactive" in the title. Edit: didn't know you could
edit the title after submission.

------
1ris
It's probably beside the point, you could double the number of pixels and
foremost make them square if you used fore- and background color for U+2584 or
go even further with U+2596 to U+259F.

~~~
tombh
Hiptext supports this:
[https://github.com/jart/hiptext/blob/d50329e3b975ffac0209c0a...](https://github.com/jart/hiptext/blob/d50329e3b975ffac0209c0ade91120cec499918f/hiptext.cc#L134)
But it's crashing when I run in Alpine :/ I have hope because it works fine in
my local Arch/ZSH env :)

------
macscam
Cool idea but I haven't been able to get it working. Docker is proving to be a
real drag to install. Furthermore in the GIF on the README the text is
illegible.

~~~
tombh
The text only becomes legible at very high zoom levels. I needed to strike a
balance when recording that GIF, so I didn't zoom in all the way.

------
AnthonBerg
NX / X2Go

~~~
tombh
Had never heard of them, thanks. Do you have experience with them over
connections that drop, eg; travelling on a train, or connections as low as
3kbps?

~~~
AnthonBerg
They work at least decently over connections that drop - I can't remember if
they autoconnect or keep things alive like mosh or if it works more like
screen. Low bandwidth is surprisingly good - not sure if I've gone as low as
3Kbps but I do remember working out of a hotel room in China to a Linux
machine in Iceland over NX. The regular web was hardly usable but NX was
fine!, even good enough to browse the web over.

~~~
tombh
Wow, okay, that's good to know, another way around the Great Firewall. I will
have to give NX a spin.

