From 41ea0e0747126e0ff5fc94445c63db5faa79de88 Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Mon, 21 Oct 2019 14:01:21 +0200 Subject: [PATCH] new: new ui.display.video.on_frame configuration to use fbi on framebuffer based screens --- pwnagotchi/defaults.yml | 4 ++++ pwnagotchi/ui/display.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/pwnagotchi/defaults.yml b/pwnagotchi/defaults.yml index d2e9d27..cc4fa51 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 c4fd495..c057922 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: