Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add display_version plugin that shows the Pwnagotchi version #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions display_version.py
Original file line number Diff line number Diff line change
@@ -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__}')
1 change: 1 addition & 0 deletions display_version.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main.plugins.display_version.enabled = false