jayofelony / pwnagotchi

(⌐■_■) - Deep Reinforcement Learning instrumenting bettercap for WiFi pwning.
Other
1.05k stars 119 forks source link

Feature idea: split all UI code from the core #159

Closed iandouglas closed 5 months ago

iandouglas commented 6 months ago

Is your feature request related to a problem? Please describe. It can be frustrating to want to change the UI of the display of information but some parts of it are embedded in areas of the code that are not part of "ui" or being unable to customize exactly what goes where on the screen. Next time a pwnagotchi code update is released, we all have to re-patch the code we're tweaking to put things where we want it to be.

One thing I'm commonly doing more and more is moving elements around on the screen, like I have my pwny's "name" on the first line of text where APs/CH usually show up (I'd rather have those at the bottom near the number of handshakes), and what if the face were elsewhere on the screen, or not at all? It's very hard to customize some of this without changing much of the code.

I've looked into the "tweak" plugin and it's a fantastic start. But I'd like to suggest something even more bold (and much more complex, definitely could be a breaking change):

Describe the solution you'd like What if we treated the code base more like a "full-stack" application, where everything about the display is customizable by the user via config, even the "voices". Maybe it's in its own "ui.toml" file.

Specifically, let's move a bunch of stuff from ui/view.py to something more configurable by the user like where they want to put the pieces on the screen (or not at all). I'm not suggesting reinventing CSS for this project, but maybe the 'tweak' plugin could be rolled into the code code and move several things out to be customizable by the user.

Examples: I personally don't care about the uptime on the screen all the time. And while I have several pwny's on the workbench, I don't really use the "friend" option for anything, so I'd like to not enable that. But things like the "age" and "experience" custom plugins, heck yeah ... I'd love those to be front-and-center, but that usually means tweaking my "face" font size to be smaller. But to do that I have to go tweak my ui/hw/waveshare????.py file every time I make a new pwny.

And for the paranoid among us ... having "PWND" on the screen or other language about "kickban", "hacking", or the content seen in "last session data", I'd like to change the wording ... even the vulgarity for being "demotivated" ... those should be easier to customize without having to tweak core code every time there's an update to pwnagotchi.

Describe alternatives you've considered I've debated forking the project and just redoing the whole UI piece, but I don't really want to maintain a whole fork of a project. :)

rai68 commented 5 months ago

Im not sure how splitting the UI code even would work since pwnagotchi is already kind of split into 5 different python classes

  1. UI
  2. plugins
  3. bettercap agent
  4. AI agent
  5. main class

if UI was ultra customisable by default it would require plugins to be altered as well, and we cannot exactly do that since theyre community made.

frankly everything you want can already be done by tweakview, and that plugin is not ours to control the creator of it would need to merge its base into this fork of pwnagotchi so sadly its not up to us.

As for changing of words you can manually clone the pwnagotchi/locale/voice.pot file into its own folder with a code as its name and use that in the language config when you want to change things