diff --git a/bin/pwnagotchi b/bin/pwnagotchi index 65aea2f2..66bc9ed1 100755 --- a/bin/pwnagotchi +++ b/bin/pwnagotchi @@ -7,6 +7,7 @@ import sys import toml import requests import os +import re import pwnagotchi from pwnagotchi import utils @@ -133,6 +134,8 @@ if __name__ == '__main__': help="Print the configuration.") # Jayofelony added these + parser.add_argument('--wizard', dest="wizard", action="store_true", default=False, + help="Interactive installation of your personal configuration.") parser.add_argument('--check-update', dest="check_update", action="store_true", default=False, help="Check for updates on Pwnagotchi. And tells current version.") parser.add_argument('--donate', dest="donate", action="store_true", default=False, @@ -157,6 +160,102 @@ if __name__ == '__main__': print(pwnagotchi.__version__) sys.exit(0) + if args.wizard: + def is_valid_hostname(hostname): + if len(hostname) > 255: + return False + if hostname[-1] == ".": + hostname = hostname[:-1] # strip exactly one dot from the right, if present + allowed = re.compile("(?!-)[A-Z\d-]{1,63}(? 0: + f.write("main.whitelist = [\n") + for x in range(int(pwn_whitelist)): + ssid = input("SSID (Name): ") + bssid = input("BSSID (MAC): ") + f.write(f"\t\"{ssid}\",\n") + f.write(f"\t\"{bssid}\",\n") + f.write("]\n") + # set bluetooth tether + pwn_bluetooth = input("Do you want to enable BT-Tether? [Y/N] ") + if pwn_bluetooth.lower() in ('y', 'yes'): + f.write("main.plugins.bt-tether.enabled = true\n\n") + pwn_bluetooth_device = input("What device do you use? Android or iOS? ") + if pwn_bluetooth_device.lower() == "android": + f.write("main.plugins.bt-tether.devices.android-phone.enabled = true\n") + pwn_bluetooth_mac = input("What is the bluetooth MAC of your device? ") + if pwn_bluetooth_mac != "": + f.write(f"main.plugins.bt-tether.devices.android-phone.mac = \"{pwn_bluetooth_mac}\"\n") + elif pwn_bluetooth_device.lower() == "ios": + f.write("main.plugins.bt-tether.devices.ios-phone.enabled = true\n") + pwn_bluetooth_mac = input("What is the bluetooth MAC of your device? ") + if pwn_bluetooth_mac != "": + f.write(f"main.plugins.bt-tether.devices.ios-phone.mac = \"{pwn_bluetooth_mac}\"\n") + # set up display settings + pwn_display_enabled = input("Do you use a display? [Y/N] ") + if pwn_display_enabled.lower() in ('y', 'yes'): + f.write("ui.display.enabled = true\n") + pwn_display_type = input("What display do you use?\n\n" + "Be sure to check for the correct display type @ \n" + "https://github.com/jayofelony/pwnagotchi/blob/master/pwnagotchi/utils.py#L240-L431\n") + if pwn_display_type != "": + f.write(f"ui.display.type = \"{pwn_display_type}\"\n") + pwn_display_invert = input("Do you want to invert the display colors? [Y/N]\n\n" + "N = Black background\n" + "Y = White background\n") + if pwn_display_invert.lower() in ('y', 'yes'): + f.write("ui.invert = true\n") + f.close() + if pwn_bluetooth.lower() in ('y', 'yes'): + if pwn_bluetooth_device.lower == "android": + print("To visit the webui when connected with your phone, visit: http://192.168.44.44:8080\n" + "Your configuration is done, and I will restart in 5 seconds.") + elif pwn_bluetooth_device.lower == "ios": + print("To visit the webui when connected with your phone, visit: http://172.20.10.6:8080\n" + "Your configuration is done, and I will restart in 5 seconds.") + else: + print("Your configuration is done, and I will restart in 5 seconds.") + time.sleep(5) + os.system("service pwnagotchi restart") + else: + print("Ok, doing nothing.") + sys.exit(0) + if args.donate: print("Donations can made @ \n " "https://www.patreon.com/pwnagotchi_torch \n " @@ -172,7 +271,7 @@ if __name__ == '__main__': local = version_to_tuple(pwnagotchi.__version__) remote = version_to_tuple(latest_ver) if remote > local: - user_input = input("There is a new version available! Update from v%s to v%s?\n[y(es)/n(o)]" + user_input = input("There is a new version available! Update from v%s to v%s?\n[Y/N] " % (pwnagotchi.__version__, latest_ver)) # input validation if user_input.lower() in ('y', 'yes'): diff --git a/builder/data/32bit/raspberrypi32.yml b/builder/data/32bit/raspberrypi32.yml index 8fae65a2..8af1d53f 100644 --- a/builder/data/32bit/raspberrypi32.yml +++ b/builder/data/32bit/raspberrypi32.yml @@ -383,6 +383,11 @@ block: | export GOPATH=$HOME/go export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin + alias custom='cd /usr/local/share/pwnagotchi/custom-plugins/' + alias config='sudo nano /etc/pwnagotchi/config.toml' + alias pwnlog='tail -f -n300 /etc/pwnagotchi/log/pwn*.log | sed --unbuffered \"s/,[[:digit:]]\\{3\\}\\]//g\" | cut -d \" \" -f 2-' + alias pwnver='python3 -c \"import pwnagotchi as p; print(p.__version__)\"' + alias pwnkill='sudo killall -USR1 pwnagotchi' when: golang.changed - name: download pwngrid @@ -451,7 +456,7 @@ # Add your configuration overrides on this file any configuration changes done to default.toml will be lost! # Example: # ui.display.enabled = true - # ui.display.type = "waveshare_2" + # ui.display.type = "waveshare_4" when: not user_config.stat.exists - name: Delete motd 10-uname @@ -494,24 +499,6 @@ regexp: '(.*)$' line: '\1 modules-load=dwc2,g_ether' - - name: Add pwnlog alias - lineinfile: - dest: /home/pi/.bashrc - line: "\nalias pwnlog='tail -f -n300 /etc/pwnagotchi/log/pwn*.log | sed --unbuffered \"s/,[[:digit:]]\\{3\\}\\]//g\" | cut -d \" \" -f 2-'" - insertafter: EOF - - - name: Add pwnver alias - lineinfile: - dest: /home/pi/.bashrc - line: "\nalias pwnver='python3 -c \"import pwnagotchi as p; print(p.__version__)\"'" - insertafter: EOF - - - name: Add pwnkill alias to restart pwnagotchi with a signal - lineinfile: - dest: /home/pi/.bashrc - line: "\nalias pwnkill='sudo killall -USR1 pwnagotchi'" - insertafter: EOF - - name: add firmware packages to hold dpkg_selections: name: "{{ item }}" diff --git a/builder/data/64bit/etc/bash_completion.d/pwnagotchi_completion.sh b/builder/data/64bit/etc/bash_completion.d/pwnagotchi_completion.sh index 8424a534..68edc4e9 100644 --- a/builder/data/64bit/etc/bash_completion.d/pwnagotchi_completion.sh +++ b/builder/data/64bit/etc/bash_completion.d/pwnagotchi_completion.sh @@ -2,7 +2,7 @@ _show_complete() { local cur opts node_names all_options opt_line all_options=" -pwnagotchi -h --help -C --config -U --user-config --manual --skip-session --clear --debug --version --print-config --check-update --donate {plugins,google} +pwnagotchi -h --help -C --config -U --user-config --manual --skip-session --clear --debug --version --print-config --wizard --check-update --donate {plugins,google} pwnagotchi plugins -h --help {list,install,enable,disable,uninstall,update,upgrade} pwnagotchi plugins list -i --installed -h --help pwnagotchi plugins install -h --help diff --git a/builder/data/64bit/etc/update-motd.d/01-motd b/builder/data/64bit/etc/update-motd.d/01-motd index 31f6c6bd..1f9d52d2 100755 --- a/builder/data/64bit/etc/update-motd.d/01-motd +++ b/builder/data/64bit/etc/update-motd.d/01-motd @@ -20,6 +20,7 @@ echo " I'm managed by systemd. Here are some basic commands." echo echo " If you want to know what I'm doing, you can check my logs with the command" echo " - pwnlog" +echo " - sudo pwnagotchi --wizard, to help set up a config.toml" echo " - sudo pwnagotchi --version, to check the current version" echo " - sudo pwnagotchi --donate, to see how you can donate to this project" echo " - sudo pwnagotchi --check-update, to see if there is a new version available" diff --git a/builder/data/64bit/raspberrypi64.yml b/builder/data/64bit/raspberrypi64.yml index c3aa52a3..740f8d38 100644 --- a/builder/data/64bit/raspberrypi64.yml +++ b/builder/data/64bit/raspberrypi64.yml @@ -497,6 +497,11 @@ block: | export GOPATH=$HOME/go export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin + alias custom='cd /usr/local/share/pwnagotchi/custom-plugins/' + alias config='sudo nano /etc/pwnagotchi/config.toml' + alias pwnlog='tail -f -n300 /etc/pwnagotchi/log/pwn*.log | sed --unbuffered \"s/,[[:digit:]]\\{3\\}\\]//g\" | cut -d \" \" -f 2-' + alias pwnver='python3 -c \"import pwnagotchi as p; print(p.__version__)\"' + alias pwnkill='sudo killall -USR1 pwnagotchi' when: golang.changed - name: download pwngrid @@ -585,7 +590,7 @@ # Add your configuration overrides on this file any configuration changes done to default.toml will be lost! # Example: # ui.display.enabled = true - # ui.display.type = "waveshare_2" + # ui.display.type = "waveshare_4" when: not user_config.stat.exists - name: Delete motd @@ -598,24 +603,6 @@ state: absent path: /etc/update-motd.d/10-uname - - name: Add pwnlog alias - lineinfile: - dest: /home/pi/.bashrc - line: "\nalias pwnlog='tail -f -n300 /etc/pwnagotchi/log/pwn*.log | sed --unbuffered \"s/,[[:digit:]]\\{3\\}\\]//g\" | cut -d \" \" -f 2-'" - insertafter: EOF - - - name: Add pwnver alias - lineinfile: - dest: /home/pi/.bashrc - line: "\nalias pwnver='python3 -c \"import pwnagotchi as p; print(p.__version__)\"'" - insertafter: EOF - - - name: Add pwnkill alias to restart pwnagotchi with a signal - lineinfile: - dest: /home/pi/.bashrc - line: "\nalias pwnkill='sudo killall -USR1 pwnagotchi'" - insertafter: EOF - - name: add firmware packages to hold dpkg_selections: name: "{{ item }}" diff --git a/pwnagotchi/defaults.toml b/pwnagotchi/defaults.toml index ddfcc9e0..5fdc276e 100644 --- a/pwnagotchi/defaults.toml +++ b/pwnagotchi/defaults.toml @@ -32,7 +32,7 @@ main.plugins.bt-tether.devices.android-phone.netmask = 24 main.plugins.bt-tether.devices.android-phone.interval = 1 main.plugins.bt-tether.devices.android-phone.scantime = 10 main.plugins.bt-tether.devices.android-phone.max_tries = 10 -main.plugins.bt-tether.devices.android-phone.share_internet = false +main.plugins.bt-tether.devices.android-phone.share_internet = true main.plugins.bt-tether.devices.android-phone.priority = 1 main.plugins.bt-tether.devices.ios-phone.enabled = false @@ -43,7 +43,7 @@ main.plugins.bt-tether.devices.ios-phone.netmask = 24 main.plugins.bt-tether.devices.ios-phone.interval = 5 main.plugins.bt-tether.devices.ios-phone.scantime = 20 main.plugins.bt-tether.devices.ios-phone.max_tries = 0 -main.plugins.bt-tether.devices.ios-phone.share_internet = false +main.plugins.bt-tether.devices.ios-phone.share_internet = true main.plugins.bt-tether.devices.ios-phone.priority = 999 main.plugins.fix_services.enabled = true @@ -154,6 +154,8 @@ personality.throttle_d = 0.9 personality.clear_on_exit = true # clear display when shutting down cleanly +ui.invert = false # false = black background, true = white background + ui.fps = 0.0 ui.font.name = "DejaVuSansMono" # for japanese: fonts-japanese-gothic ui.font.size_offset = 0 # will be added to the font size diff --git a/pwnagotchi/ui/hw/waveshare2in13.py b/pwnagotchi/ui/hw/waveshare2in13.py index de6c29b7..b720b555 100644 --- a/pwnagotchi/ui/hw/waveshare2in13.py +++ b/pwnagotchi/ui/hw/waveshare2in13.py @@ -9,81 +9,38 @@ class WaveshareV1(DisplayImpl): super(WaveshareV1, self).__init__(config, 'waveshare_1') def layout(self): - if self.config['color'] == 'black': - fonts.setup(10, 9, 10, 35, 25, 9) - self._layout['width'] = 250 - self._layout['height'] = 122 - self._layout['face'] = (0, 40) - self._layout['name'] = (5, 20) - self._layout['channel'] = (0, 0) - self._layout['aps'] = (28, 0) - self._layout['uptime'] = (185, 0) - self._layout['line1'] = [0, 14, 250, 14] - self._layout['line2'] = [0, 108, 250, 108] - self._layout['friend_face'] = (0, 92) - self._layout['friend_name'] = (40, 94) - self._layout['shakes'] = (0, 109) - self._layout['mode'] = (225, 109) - self._layout['status'] = { - 'pos': (125, 20), - 'font': fonts.status_font(fonts.Medium), - 'max': 20 - } - else: - fonts.setup(10, 8, 10, 25, 25, 9) - self._layout['width'] = 212 - self._layout['height'] = 104 - self._layout['face'] = (0, 26) - self._layout['name'] = (5, 15) - self._layout['channel'] = (0, 0) - self._layout['aps'] = (28, 0) - self._layout['uptime'] = (147, 0) - self._layout['line1'] = [0, 12, 212, 12] - self._layout['line2'] = [0, 92, 212, 92] - self._layout['friend_face'] = (0, 76) - self._layout['friend_name'] = (40, 78) - self._layout['shakes'] = (0, 93) - self._layout['mode'] = (187, 93) - self._layout['status'] = { - 'pos': (91, 15), - 'font': fonts.status_font(fonts.Medium), - 'max': 20 - } + fonts.setup(10, 8, 10, 35, 25, 9) + self._layout['width'] = 250 + self._layout['height'] = 122 + self._layout['face'] = (0, 40) + self._layout['name'] = (5, 20) + self._layout['channel'] = (0, 0) + self._layout['aps'] = (28, 0) + self._layout['uptime'] = (185, 0) + self._layout['line1'] = [0, 14, 250, 14] + self._layout['line2'] = [0, 108, 250, 108] + self._layout['friend_face'] = (0, 92) + self._layout['friend_name'] = (40, 94) + self._layout['shakes'] = (0, 109) + self._layout['mode'] = (225, 109) + self._layout['status'] = { + 'pos': (125, 20), + 'font': fonts.status_font(fonts.Medium), + 'max': 20 + } return self._layout def initialize(self): - if self.config['color'] == 'black': - logging.info("initializing waveshare v2in13_V1 display in monochromatic mode") - from pwnagotchi.ui.hw.libs.waveshare.v2in13_V1.epd2in13 import EPD - self._display = EPD() - self._display.init(self._display.lut_full_update) - self._display.Clear(0xFF) - self._display.init(self._display.lut_partial_update) - elif self.config['color'] == 'fastAndFurious': - logging.info("initializing waveshare v2in13_V1 3-color display in FAST MODE") - logging.info("THIS MAY BE POTENTIALLY DANGEROUS. NO WARRANTY IS PROVIDED") - logging.info("USE THIS DISPLAY IN THIS MODE AT YOUR OWN RISK") - from pwnagotchi.ui.hw.libs.waveshare.v2in13_V1.epd2in13bcFAST import EPD - self._display = EPD() - self._display.init() - self._display.Clear() - else: - logging.info("initializing waveshare v2in13_V1 display 3-color mode") - from pwnagotchi.ui.hw.libs.waveshare.v2in13_V1.epd2in13bc import EPD - self._display = EPD() - self._display.init() - self._display.Clear() + logging.info("initializing waveshare v2in13_V1 display in monochromatic mode") + from pwnagotchi.ui.hw.libs.waveshare.v2in13_V1.epd2in13 import EPD + self._display = EPD() + self._display.init(self._display.lut_full_update) + self._display.Clear(0xFF) + self._display.init(self._display.lut_partial_update) def render(self, canvas): - if self.config['color'] == 'black': - buf = self._display.getbuffer(canvas) - self._display.display(buf) - elif self.config['color'] == 'fastAndFurious': - buf_black = self._display.getbuffer(canvas) - self._display.DisplayPartial(buf_black) - else: - buf_black = self._display.getbuffer(canvas) - self._display.displayBlack(buf_black) + buf = self._display.getbuffer(canvas) + self._display.display(buf) def clear(self): self._display.Clear(0xff) diff --git a/pwnagotchi/ui/hw/waveshare2in13_V2.py b/pwnagotchi/ui/hw/waveshare2in13_V2.py index 76c48ad0..48042746 100644 --- a/pwnagotchi/ui/hw/waveshare2in13_V2.py +++ b/pwnagotchi/ui/hw/waveshare2in13_V2.py @@ -9,47 +9,25 @@ class WaveshareV2(DisplayImpl): super(WaveshareV2, self).__init__(config, 'waveshare_2') def layout(self): - if self.config['color'] == 'black': - fonts.setup(10, 9, 10, 35, 25, 9) - self._layout['width'] = 250 - self._layout['height'] = 122 - self._layout['face'] = (0, 40) - self._layout['name'] = (5, 20) - self._layout['channel'] = (0, 0) - self._layout['aps'] = (28, 0) - self._layout['uptime'] = (185, 0) - self._layout['line1'] = [0, 14, 250, 14] - self._layout['line2'] = [0, 108, 250, 108] - self._layout['friend_face'] = (0, 92) - self._layout['friend_name'] = (40, 94) - self._layout['shakes'] = (0, 109) - self._layout['mode'] = (225, 109) - self._layout['status'] = { - 'pos': (125, 20), - 'font': fonts.status_font(fonts.Medium), - 'max': 20 - } - else: - fonts.setup(10, 8, 10, 25, 25, 9) - self._layout['width'] = 212 - self._layout['height'] = 104 - self._layout['face'] = (0, 26) - self._layout['name'] = (5, 15) - self._layout['channel'] = (0, 0) - self._layout['aps'] = (28, 0) - self._layout['status'] = (91, 15) - self._layout['uptime'] = (147, 0) - self._layout['line1'] = [0, 12, 212, 12] - self._layout['line2'] = [0, 92, 212, 92] - self._layout['friend_face'] = (0, 76) - self._layout['friend_name'] = (40, 78) - self._layout['shakes'] = (0, 93) - self._layout['mode'] = (187, 93) - self._layout['status'] = { - 'pos': (125, 20), - 'font': fonts.status_font(fonts.Medium), - 'max': 14 - } + fonts.setup(10, 8, 10, 35, 25, 9) + self._layout['width'] = 250 + self._layout['height'] = 122 + self._layout['face'] = (0, 40) + self._layout['name'] = (5, 20) + self._layout['channel'] = (0, 0) + self._layout['aps'] = (28, 0) + self._layout['uptime'] = (185, 0) + self._layout['line1'] = [0, 14, 250, 14] + self._layout['line2'] = [0, 108, 250, 108] + self._layout['friend_face'] = (0, 92) + self._layout['friend_name'] = (40, 94) + self._layout['shakes'] = (0, 109) + self._layout['mode'] = (225, 109) + self._layout['status'] = { + 'pos': (125, 20), + 'font': fonts.status_font(fonts.Medium), + 'max': 20 + } return self._layout def initialize(self): diff --git a/pwnagotchi/ui/hw/waveshare2in13b_V3.py b/pwnagotchi/ui/hw/waveshare2in13b_V3.py index 9c13436d..c5c96453 100644 --- a/pwnagotchi/ui/hw/waveshare2in13b_V3.py +++ b/pwnagotchi/ui/hw/waveshare2in13b_V3.py @@ -10,47 +10,25 @@ class Waveshare2in13bV3(DisplayImpl): super(Waveshare2in13bV3, self).__init__(config, 'waveshare2in13b_v3') def layout(self): - if self.config['color'] == 'black': - fonts.setup(10, 9, 10, 35, 25, 9) - self._layout['width'] = 250 - self._layout['height'] = 122 - self._layout['face'] = (0, 40) - self._layout['name'] = (5, 20) - self._layout['channel'] = (0, 0) - self._layout['aps'] = (28, 0) - self._layout['uptime'] = (185, 0) - self._layout['line1'] = [0, 14, 250, 14] - self._layout['line2'] = [0, 108, 250, 108] - self._layout['friend_face'] = (0, 92) - self._layout['friend_name'] = (40, 94) - self._layout['shakes'] = (0, 109) - self._layout['mode'] = (225, 109) - self._layout['status'] = { - 'pos': (125, 20), - 'font': fonts.status_font(fonts.Medium), - 'max': 20 - } - else: - fonts.setup(10, 8, 10, 25, 25, 9) - self._layout['width'] = 212 - self._layout['height'] = 104 - self._layout['face'] = (0, 26) - self._layout['name'] = (5, 15) - self._layout['channel'] = (0, 0) - self._layout['aps'] = (28, 0) - self._layout['status'] = (91, 15) - self._layout['uptime'] = (147, 0) - self._layout['line1'] = [0, 12, 212, 12] - self._layout['line2'] = [0, 92, 212, 92] - self._layout['friend_face'] = (0, 76) - self._layout['friend_name'] = (40, 78) - self._layout['shakes'] = (0, 93) - self._layout['mode'] = (187, 93) - self._layout['status'] = { - 'pos': (125, 20), - 'font': fonts.status_font(fonts.Medium), - 'max': 14 - } + fonts.setup(10, 9, 10, 35, 25, 9) + self._layout['width'] = 250 + self._layout['height'] = 122 + self._layout['face'] = (0, 40) + self._layout['name'] = (5, 20) + self._layout['channel'] = (0, 0) + self._layout['aps'] = (28, 0) + self._layout['uptime'] = (185, 0) + self._layout['line1'] = [0, 14, 250, 14] + self._layout['line2'] = [0, 108, 250, 108] + self._layout['friend_face'] = (0, 92) + self._layout['friend_name'] = (40, 94) + self._layout['shakes'] = (0, 109) + self._layout['mode'] = (225, 109) + self._layout['status'] = { + 'pos': (125, 20), + 'font': fonts.status_font(fonts.Medium), + 'max': 20 + } return self._layout def initialize(self): diff --git a/pwnagotchi/ui/hw/waveshare2in13b_V4.py b/pwnagotchi/ui/hw/waveshare2in13b_V4.py index 1b190d14..7cc5a543 100644 --- a/pwnagotchi/ui/hw/waveshare2in13b_V4.py +++ b/pwnagotchi/ui/hw/waveshare2in13b_V4.py @@ -10,47 +10,25 @@ class Waveshare213bV4(DisplayImpl): super(Waveshare213bV4, self).__init__(config, 'waveshare2in13b_v4') def layout(self): - if self.config['color'] == 'black': - fonts.setup(10, 9, 10, 35, 25, 9) - self._layout['width'] = 250 - self._layout['height'] = 122 - self._layout['face'] = (0, 40) - self._layout['name'] = (5, 20) - self._layout['channel'] = (0, 0) - self._layout['aps'] = (28, 0) - self._layout['uptime'] = (185, 0) - self._layout['line1'] = [0, 14, 250, 14] - self._layout['line2'] = [0, 108, 250, 108] - self._layout['friend_face'] = (0, 92) - self._layout['friend_name'] = (40, 94) - self._layout['shakes'] = (0, 109) - self._layout['mode'] = (225, 109) - self._layout['status'] = { - 'pos': (125, 20), - 'font': fonts.status_font(fonts.Medium), - 'max': 20 - } - else: - fonts.setup(10, 8, 10, 25, 25, 9) - self._layout['width'] = 212 - self._layout['height'] = 104 - self._layout['face'] = (0, 26) - self._layout['name'] = (5, 15) - self._layout['channel'] = (0, 0) - self._layout['aps'] = (28, 0) - self._layout['status'] = (91, 15) - self._layout['uptime'] = (147, 0) - self._layout['line1'] = [0, 12, 212, 12] - self._layout['line2'] = [0, 92, 212, 92] - self._layout['friend_face'] = (0, 76) - self._layout['friend_name'] = (40, 78) - self._layout['shakes'] = (0, 93) - self._layout['mode'] = (187, 93) - self._layout['status'] = { - 'pos': (125, 20), - 'font': fonts.status_font(fonts.Medium), - 'max': 14 - } + fonts.setup(10, 9, 10, 35, 25, 9) + self._layout['width'] = 250 + self._layout['height'] = 122 + self._layout['face'] = (0, 40) + self._layout['name'] = (5, 20) + self._layout['channel'] = (0, 0) + self._layout['aps'] = (28, 0) + self._layout['uptime'] = (185, 0) + self._layout['line1'] = [0, 14, 250, 14] + self._layout['line2'] = [0, 108, 250, 108] + self._layout['friend_face'] = (0, 92) + self._layout['friend_name'] = (40, 94) + self._layout['shakes'] = (0, 109) + self._layout['mode'] = (225, 109) + self._layout['status'] = { + 'pos': (125, 20), + 'font': fonts.status_font(fonts.Medium), + 'max': 20 + } return self._layout def initialize(self): diff --git a/pwnagotchi/ui/hw/waveshare2in7_V2.py b/pwnagotchi/ui/hw/waveshare2in7_V2.py index 42272fb6..e8d4cfcd 100644 --- a/pwnagotchi/ui/hw/waveshare2in7_V2.py +++ b/pwnagotchi/ui/hw/waveshare2in7_V2.py @@ -35,13 +35,11 @@ class Waveshare27inchV2(DisplayImpl): from pwnagotchi.ui.hw.libs.waveshare.v2in7_v2.epd2in7_V2 import EPD self._display = EPD() self._display.init() - # this must have changed by waveshare - # remove the 0xFF(Clear(0xFF)) other wise it errors. can't pass oxff and self self._display.Clear() def render(self, canvas): buf = self._display.getbuffer(canvas) - self._display.display_Partial(buf, 0, 0, 176, 264) + self._display.display_Fast(buf) def clear(self): # This line also removes the 0xFF