Suggestion: Custom Standby Menu Features

I don’t know if this has been suggested but something that would be amazing is if we could have the ability to add additional menu’s/information screens to the pre-packaged ones. Such as a menu that can show core speeds and temperatures, additional network information, additional battery information (such as time remaining), or even other custom items that may need to run as a service on the operating system.

This would enable the pi-top to be a personally customized and project-upgradable device, since we could add our own features to the hotkeys and OLED display.

:slight_smile:

@Supernovali this is a great suggestion, and I’m glad you’ve posted it as we have been discussing this internally too :grinning:

We essentially want to do exactly what you are asking, including being able to run simple python projects from the menu - we just need some time to refactor the current system OLED menu to make this possible, watch this space! :+1:

Noice! I look forward to this feature. I feel like this feature in of itself makes the [4] feel even more feature rich.

I’ll keep my eyes open :blush:

1 Like

it is possible to do as it it by modifying the existing code, i added a reboot option, cant remember how i done it as it was a while ago and forgot to back up the files :frowning: but an easier way would be nice to have.

I actually used the oled scripts to learn how to use the OLED screen and also go though the ptoled library for python

@CAProjects good effort! Well it does seem like this would be a really useful feature, I’ll try and bump it up the priority list :grinning:

In the meantime, if you and others can list specifics of what you would like to do with the OLED menu we can use that to spec out the design to suit :+1:

@CAProjects I havent had a chance to go through the code as of yet, but I was starting to delve into source files yesterday before I was informed that an OLED update was being pushed. I was going to check for a solution to another issue. If you can remember, thatd be great!

@duwudi The ability to run python scripts would be one of the more powerful features. I’m not sure quite how the current menu items are run, if they are part of a single source file, or as seperate source files, but if an index could be created, where we can add a python source file path to the list, causing the script to run when we scroll to the menu item would be the biggest feature we could get in the meantime. We could add virtually limitless features by being able to run a script when we reach that script by scrolling into its menu item.

For example, does the CPU workload screen run as its own script and file? Or is it a subroutine of the main script? I’d there was a way to extend the menu and an API for a sub-menu system where we could generate our own menus and attatch them to the base menu, that would be a plus too.

@Supernovali the current system OLED menu was developed a while ago and my knowledge of how it works is not that great :neutral_face:

I’ve asked @pi-topMIKE to respond instead as he has done a lot of thinking of a new architecture to allow this kind of thing already :+1:

That would be nice, especially with the sdk available, maybe some sort of config or an auto import or something to help others add items or even make a new menu system or something to suit their needs

The ability to run a python script from the menu, i.e. to control or interact with a hat or other peripheral would be a great feature. The main reason I purchased the unit was to allow me to take my pi on the road more and be less reliant on available power and networks so anything
that gives more control using the OLED screen and buttons would be a big advantage and great USP.

@duwudi Wait, new architecture as in new hardware for the pi-top or for the API? I think I’m going to use today to delve into the source files a bit and see what I can tinker with as well.

Think of it as a new framework for the software, not the hardware

Yeah, so for the API. I’ve just never heard it called an architecture before unless it dealt with instructions and layout on the hardware level of a device. I just normally hear it as framework or API.

Anyways, this is what I’ve discovered so far:

Relating to the OLED display, there are two folders of significance. First and foremost is the

/usr/lib/pt-sys-oled/

Within this folder are the scripts that control the menu from button press to the “widgets”… not a bad name for an OLED applet that runs in the OLED. I’ll refer to this as the main folder.

The other one that we need to be concerned with is:

/etc/systemd/system/multi-user.target.wants

In this folder is the system service file that tells the system how to start the scripts, when to start them, and what they need to run. In this folder, the particular service is “pt-sys-oled.service”. We will use this file to stop and restart the service when we make changes to the first folder’s files, instead of rebooting every single time we want a change applied.


Here is a proof of concept tutorial:

Open an explorer window and navigate to our main folder and open the “components” folder. In here, open a terminal by using the “Tools” menu and open a terminal here. Then open the “Menu.py” by typing

sudo nano ./Menu.py

Now use the arrow keys to scroll down into “Class pageHelper” and to the definition “def get_pages_for_menu”. Go to the cpu item and change the “interval” attribute to one tenth of a second instead of half a second so it shows:

interval=0.1

Hit CTRL+S, then CTRL+X to save and close nano. Now we stop the service and restart it. Enter:

sudo systemctl stop pt-sys-oled.service

You will see the OLED freeze for a couple seconds and then go blank. Then enter:

sudo systemctl start pt-sys-oled.service

The service will restart. Now, when you go down to the CPU load menu option, look how much faster it now updates. Even as I’m typing this proof of concept, I’m watching all of the cores jump every time I press a new key as the browser updates the screen and performs spell checking and the likes :slight_smile:

Enjoy.


I might make a new thread to go over this and play with some of the widgets as well as figure out how to create new ones until the framework makes menu item creation easier.

I also discovered other hidden widgets in the scripts and folders but haven’t explored these yet. I’ve literally been watching the kiddo most of this morning and got back to this about an hour and a half ago and this is what I’ve managed to come up with :wink:

Ok, so, upon further inspection of the other widgets available, it looks like these widgets are currently “depricated” and require modification to run like the others. I’ve found a “main” template for the way a widget should be structured, but it will take significantly more time to determine what each portion is doing, since there arent a whole lot of notes in these widgets.

@duwudi Do you suppose you could also talk to Mike about adding comments to these files and I could take a deeper dive into it? I do have a few other things I’m doing and I don’t want to spend too much time and energy if you guys are planning on making this a feature of the pi-top in the near future.

Thanks!