Using htop to generate a live website background
11–20 of 63 posts
Re: Using htop to generate a live website background
#12Neat thanks! You can generate HTML (and from that png or whatever) with http://www.pixelbeat.org/scripts/ansi2html.sh like $ COLUMNS=80 timeout 1 htop > t.ansi $ ansi2html.sh --bg=dark t.html I've requested a -b, --batch option for htop, to simplify this mode of operation. https://github.com/hishamhm/htop/issues/282 Then you could just: $ COLUMNS=80 htop -b | ansi2html.sh ...
Re: Using htop to generate a live website background
#13Would be more interesting if the background is live, like updating itself every second or half a second.
Re: Using htop to generate a live website background
#14Well it's ansi text, so why not just copy the text directly to a DIV, convert the ansi to html (or css) and update it via javascript polling ?
Re: Using htop to generate a live website background
#15Re: Using htop to generate a live website background
#16Re: Using htop to generate a live website background
#17Re: Using htop to generate a live website background
#18Re: Using htop to generate a live website background
#19Well it's ansi text, so why not just copy the text directly to a DIV, convert the ansi to html (or css) and update it via javascript polling ?
Re: Using htop to generate a live website background
#20You can make it more efficient by capturing the images to a buffer and rendering a low FPS h264 stream, serving it as HLS fragments and displaying it with hls.js ( https://github.com/dailymotion/hls.js ) as a background element. There is a lot of inter frame compression benefits to be had from this sort of content + it will look more nice with a constant stream of frames. With a low FPS, the CPU usage should be low e…