File size: 1,469 Bytes
74f57c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# shared-gui — GTK3 Base Class

Shared GTK3 base for all desktop apps in this setup.
Provides `BaseApp`: a themed GTK3 window with Catppuccin + COSMIC dark/light auto-detection.

## What BaseApp provides

- GTK3 window with HeaderBar, content area, StatusBar
- Catppuccin theme (auto-detects COSMIC dark/light mode, live-updates on theme switch)
- Helper methods: `set_subtitle()`, `add_header_widget()`, `set_status()`, `start_refresh()`, `add_css()`
- CSS classes: `.base-card`, `.base-toolbar`, `.base-badge`, `.base-badge-ok/warn/error`, `.base-accent-btn`

**Dependency:** `~/Projekte/ClaudeCodePanel/theme.py` must exist (provides `build_css`, `get_palette`, `setup_theme_watcher`).

## How to import

```python
import sys
from pathlib import Path
sys.path.insert(0, str(Path.home() / "Projekte" / "shared-gui"))
from gui_base import BaseApp

import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

class MyApp(BaseApp):
    def __init__(self):
        super().__init__("My App", 800, 600)
        label = Gtk.Label(label="Hello")
        self.content_box.pack_start(label, True, True, 0)

MyApp().run()
```

## Projects using it

- `~/Projekte/ClaudeCodePanel/` — Claude session monitor
- `~/Projekte/Sidecar/` — Sidecar GTK3 GUI (v2+)

## Requirements

```bash
# PyGObject (GTK3 Python bindings)
sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0
```

No pip dependencies — GTK3 bindings come from the system package manager.