cc 4 лет назад
Родитель
Сommit
139e8a9f63
2 измененных файлов с 15 добавлено и 2 удалено
  1. 13 0
      jlab/Dockerfile
  2. 2 2
      jlab/matrix_ft.py

+ 13 - 0
jlab/Dockerfile

@@ -60,5 +60,18 @@ EXPOSE 8888
 # passwd is "code"
 CMD ["jupyter", "lab", "--allow-root", "--NotebookApp.token=''", "--NotebookApp.password='argon2:$argon2id$v=19$m=10240,t=10,p=8$GXZHXm2yFviNanoy9hyULw$1YLbN5ymQxuwvwPVN5e0hA'"]
 
+# local flaschen-taschen terminal
+RUN mkdir /opt/ft \
+    && cd /opt/ft \
+    && git clone --recursive https://github.com/hzeller/flaschen-taschen.git \
+    && cd flaschen-taschen/server \
+    && make FT_BACKEND=terminal
+RUN echo '/opt/ft/flaschen-taschen/server/ft-server -D64x64 --hd-terminal --layer-timeout 60' >> /bin/ft64
+RUN chmod 777 /bin/ft64
+RUN ln -s /opt/ft/flaschen-taschen/server/ft-server /bin/ft
+RUN chmod 777 /bin/ft
+
+
+
 # some custom libs for jlab
 COPY ./matrix_ft.py /usr/local/lib/python3.8/site-packages/matrix_ft.py

+ 2 - 2
jlab/matrix_ft.py

@@ -5,14 +5,14 @@ class Matrix(object):
     see https://github.com/hzeller/flaschen-taschen/blob/master/doc/protocols.md
     '''
 
-    def __init__(self, host, width, height, layer=0, x_offset=0, y_offset=0, transparent=False, port=1337):
+    def __init__(self, host, width, height, layer=1, x_offset=0, y_offset=0, transparent=False, port=1337):
         '''
         Args:
           host: The flaschen taschen server hostname or ip address.
           port: The flaschen taschen server port number.
           width: The width of the flaschen taschen display in pixels.
           height: The height of the flaschen taschen display in pixels.
-          layer: The layer of the flaschen taschen display to write to.
+          layer: The layer of the flaschen taschen display to write to. (layer=0 is permanent, layer > 0 decays, see --layer-timeout server opt)
           transparent: If true, black(0, 0, 0) will be transparent and show the layer below.
         '''
         self.width = width