6 ms·
Show HN: Texttop – Interactive desktop rendered in TTY with ASCII
- tombh 10y agoForgot to put the word "interactive" in the title. Edit: didn't know you could edit the title after submission.
- dhotson 10y agoThis 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 10y agoHaha 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 10y agoOk 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 10y agoOh, 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.
- LukeShu 10y agoWith OpenSSH 7.2p2, I get: ssh_dispatch_run_fatal: Connection to 107.170.66.146 port 22: invalid format But I see "Hello! :D" with ncat :)
- xvilka 10y agoMay 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
- tombh 10y agoWow, that world map looks really good. Good suggestion, thanks.
- StavrosK 10y agoAw, 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 10y agoso try https://github.com/yaronn/wopr https://github.com/yaronn/wopr
- StavrosK 10y agoThat's interesting, but not very well-suited to real-time dashboards, is it? Seems to be for one-offs.
- yaronn01 10y agocurling 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#L27 https://github.com/yaronn/wopr/blob/master/server/server.js#... where your present method implementation will run in some loop / timeout and keep sending data (by calling screen.render).
- AnthonBerg 10y agoNX / X2Go
- tombh 10y agoHad 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 10y agoThey 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 10y agoWow, okay, that's good to know, another way around the Great Firewall. I will have to give NX a spin.
- 1ris 10y agoIt'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 10y agoHiptext supports this: https://github.com/jart/hiptext/blob/d50329e3b975ffac0209c0ade91120cec499918f/hiptext.cc#L134 https://github.com/jart/hiptext/blob/d50329e3b975ffac0209c0a... But it's crashing when I run in Alpine :/ I have hope because it works fine in my local Arch/ZSH env :)
- macscam 10y agoCool 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 10y agoThe 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.
- SirRockALot 10y agoI 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.rs https://github.com/blitzcode/term-gfx/blob/master/src/main.r... I think it could work great for your software.
- tombh 10y agoIs that similar to this do you think?https://github.com/jart/hiptext/blob/d50329e3b975ffac0209c0ade91120cec499918f/hiptext.cc#L134 https://github.com/jart/hiptext/blob/d50329e3b975ffac0209c0a... 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 10y agoOMG, 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.rs#L59 https://github.com/blitzcode/term-gfx/blob/master/src/main.r...
- SirRockALot 10y agoYou 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