__init__.py
Python script, ASCII text executable
1import panorama_panel 2 3import gi 4gi.require_version("Gtk", "4.0") 5 6from gi.repository import Gtk 7 8 9class LabelApplet(panorama_panel.Applet): 10name = "Label" 11description = "Show a text" 12 13def __init__(self, orientation=Gtk.Orientation.HORIZONTAL, config=None): 14super().__init__(orientation=orientation, config=config) 15if config is None: 16config = {} 17self.label = Gtk.Label() 18self.label.set_text(config.get("text", "Label")) 19self.append(self.label) 20 21def get_config(self): 22return {"text": self.label.get_text()} 23