diff --git a/pwnagotchi/defaults.yml b/pwnagotchi/defaults.yml index d2e9d271..cc4fa517 100644 --- a/pwnagotchi/defaults.yml +++ b/pwnagotchi/defaults.yml @@ -204,6 +204,10 @@ ui: address: '0.0.0.0' origin: '*' port: 8080 + # command to be executed when a new png frame is available + # for instance, to use with framebuffer based displays: + # on_frame: 'fbi -a -d /dev/fb1 -T 1 /root/pwnagotchi.png' + on_frame: '' # bettercap rest api configuration diff --git a/pwnagotchi/ui/display.py b/pwnagotchi/ui/display.py index c4fd4952..c0579221 100644 --- a/pwnagotchi/ui/display.py +++ b/pwnagotchi/ui/display.py @@ -1,3 +1,4 @@ +import os import logging import pwnagotchi.plugins as plugins @@ -60,6 +61,12 @@ class Display(View): def _on_view_rendered(self, img): web.update_frame(img) + try: + if self._config['ui']['display']['video']['on_frame'] != '': + os.system(self._config['ui']['display']['video']['on_frame']) + except Exception as e: + logging.error("%s" % e) + if self._enabled: self._canvas = (img if self._rotation == 0 else img.rotate(self._rotation)) if self._implementation is not None: