README (4624B)
1 television 2 ========== 3 4 A simple LAN/WLAN screen public http broadcasting service. 5 6 7 motivation 8 ---------- 9 10 I've been in situations of giving a lecture or a workshop where there was no 11 screen or projector available, or... No cable. The usual workaround that I've 12 seen friends and colleagues use is to have everyone join jitsi/zoom/bbb/etc and 13 do the screen sharing there. This works but feels like a grotesque variation of 14 the "a multinational corporation's service as the easiest way of copying files 15 between two nearby devices" entry from the crappy everyday tech bingo. 16 17 So here is a response with television, a simple binary that takes screenshots 18 of your desktop at regular intervals and serves the result over http on an 19 amazingly well formatted html page that can be accessed by everyone over 20 LAN/WLAN with their browser. It's *not* a video stream, it's really a 1fps 21 style screensharing web thing which is plenty enough for slides, GUI/TUI/CLI 22 action, etc. 23 24 Of course I hear you say, "OK but then we have all these extra screens now!". 25 Well true, but think about the new creative setups you can come up with, not 26 everyone needs to have their own screen ffs! Take that as an opportunity to 27 completely rearrange the room. Make small groups, I don't know. You can do it, 28 I have faith in you. 29 30 firefox, chrome, chromium, edge: works great (desktop and mobile) 31 safari: does not work at all, *boooo* *throws stuff at safari* 32 33 34 build 35 ----- 36 37 go mod download 38 go build -ldflags="-s -w" television.go 39 40 41 installation 42 ------------ 43 44 cp television /somewhere/nice 45 cp -r www /also/somewhere/nice 46 47 48 usage 49 ----- 50 51 television [options] 52 53 -idle user activity detection (default off) 54 55 Only works with X, makes use of X11 Screen Saver extension. 56 By default, television will make a new screenshot every 2 seconds. 57 This will work everywhere but is quite wasteful, when -idle is used 58 screnshots are made only when user activity is detected. As a bonus, 59 it means that the clients will reuse of the last cached image when 60 there is no activity, therefore reducing drastically the network 61 traffic too! 62 63 -port http port number (default 8888) 64 65 -snap custom snap command (default none) 66 67 By default, television relies on kbinani/screenshot for taking a 68 screenshot and pixiv/go-libjpeg for generating a jpg. This should 69 work everywhere, however there can be more effective and efficient 70 ways to take the screenshot (see examples), or it could be interesting 71 to process the image before serving it. With -snap the whole mechanism 72 for taking the screenshot, saving it as jpeg and placing it in the 73 www folder is skipped and will be replace by your very own (TM) 74 shell oneliner, assuming you have a working sh. Have fun. You deserve 75 it. 76 77 -www www directory (default "./www") 78 79 By default, television will look for the www folder in the same 80 folder from which television is executed, this is far from ideal. 81 I'm sure you have better ideas. I will suggest one in the examples 82 section. 83 84 85 client shortcut 86 87 'f' enter/exit fullscreen browser mode 88 89 90 examples 91 -------- 92 93 ./television 94 95 What does this do? 96 97 It just werks. Just run it like this from the git folder (after building it), 98 and ask everyone to join http://your.local.ip.address:8888/tv 99 100 --- 101 102 ./television -port 666 103 104 What does this do? 105 106 -port 666 Somehow you insisted to serve the result on 107 http://your.local.ip.address:666/tv 108 109 --- 110 111 television \ 112 -snap "scrot /tmp/www/tv/tv.tmp.jpg \ 113 && mv /tmp/www/tv/tv.tmp.jpg /tmp/www/tv/tv.jpg" \ 114 -www /tmp/www \ 115 -idle 116 117 What does this do? 118 119 -snap "scrot etc" replaces the builtin screenshot and jpeg encoding by scrot 120 and this is to my knowledge the fastest and most efficient 121 way to take screenshots on X. See HACKING for non-X feels. 122 123 -www /tmp/www uses /tmp/www as root directory for serving the files. 124 on systems where /tmp is in fact tmpfs this is a good idea 125 because this could save a lot of disk write access. 126 127 -idle takes a screenshots only when user activity is detected, 128 namely keyboard input or mouse movement. Shh. Don't move. 129 See. Nothing happens. 130 131 --- 132 133 ./television \ 134 -snap "import \ 135 -colors 2 -dither FloydSteinberg -window root www/tv/tv.tmp.jpg \ 136 && mv www/tv/tv.tmp.jpg www/tv/tv.jpg" 137 138 What does this do? 139 140 -snap "import etc" this is now a lowtechmag presentation <3