capyloon / nutria

Experimental Web Based OS Frontend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] Widgets

danimesq opened this issue · comments

Are there a documentation about developing widgets? Are 3rd-party widgets supported?

Currently widgets are similar to apps, only loaded in a smaller container on the homescreen. If you check the ones in apps/widgets/ you can see how to implement them.

There is no way to add new widgets to the homescreen currently (the weather and world clock ones are hardcoded in the initial content of the homescreen in https://github.com/capyloon/nutria/blob/main/apps/homescreen/resources/default/actions.json), and I'm not sure what the UX flow should look like. Maybe implementing an activity would be good enough!

Currently widgets are similar to apps, only loaded in a smaller container on the homescreen. If you check the ones in apps/widgets/ you can see how to implement them.

I love the idea that apps and widgets could share the same codebase.
So, there could be presets (such as sizes) and apps could adapt into their widget modes/forms.

Yes, absolutely. And an app could include a widget view in its own URL, calling the yet to be implemented activity to add it to the homescreen.

Maybe we could also support either manifest declaration of widgets, and a to discover them in web pages.

Yes, absolutely. And an app could include a widget view in its own URL, calling the yet to be implemented activity to add it to the homescreen.

The app itself calling to add its widget is quite interesting; personally haven't seen such behavior in apps before yet.

Also, Nutria could read the manifest.webapp of all apps, then form a list of widgets; so, when "right-clicking" in the Launcher, user will get a list of widgets available to add.