pixelserver2/config.py
2024-11-16 11:27:15 +01:00

100 lines
4.4 KiB
Python

import logging
from dataclasses import dataclass
from typing import Union, List
@dataclass
class AppConfig:
guiname: str
name: str
cmd: Union[List[str], str]
path: str = "./apps/"
persistent: bool = False
white: bool = False
def __post_init__(self):
if not isinstance(self.cmd, list):
self.cmd = [self.cmd]
# width
ScreenX = 80
# height
ScreenY = 40
DefaultBrightness = 0.6
Serial = "/dev/ttyACM0"
# kills app after some seconds if it sends no data
NoDataTimeout = 40
LogLevel = logging.DEBUG
UseGui = False
GuiFPS = 20
GuiScaleFactor = 15
WebHost = "0.0.0.0"
WebPort = 8000
Apps = [
# first app is always running as default
AppConfig(guiname="Backlight", name="backlight", cmd="./backlight.py", white=True),
AppConfig(guiname="Lines", name="lines", cmd="./lines.py"),
AppConfig(guiname="Wolfram", name="wolfram", cmd="./wolfram.py"),
AppConfig(guiname="Digi Clock", name="digiclock", cmd="./digi_clock.py"),
AppConfig(guiname="Text Scroller MQTT", name="textscroll", cmd="./textscroll.py"),
AppConfig(guiname="Spot", name="spot", cmd="./spot.py", white=True),
AppConfig(guiname="Flicker", name="flicker", cmd="./flicker"),
AppConfig(guiname="Pixelflut", name="pixelflut", cmd="./pixelflut", persistent=True),
# App(guiname="Pong", name="pong", cmd="pong.py"),
AppConfig(guiname="YoutubeDL", name="youtubedl", cmd="./youtubedl.sh"),
# App(guiname="Show Framebuffer", name="fbcp", cmd=["fbcp", "/dev/fb0"]),
AppConfig(guiname="Strobo", name="strobo", cmd="./strobo.py"),
# App(guiname="Beispiel", name="example", cmd="example.py"),
# App(guiname="Beispiel2", name="example2", cmd="example2.py", white=True),
AppConfig(guiname="Fibonacci Clock", name="fibonacci-clock", cmd="./fibonacci-clock.py"),
AppConfig(guiname="Wget Video/Gif/Images", name="wget", cmd="./wget.sh"),
# juergen/pixelfoo
AppConfig(guiname="Congress noise", name="cnoise", cmd="./cnoise", path="pixelfoo-apps/target/release/"),
AppConfig(guiname="Game of Life", name="life", cmd="./life", path="pixelfoo-apps/target/release/"),
AppConfig(guiname="Matrix Code", name="matrix-code", cmd="./matrix-code", path="pixelfoo-apps/target/release/"),
AppConfig(guiname="Lorenz Attractor", name="lorenz", cmd="./lorenz", path="pixelfoo-apps/target/release/"),
AppConfig(guiname="Primes", name="primes", cmd="./primes", path="pixelfoo-apps/target/release/"),
AppConfig(guiname="Alien Message", name="alien-message", cmd="./alien-message", path="pixelfoo-apps/target/release/"),
AppConfig(guiname="Dual Moodlight", name="bimood", cmd="./bimood", path="pixelfoo-apps/target/release/"),
AppConfig(guiname="Maze", name="maze", cmd="./maze", path="pixelfoo-apps/target/release/"),
AppConfig(guiname="Dual Maze", name="dualmaze", cmd="./dualmaze", path="pixelfoo-apps/target/release/"),
AppConfig(guiname="Predator & Prey", name="predprey", cmd="./predprey", path="pixelfoo-apps/target/release/"),
# App(guiname="Beat Saber Ceiling", name="beatsaberceiling", cmd="./beatsaberceiling.py", path="beatsaberceiling"),
# mathpixel
AppConfig(guiname="Structure formation", name="swifthohenberg", cmd="./swifthohenberg.py"),
AppConfig(guiname="Quadratisch", name="quadratic", cmd="./quadratic.py"),
AppConfig(guiname="Pendel", name="pendulum", cmd="./pendlum.py"),
AppConfig(guiname="Konvergenz", name="convergence", cmd="./convergence.py"),
AppConfig(guiname="Sinic", name="sinic", cmd="./sinic.py"),
AppConfig(guiname="Sinic 2", name="sinic2", cmd="./sinic2.py"),
# pixelthud
AppConfig(guiname="Fading Pixels", name="fadingpxls", cmd="./fading_pixels.py"),
AppConfig(guiname="Plane Wave", name="planewave", cmd="./plane_wave.py"),
AppConfig(guiname="Rock-paper-scissors-spock-lizard", name="rps", cmd="./rps.py"),
AppConfig(guiname="Doom Fire", name="doomfire", cmd="./doom_fire_psx2.py"),
# App(guiname="Maxwell FDTD", name="fdtd", cmd="./fdtd.py"),
# App(guiname="Stream", name="stream", cmd="./stream.sh"),
# App(guiname="Wget Video/Gif/Images", name="wget", cmd="./wget.sh"),
# App(guiname="Tetris", name="tetris", cmd="./deckentetris/deckentetris.py"),
# App(guiname="SkyScrapper", name="sky", cmd="./weather/main.py"),
# App(guiname="Strobo", name="strobo", cmd="./strobo.py"),
# App(guiname="Snake", name="snake", cmd="./snake.py"),
# App(name="gif", cmd="./gif.sh"),
# App(name="colormap", cmd="./colormap.py"),
]