commit 4b8e5771f1361dbb85b3548f6a773bb2d1c38227
parent 2610bbc57b7246c95031b210ac488345347f3afb
Author: ugrnm <ultrageranium@bleu255.com>
Date: Mon, 7 Oct 2024 23:01:03 +0200
readme
Diffstat:
M | README | | | 96 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- |
1 file changed, 93 insertions(+), 3 deletions(-)
diff --git a/README b/README
@@ -1,16 +1,106 @@
television
==========
-A simple LAN/WLAN screen public broadcasting service.
+A simple LAN/WLAN screen public http broadcasting service.
+
+
+motivation
+----------
+
+I've been in situation of giving lectures or workshops where there is no
+screen or projector, or... no cable. The usual workaround that I've seen
+friends and colleagues use is to have everyone join jitsi/zoom/bbb/etc and
+do the screen sharing there. This works but feels like a grotesque variation
+of the "a multinational corporation's service as the easiest way of copying
+files between two nearby devices" entry from the crappy everyday tech bingo.
+
+So here is a reponse with television, a simple binary that takes screenshots
+of your desktop at regular intervals and serves the result over http in an
+amazingly well formatted html page that can be accessed by everyone over
+LAN/WLAN with their browser. It's *not* a video stream, it's really 1fps style
+screensharing which is plenty enough for slides, GUI/TUI/CLI action, etc.
+
+Of course I hear you say, "OK but then we have all these extra screens now".
+Well true, but think about the new creative setups you can come up with, not
+everyone needs to have their own screen ffs! Take that as an opportunity to
+completely rearrange the room. You can do it, I have faith in you.
+
+just start your television program and tell everyone to join
+http://your.local.ip.address:8888
+
+firefox, chrome, chromium, edge: works great
+safari: does not work at all, *boooo* *throws stuff at safari*
build
-----
-blablabla
+go mod download
+go build -ldflags="-s -w" television.go
+
+
+installation
+------------
+
+cp television /somewhere/nice
+cp -r www /also/somewhere/nice
usage
-----
-blablabla
+television [options]
+
+-idle user activity detection (default off)
+
+ Only works with X, makes use of X11 Screen Saver extension.
+ By default, television will make a new screenshot every 2 seconds.
+ This will work everywhere but is quite wasteful, when -idle is used
+ screnshots are made only when user activity is detected. As a bonus,
+ it means that the clients will make use of the last cached image when
+ there is no activity, therefore reducing drastically the network
+ traffic.
+
+-port http port number (default 8888)
+
+-snap custom snap command (default none)
+
+ By default, television relies on kbinani/screenshot for taking a
+ screenshot and pixiv/go-libjpeg for generating a jpg. This should
+ work everywhere, however there can be more effective and efficient
+ ways to take the screenshot (see example), or it could be interesting
+ to process the image before serving it. With -snap the whole mechanism
+ for taking the screenshot, saving it as jpeg and placing it in the
+ www folder is skipped and will be replace by your very own (TM)
+ shell oneliner, assuming you have a working sh. Have fun.
+
+-www www directory (default "./www")
+
+ By default, television will look for the www folder in the same
+ folder from which television is executed, this is far from ideal.
+ I'm sure you have better ideas. I will suggest one in the example
+ section.
+
+
+example
+-------
+
+./television \
+ -snap "scrot /tmp/www/tv.tmp.jpg && mv /tmp/www/tv.tmp.jpg /tmp/www/tv.jpg" \
+ -www /tmp/www \
+ -idle
+
+What does this do?
+
+-snap "scrot etc" replaces the builtin screenshot and jpeg encoding by scrot
+ and this is to my knowledge the fastest and most efficient
+ way to take screenshots on X. See HACKING for non-X feels.
+
+-www /tmp/www uses /tmp/www as root directory for serving the files.
+ on systems where /tmp is in fact tmpfs this is a good idea
+ because this could save a lot of disk write access.
+
+-idle takes a screenshots only when user activity is detected,
+ namely keyboard input or mouse movement.
+
+