#!/usr/bin/env python3 """Rendert die NATIVE Shell (ui/shell.py) mit echten Settings-Sektionen. TANINUX_UI=native PYTHONPATH=src python shell_demo.py [--shot=PATH] """ from __future__ import annotations import os import subprocess import sys os.environ.setdefault("TANINUX_UI", "native") import gi # noqa: E402 gi.require_version("Gtk", "4.0") from gi.repository import GLib, Gio # noqa: E402 from taninux.gui import style, ui # noqa: E402 from taninux.gui.pages import SETTINGS_SECTIONS # noqa: E402 SHOT = next((a for a in sys.argv if a.startswith("--shot=")), None) SHOT = SHOT.split("=", 1)[1] if SHOT else None class App(ui.Application): def __init__(self) -> None: super().__init__(application_id="ch.gabrielevarano.Taninux.ShellDemo", flags=Gio.ApplicationFlags.DEFAULT_FLAGS) def do_activate(self) -> None: style.apply_persisted() win = ui.MainWindow(self, SETTINGS_SECTIONS, "System Settings") win.present() if SHOT: win.fullscreen() def _capture() -> bool: subprocess.run(["grim", SHOT], check=False) self.quit() return False GLib.timeout_add(1000, _capture) if __name__ == "__main__": raise SystemExit(App().run([]))