From 093cafa6db784bf759560c5544b02a47456ba435 Mon Sep 17 00:00:00 2001 From: Anton Grouchtchak Date: Fri, 13 Aug 2021 21:17:38 +0300 Subject: [PATCH 1/2] Add display_version.py --- display_version.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 display_version.py diff --git a/display_version.py b/display_version.py new file mode 100644 index 0000000..2c4e16f --- /dev/null +++ b/display_version.py @@ -0,0 +1,32 @@ +from pwnagotchi.ui.components import LabeledValue +from pwnagotchi.ui.view import BLACK +import pwnagotchi.plugins as plugins +import pwnagotchi.ui.fonts as fonts +import pwnagotchi +import logging + + +class PwnagotchiVersion(plugins.Plugin): + __author__ = 'https://github.com/Teraskull/' + __version__ = '1.0.0' + __license__ = 'GPL3' + __description__ = 'A plugin that will add the Pwnagotchi version to the left of the current mode.' + + def on_loaded(self): + logging.info('Pwnagotchi Version Plugin loaded.') + + def on_ui_setup(self, ui): + ui.add_element( + 'version', + LabeledValue( + color=BLACK, + label='', + value='v0.0.0', + position=(185, 110), + label_font=fonts.Small, + text_font=fonts.Small + ) + ) + + def on_ui_update(self, ui): + ui.set('version', f'v{pwnagotchi.__version__}') From 0f9273557563deb93aec10674df6b33884e46e5a Mon Sep 17 00:00:00 2001 From: Anton Grouchtchak Date: Fri, 13 Aug 2021 21:18:51 +0300 Subject: [PATCH 2/2] Add display_version.toml --- display_version.toml | 1 + 1 file changed, 1 insertion(+) create mode 100644 display_version.toml diff --git a/display_version.toml b/display_version.toml new file mode 100644 index 0000000..e9f7bcf --- /dev/null +++ b/display_version.toml @@ -0,0 +1 @@ +main.plugins.display_version.enabled = false