pimoroni-pico
pimoroni-pico copied to clipboard
Modified Launcher not loading up when reset button is pressed or when A+C pressed
So I have made a modified Launcher with a couple of badges I can switch between. And apparently when I press A+C all of my icons that I have added disappears.
I am currently on the latest BadgeOS as well 1.19.7
My Ammanded launcher is copied from the Examples Repo and I have removed the buttons I don't need and added my new badges
Hmmm I think this is because main.py is just import _launcher but it should be something like:
try:
import launcher
except ImportError
import _launcher
You can probably make this tweak manually to fix your setup.
Looks like this is a bug in boot.py that doesn't account for a custom launcher when writing the default main.py: https://github.com/pimoroni/pimoroni-pico/blob/05ef0d7f037ad5050d8612d23c9829e0e6f29204/micropython/examples/badger2040/assets/boot.py#L5
Hey thanks for your suggestion appriicate your help.
I have tried it and when pressing reset the E Ink display didm't refresh.
try:
import launcher
except ImportError
import _launcher
Honetly I don't know why it didn't work cause it looks write soo
So I have thought of renaming the ammanded Launcher to launcherNew
and have edited boot.py to look something like this
try:
open("main.py", "r")
except OSError:
with open("main.py", "w") as f:
f.write("import _launcherNew")
f.flush()
and have edited main.py to
import launcherNew
Just tested it and it works now
Oh it should have been:
try:
import launcher
except ImportError:
import _launcher
note the missing ":". I wondered why the syntax highlighting was broken! :facepalm:
Closing this issue as it appears the code offered by Gadgetoid fixed the wrong launcher loading. If it did not, please reopen.