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)
This commit is contained in:
2026-06-25 00:40:21 +02:00
parent 04cadb4e35
commit e8d93e6b1d
374 changed files with 12307 additions and 686 deletions
+154 -94
View File
@@ -1,119 +1,179 @@
# TANINUX — Handover (Session 2026-06-22)
# 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 did two things: (A) added packages to the `[tanin]` binary repo,
(B) built a custom **accent-reactive icon theme** to replace Papirus.
---
## A. New packages in the `[tanin]` repo
## THIS SESSION (2026-06-23) — Native GTK4 shell, CSS overhaul
The `[tanin]` repo is a thin overlay on Arch (own packages + AUR rebuilds),
hosted on the Gitea Arch registry. Build/publish scripts in `packaging/`:
`build-tanin-repo.sh` (no-sudo), `finish-tanin-repo.sh` (sudo: taninux + AUR
rebuilds), `publish-tanin-repo.sh` (upload to Gitea).
`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.
Added to the AUR-rebuild list (`build-tanin-repo.sh` + `finish-tanin-repo.sh`):
- `librewolf-bin` — default browser. Also a **hard dep** of `tanin-desktop`.
⚠ Security: rebuild + republish on every LibreWolf release, else `pacman -Syu`
ships a stale (vulnerable) browser.
- `arch-update`, `timeshift` (+ `timeshift-autosnap`), `xdg-terminal-exec`
all hard deps of `tanin-desktop` now.
- `paru` — built into the repo but stays **optdepend** (not forced).
### What was done
Deliberately **rejected**: `papirus-folders` (removed). The other 20 AUR pkgs on
Karim's machine are personal apps/games/emulators/hardware → not base-OS.
`swayfx`+`scenefx0.4` are pulled by `greetd-regreet` (a leftover alt-greeter;
TANINUX uses `tanin-greet`) — candidate for removal, not 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.
## B. Icon theme: Papirus → `tanin-icons` (the main work)
**`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.
Karim's decision: Papirus is "too flat"; **Adwaita fits the design**, folders
should follow the Fuji accent. The 5 Fuji accents are deliberately *muted*
(`ume #8f8aac`, `shinkai #8a98ac`, `take #8aac8b`, `chikyu #aca98a`, `beni #ac8a8c`)
— so `papirus-folders` (saturated presets) and native GNOME accent-folders (preset
accents only) both can't match. Hence a custom package.
**`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.
**New package `packaging/tanin-icons/`:**
- `recolor.py` — generator. Builds 5 thin themes `Tanin-<accent>` that
`Inherits=Adwaita`, recolouring **only** the folder/place icons. Algorithm:
HSL shift of the Adwaita blue ramp → keep each stop's **lightness**, swap
hue+saturation to the accent (preserves folder depth). White emblems untouched
(saturation gate). **16px PNGs are rasterised via `rsvg-convert`** because
Adwaita's only fixed-size raster is 16x16 — without an override the inherited
blue PNG wins at 16px.
- `PKGBUILD` (depends `adwaita-icon-theme`; makedepends `librsvg python`) +
`tanin-icons.install` (gtk-update-icon-cache hook). Builds clean, ~52 KB.
-`recolor.py` was fixed to only `rmtree` its own `Tanin-<key>` subdirs, NOT
the whole `OUT` dir (it earlier wiped a shared dir when `OUT_DIR` pointed at
`~/.local/share/icons` — no data lost that time, but the bug is gone now).
- ⚠ Rebuild this package after any `adwaita-icon-theme` bump (reads
`/usr/share/icons/Adwaita` at build time).
**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.
**Integration (source only, NOT yet in the installed taninux):**
`src/taninux/gui/style.py``_set_gsettings()` now also sets
`icon-theme=Tanin-<accent_key>`, so folders recolour **live** when the accent
changes. Also fixed `src/taninux/gui/pages/panel.py` hint "Papirus" → "Adwaita".
**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.
**Wiring:**
- `build-tanin-repo.sh`: `tanin-icons` added to `OWN_SIMPLE`.
- `tanin-desktop/PKGBUILD`: depends `+tanin-icons`, **removed** `papirus-icon-theme`
(Adwaita is the base now), `pkgrel` 3→5.
- Distro manifests synced: `distro/camel.toml` (icon_theme, `icons=[adwaita...]`,
new `[[packages.own]] tanin-icons`), `distro/MANIFEST.md` (icon row + pkg table).
---
## CURRENT STATE — read carefully
### 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 |
|---|---|
| `tanin-icons` package built (`*.pkg.tar.zst`) | ✅ in `packaging/tanin-icons/` |
| Verified GTK resolves folder @48px (svg) + @16px (png) to `Tanin-<accent>` | ✅ |
| **Active in Karim's running session** | ✅ but via a **user-dir copy** at `~/.local/share/icons/Tanin-*` + `gsettings icon-theme=Tanin-beni` (current accent). NOT the pacman package. |
| `tanin-icons` installed via pacman | ❌ (sudo needs a password; no TTY here) |
| `[tanin]` repo rebuilt + published with the new pkgs | ❌ |
| `taninux`/`tanin-desktop` rebuilt with the style.py change | ❌ → **accent→icon auto-switch is NOT live yet**; changing the accent in Settings won't move the icon-theme until taninux is reinstalled. Workaround now: `gsettings set org.gnome.desktop.interface icon-theme Tanin-<accent>`. |
| ISO rebuilt | ❌ |
So: **wired in source + manifests, but no artifacts rebuilt** → a fresh ISO/install
does NOT have it yet.
### To fully ship (needs Karim for sudo)
1. `./packaging/finish-tanin-repo.sh` — builds `tanin-icons` + the new `taninux`/
`tanin-desktop` + AUR rebuilds.
2. `./packaging/publish-tanin-repo.sh` — upload to Gitea (`TANIN_PKG_TOKEN`).
3. Rebuild the ISO (pulls the updated `[tanin]`).
4. Optional cleanup: once installed system-wide, delete the user-dir copies
`~/.local/share/icons/Tanin-*` (identical, harmlessly shadowed).
| 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` |
---
## OPEN / OFFERED, not done
- **camel.toml `rebuilt_aur` list is stale** — still only eww/tiramisu/waypaper/
calamares/paru; missing `librewolf-bin`, `arch-update`, `timeshift-autosnap`,
`xdg-terminal-exec`. Offered to sync; awaiting Karim.
- **Manual icon-theme picker** (`src/taninux/gui/desktop.py`) still lists the 5
`Tanin-*` themes and a manual pick gets overridden on the next accent change.
Could filter them out — not done.
- **Accent-icon scope**: only folders/places are recoloured. Karim was asked
whether to extend to `emblem-*`/coloured mimetypes — undecided.
- `papirus-folders` still *installed* on Karim's machine (`paru -Rns papirus-folders`).
## 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/session/suspend commands to "test" (locked Karim out once).
- GTK3 can't be exact-Fuji recoloured (parse-time `@define-color`); only GTK4/
libadwaita is exact. See memory `taninux-gtk-theming`.
- Lots of unrelated uncommitted changes exist in the tree (tanin-calendar,
online_accounts, gtklock, iso/*) — NOT from this session; don't bundle them.
- **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).
## Files touched this session
`packaging/tanin-icons/{PKGBUILD,recolor.py,tanin-icons.install}` (new),
`packaging/{build,finish}-tanin-repo.sh`, `packaging/tanin-desktop/PKGBUILD`,
`src/taninux/gui/style.py`, `src/taninux/gui/pages/panel.py`,
`distro/{camel.toml,MANIFEST.md}`.
## 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).