NebiDE Wallpaper Engine#
Creating Widgets#
Starting from NebiOS 3.2, third-party widgets are supported. Widgets must always be installed with user consent—automatic installation is not permitted.
Note: Widgets do not run inside containers, so users must be aware of this potential security concern.
How to Create a Widget:#
In the Nedev project directory, create a folder called
widgets/Widget_Name.Inside this folder, create: - An
__init__.pyfile containing the widget’s code. - Anicon.pngfile (48x48 px). - Optionally, create anargsfile for widget arguments.
Example args File:#
Variable_Name:str_or_int
Example Widget Code:#
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GLib
class MyWidget(Gtk.Box):
def __init__(self, location, my_variable:int_or_str):
super().__init__()
class WidgetEngine_MainCall(Gtk.VBox):
def __init__(self, my_variable:int_or_str):
super().__init__()
self.min_w = 250 # Minimum width in pixels
self.min_h = 250 # Minimum height in pixels
self.override_background_color(Gtk.StateFlags.NORMAL, Gdk.RGBA(1, 1, 1, 0.25)) # Optional background color
GLib.timeout_add(1000, lambda: self.get_style_context().remove_class("WidgetEngine_ChildContainer")) # Optional border removal
self.pack_start(MyWidget(my_variable), True, True, 0)
def resizeWidget(self, w, h):
fw = max(w, self.min_w)
fh = max(h, self.min_h)
self.set_size_request(fw, fh)
if __name__ == "__main__":
widgetwin = Gtk.Window()
widgetwin.add(WidgetEngine_MainCall())
widgetwin.show_all()
Gtk.main()
Widget Directory Structure:#
project_directory/
├── widgets/
│ └── MyWidget/
│ ├── __init__.py
│ ├── icon.png
│ └── args (optional)