Files
taninux/HANDOVER.md
T
karim e8d93e6b1d gui: native libadwaita-free UI backend + dark shell; packaging/iso updates
- gui/ui: native GTK4 widget vocabulary (.tn-*) behind the ui.* seam,
  default backend now native; style_apple.css design language
- shell: sidebar/topbar/content all #0f0f0f in dark (matches eww panels)
- new pages: wine, online_accounts
- packaging: tanin-icons (accent folder theme), tanin-calendar, gtklock,
  taninux-gtk3-theme, flatpak install handler
- iso/distro: profile + manifest tweaks (ISO binary not included)
2026-06-25 00:40:21 +02:00

180 lines
8.5 KiB
Markdown

# TANINUX — Handover (Session 2026-06-23)
Context for a fresh instance. Repo: `~/projects/taninux` (distro codename **camel**,
niri-only GTK4/libadwaita + eww desktop). User: Karim (German; iterates visually;
hates UI jank; blanket perms in `~/projects`). UI strings are **English**.
---
## THIS SESSION (2026-06-23) — Native GTK4 shell, CSS overhaul
`TANINUX_UI=native` means the app uses `src/taninux/gui/ui/native.py` widgets and
loads `src/taninux/gui/ui/style_apple.css` instead of libadwaita. This session
fixed the native theme comprehensively.
### What was done
**`src/taninux/gui/ui/style_apple.css`**
- All hardcoded blue accents (`#007aff`, `#0a84ff`, `rgba(0,122,255…)`) replaced
with `@accent_color` + `alpha(@accent_color, 0.10)`.
- Dark headerbar: `rgba(20,20,22,0.97)` with `box-shadow: none` (matches sidebar,
no GNOME "lighter band" effect).
- Light headerbar: `#ebebeb`. Light sidebar: `#ebebeb`. Light page bg: `#f6f6f6`
(matches libadwaita white).
- Explicit light-mode text colors (`color: #1d1d1f`) for all nav rows, nav header,
group titles — because GTK4 Adwaita can leave text light-colored in light mode.
- `button.suggested-action``background-color: @accent_color !important` (was blue).
- `progress, trough > progress``background-color: @accent_color !important`.
- Nav selection dark: glass wash `alpha(@accent_color, 0.18)` + border.
**`src/taninux/gui/style.py`**
- `apply()` (native backend): now calls
`Gtk.Settings.get_default().set_property("gtk-application-prefer-dark-theme", dark)`
so GTK4 Adwaita widgets (buttons, sliders) follow the chosen scheme.
- `_build_css()` swatch buttons: selector is now `button.fuji-swatch.swatch-{key}`
with `background-color: {hex} !important; background: {hex} !important;` — fixes
swatches appearing black (Adwaita overrode them without !important).
- Swatch checked state: uses `outline: 2px solid {hex}; outline-offset: 3px`
(removed `box-shadow: inset 0 0 0 2px @window_bg_color` which was undefined in
native mode).
- `_set_gsettings()`: writes `TANINUX-dark`/`TANINUX` as the GTK3 theme
(for greetd/GTK3 apps). Also sets `color-scheme=prefer-dark/prefer-light`.
⚠ This is SYSTEM-WIDE — affects eww and all other GTK4 apps.
**`src/taninux/gui/pages/settings.py`**
- `persist()`: after saving the color scheme, now also calls `native.set_dark(root, …)`
live so the theme switches immediately without restart.
**`src/taninux/gui/console.py`** — complete rewrite
- `LogConsole` is now a plain Python class (NO GTK widget). Writes to
`~/.local/share/taninux/taninux.log` with timestamps.
- `RunnerCard`: button only (no embedded log widget). Process output goes to
`_write_log()`.
- `log_expander()` and `collapsible_log()`: kept as no-ops returning `None`
all callers already cleaned up.
**Log expanders removed from all settings pages:**
`backup.py`, `update.py`, `kernel.py`, `maintain.py`, `network.py`,
`bluetooth.py`, `shares.py`, `bundles.py`, `appdetail.py`, `store.py`,
`printers.py` — all formerly called `log_expander(…)` which is now a no-op;
the UI no longer has a "Log" section on any page.
**PKGBUILDs** (`packaging/taninux/PKGBUILD`, `packaging/tanin-desktop/PKGBUILD`)
- networkmanager, bluez-utils, wireplumber, brightnessctl, wlsunset, cups,
pacman-contrib moved from `optdepends``depends` in `taninux/PKGBUILD`.
- wlsunset, cups moved from `optdepends``depends` in `tanin-desktop/PKGBUILD`.
- paru, flatpak, timeshift remain optdepends.
### Files touched this session
```
src/taninux/gui/ui/style_apple.css
src/taninux/gui/style.py
src/taninux/gui/pages/settings.py
src/taninux/gui/console.py
src/taninux/gui/pages/{backup,update,kernel,maintain,network,bluetooth,shares,
bundles,appdetail,store,printers}.py
packaging/taninux/PKGBUILD
packaging/tanin-desktop/PKGBUILD
```
### Current state
| Thing | State |
|---|---|
| Native CSS theme (dark + light) | ✅ fixed, live |
| Accent colors correct (`@accent_color`) | ✅ |
| Live dark/light switch in Settings | ✅ |
| Log expanders removed everywhere | ✅ |
| PKGBUILDs updated | ✅ source only |
| taninux package rebuilt | ❌ needs `./packaging/finish-tanin-repo.sh` |
| tanin-icons built+committed (c5b0848) | ✅ from previous session |
| `[tanin]` repo published | ❌ blocked on `TANIN_PKG_TOKEN` |
---
## THE CRITICAL BUG THIS SESSION — `awww-daemon` black screen
**Symptom:** Entire desktop goes black (no wallpaper, no windows visible).
Opening any eww panel made it worse (visible as black backdrop).
**Root cause:** `awww` (the blurred-wallpaper daemon used for niri's Overview
backdrop) creates a surface at the Wayland **Background layer**. After suspend/
resume, awww's cached blurred image goes stale or the surface loses its content
→ the surface renders as **solid black**. Because awww-daemon sits ABOVE swaybg
in the Background layer stack, it covers the wallpaper entirely.
The transparent panel-backdrop was fine — what appeared "black" was the awww
surface showing through the transparent backdrop, covering the wallpaper behind it.
**Fix (immediate):** `pkill awww`
- This kills the awww daemon, the black surface disappears from niri's Background
layer, swaybg's wallpaper shows through again.
**Permanent fix needed (TODO for next session):**
Option A — Regenerate blur cache on resume:
Add a systemd user sleep hook that calls `~/projects/eww/scripts/overview-backdrop.sh sync`
on `post-resume`. File: `~/.config/systemd/user/awww-refresh.service` + `.path`.
Option B — Make awww not start at login (only at Overview open):
Remove awww from `launch.sh`; call `overview-backdrop.sh start` only when niri's
Overview is about to open. niri has no "overview-opening" IPC event yet → tricky.
Option C — Restart awww after resume with a fresh cache:
In the sleep hook: `pkill awww; sleep 0.5; overview-backdrop.sh start`.
**Diagnosis dead-ends (don't re-investigate):**
- ❌ NOT caused by our `~/.config/gtk-4.0/libadwaita.css` (tested: removed → still black)
- ❌ NOT caused by `color-scheme=prefer-dark` gsettings (tested: default → still black)
- ❌ NOT caused by GSK renderer (`GSK_RENDERER=cairo` → still black)
- ✅ CONFIRMED: `pkill awww` → wallpaper returns instantly
---
## CURRENT SYSTEM STATE (after this session's debugging)
**gsettings were modified during debugging.** Restore if needed:
```bash
gsettings set org.gnome.desktop.interface color-scheme prefer-dark
gsettings set org.gnome.desktop.interface gtk-theme TANINUX-dark
```
The awww daemon was killed (`pkill awww`). The desktop now shows swaybg's
wallpaper correctly. Restarting eww (`~/projects/eww/launch.sh`) will restart
awww via launch.sh — which may make the black screen return. If it does: `pkill awww`.
---
## PREVIOUS SESSION (2026-06-22) — Icon theme
### A. New packages in the `[tanin]` repo
- `librewolf-bin`, `arch-update`, `timeshift` (+ `timeshift-autosnap`),
`xdg-terminal-exec` added to AUR rebuild list.
- `paru` built into repo but stays optdepend.
- `papirus-folders` removed.
### B. Icon theme: `tanin-icons`
Custom package `packaging/tanin-icons/` — 5 thin Adwaita-based themes (`Tanin-<accent>`)
that recolour only folder/place icons in Fuji accent hues. Built + committed as c5b0848.
Installed to `~/.local/share/icons/Tanin-*` (user dir, not pacman).
`style.py``_set_gsettings()` sets `icon-theme=Tanin-<accent_key>` on accent change.
`tanin-desktop/PKGBUILD`: depends `+tanin-icons`, removed `papirus-icon-theme`.
⚠ NOT yet in the published `[tanin]` repo (needs `TANIN_PKG_TOKEN`).
---
## Gotchas to respect
- **NEVER** run lock/swaylock/suspend commands to test (locked Karim out once).
Exception: Karim explicitly authorised `sudo systemctl suspend` in the 2026-06-23
session — that's not a standing permission.
- `write_global_theme()` writes `~/.config/gtk-4.0/libadwaita.css` which is read
by ALL GTK4 apps including eww (USER priority 800 — above GTK theme). It only
defines `@define-color` vars and button border-radius; it does NOT define
window backgrounds. The globals are safe.
- TANINUX tree has unrelated uncommitted files (tanin-calendar, online_accounts,
gtklock, iso/) — NOT from this session; do NOT `git add -A`.
- GTK3 can't exact-Fuji recolour at runtime (parse-time `@define-color` limit).
## Open / not done
- Permanent fix for awww black screen after suspend (see above).
- Rebuild + publish `[tanin]` repo (needs `TANIN_PKG_TOKEN` env).
- Rebuild ISO.
- `camel.toml` `rebuilt_aur` list is stale (missing librewolf-bin, arch-update,
timeshift-autosnap, xdg-terminal-exec).
- Manual icon picker in `desktop.py` still lists all 5 `Tanin-*` themes (minor).