From 22e76f956cbe5e532d00c78072fd46e5198ccae6 Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Fri, 1 Nov 2019 17:45:53 +0100 Subject: [PATCH] fix: fixed memtemp for waveshare v2 --- pwnagotchi/plugins/default/memtemp.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pwnagotchi/plugins/default/memtemp.py b/pwnagotchi/plugins/default/memtemp.py index 521aa65..289fbab 100644 --- a/pwnagotchi/plugins/default/memtemp.py +++ b/pwnagotchi/plugins/default/memtemp.py @@ -41,13 +41,23 @@ class MemTemp(plugins.Plugin): return int(pwnagotchi.cpu_load() * 100) def on_ui_setup(self, ui): + # self._layout['width'] = 250 + # self._layout['height'] = 122 + + if ui.is_waveshare_v2(): + h_pos = (180, 76) + v_pos = (180, 61) + else: + h_pos = (155, 76) + v_pos = (180, 61) + if self.options['orientation'] == "horizontal": ui.add_element('memtemp', LabeledValue(color=BLACK, label='', value='mem cpu temp\n - - -', - position=(ui.width() / 2 + 30, ui.height() / 2 + 15), + position=h_pos, label_font=fonts.Small, text_font=fonts.Small)) elif self.options['orientation'] == "vertical": ui.add_element('memtemp', LabeledValue(color=BLACK, label='', value=' mem:-\n cpu:-\ntemp:-', - position=(ui.width() / 2 + 55, ui.height() / 2), + position=v_pos, label_font=fonts.Small, text_font=fonts.Small)) def on_ui_update(self, ui):