Skip to content

Commit 567bce8

Browse files
committed
GUI theming: GTK settings.ini in /etc/skel + flatpak gtk-config perms
Plus: AI CLI install helper (Claude Code + Gemini CLI) Two coupled fixes for the persistent "Nautilus still light mode" regression + the new ai-clis ask: 1. /etc/skel/.config/gtk-{3,4}.0/settings.ini (NEW): gtk-application-prefer-dark-theme=true + gtk-theme-name=adw-gtk3-dark. Shipped via /etc/skel so every new MiOS user account gets dark theming applied at first GTK app launch, no gsettings/dconf round-trip needed. Operator-overridable per-user. 2. /var/lib/flatpak/overrides/<app> updated for all libadwaita apps: added filesystems=xdg-config/gtk-3.0:ro + xdg-config/gtk-4.0:ro so the flatpak sandboxes can read the host's settings.ini. The previous dconf-only approach failed because flatpak sandboxes can't reliably read the host's dconf user-db (xdg-desktop-portal Settings.Read returns the right value but libadwaita's bundled gsettings doesn't honor it). settings.ini at the host gtk config path is the reliable signal that ALL GTK apps respect. 3. /usr/libexec/mios/install-ai-clis.sh (NEW): installs Claude Code + Gemini CLI via npm globally. Reads mios.toml [packages.ai]. npm_globals (operator-extensible). Idempotent. MIOS_SKIP_AI_CLIS=1 to skip. Operator-confirmed: "also add Claude Code/CLI and Gemini CLI as extra packages (on by default) in podman-MiOS-DEV and MiOS images (Global defaults)". The mios-bootstrap companion commit adds the build-mios.ps1 invocation in the overlay phase + the [packages.ai] toml additions (nodejs + npm + npm_globals list).
1 parent db7a500 commit 567bce8

9 files changed

Lines changed: 129 additions & 0 deletions

File tree

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,18 @@ etc/fapolicyd/*
171171
!/etc/dconf/profile/
172172
!/etc/dconf/profile/*
173173

174+
# /etc/skel/ -- default home contents copied to every new user.
175+
# GTK3/GTK4 settings.ini under .config/ ensures fresh accounts boot
176+
# with adw-gtk3-dark + prefer-dark before any gsettings/dconf calls
177+
# need to happen. Flatpak apps read these settings via their
178+
# xdg-config/gtk-{3,4}.0 filesystem overrides.
179+
!/etc/skel/
180+
!/etc/skel/.config/
181+
!/etc/skel/.config/gtk-3.0/
182+
!/etc/skel/.config/gtk-3.0/*
183+
!/etc/skel/.config/gtk-4.0/
184+
!/etc/skel/.config/gtk-4.0/*
185+
174186
# /etc/mios/ -- KB config (system-prompts, kb.conf.toml, eval-criteria.json) tracked here.
175187
# Runtime secrets and per-host overrides are NOT tracked (handled by mios-bootstrap.git).
176188
!/etc/mios/
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# MiOS default GTK3 settings (shipped via /etc/skel/.config/gtk-3.0/)
2+
# Sets the dark Adwaita theme as the user-level default for every
3+
# new MiOS account. Operator-overridable per-user via GNOME Tweaks
4+
# or by editing ~/.config/gtk-3.0/settings.ini directly.
5+
[Settings]
6+
gtk-application-prefer-dark-theme=true
7+
gtk-theme-name=adw-gtk3-dark
8+
gtk-icon-theme-name=Adwaita
9+
gtk-cursor-theme-name=Adwaita
10+
gtk-font-name=Adwaita Sans 11
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# MiOS default GTK3 settings (shipped via /etc/skel/.config/gtk-3.0/)
2+
# Sets the dark Adwaita theme as the user-level default for every
3+
# new MiOS account. Operator-overridable per-user via GNOME Tweaks
4+
# or by editing ~/.config/gtk-3.0/settings.ini directly.
5+
[Settings]
6+
gtk-application-prefer-dark-theme=true
7+
gtk-theme-name=adw-gtk3-dark
8+
gtk-icon-theme-name=Adwaita
9+
gtk-cursor-theme-name=Adwaita
10+
gtk-font-name=Adwaita Sans 11
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/bin/bash
2+
# /usr/libexec/mios/install-ai-clis.sh
3+
#
4+
# Install MiOS-default AI assistant CLIs (Claude Code + Gemini CLI) as
5+
# global npm packages. Both are Node.js CLIs distributed via npm, so
6+
# they don't fit RPM packaging. This script is invoked once by the
7+
# build-mios.ps1 overlay phase and is also operator-re-runnable any
8+
# time (idempotent: `npm install -g <pkg>` upgrades or installs as
9+
# needed).
10+
#
11+
# Reads the npm_globals list from mios.toml [packages.ai] -- operator
12+
# can extend by editing the list before `mios update`.
13+
#
14+
# Operator override: MIOS_SKIP_AI_CLIS=1 skips entirely.
15+
16+
set -e
17+
18+
if [ "${MIOS_SKIP_AI_CLIS:-0}" = "1" ]; then
19+
echo " [skip] MIOS_SKIP_AI_CLIS=1; not installing AI CLIs."
20+
exit 0
21+
fi
22+
23+
if ! command -v npm >/dev/null 2>&1; then
24+
echo " [warn] npm not installed; cannot install AI CLIs. Add 'nodejs' + 'npm' to [packages.ai].pkgs."
25+
exit 0
26+
fi
27+
28+
# Pull npm_globals from layered mios.toml (~/.config > /etc/mios > /usr/share/mios).
29+
# Vendor fallback if the toml lookup fails: the two operator-canonical
30+
# AI CLIs.
31+
_resolve_npm_globals() {
32+
local toml
33+
for toml in \
34+
"${HOME:-/var/home/mios}/.config/mios/mios.toml" \
35+
/etc/mios/mios.toml \
36+
/usr/share/mios/mios.toml; do
37+
[ -r "$toml" ] || continue
38+
# Extract npm_globals = [ "...", "..." ] from [packages.ai] section.
39+
awk '
40+
/^\[/ {
41+
line=$0; sub(/[[:space:]]*#.*$/, "", line)
42+
in_ai = (line == "[packages.ai]") ? 1 : 0
43+
next
44+
}
45+
in_ai && /^[[:space:]]*npm_globals[[:space:]]*=[[:space:]]*\[/ {
46+
capturing = 1
47+
# On the same line?
48+
if (match($0, /\[.*\]/)) {
49+
body = substr($0, RSTART+1, RLENGTH-2)
50+
print body
51+
capturing = 0
52+
next
53+
}
54+
next
55+
}
56+
capturing { buf = buf $0 "\n" }
57+
capturing && /^[[:space:]]*\][[:space:]]*$/ { print buf; capturing = 0; in_ai = 0; exit }
58+
' "$toml" | grep -oE '"[^"]+"' | tr -d '"' && return 0
59+
done
60+
# Vendor fallback
61+
echo "@anthropic-ai/claude-code"
62+
echo "@google/gemini-cli"
63+
}
64+
65+
# Ensure npm prefix is a system path that's on $PATH for all users.
66+
# Default `npm -g` prefix on Fedora is /usr/local; we use /usr/local
67+
# so installed bins land at /usr/local/bin/ (which IS on PATH).
68+
mkdir -p /usr/local/lib/node_modules
69+
70+
echo " installing AI CLIs (npm -g) ..."
71+
_failed=0
72+
_resolve_npm_globals | while read -r pkg; do
73+
[ -z "$pkg" ] && continue
74+
echo " -> $pkg"
75+
if ! npm install -g --silent "$pkg" 2>&1 | tail -3; then
76+
echo " [warn] failed: $pkg"
77+
_failed=$((_failed + 1))
78+
fi
79+
done
80+
81+
echo " done. Try: claude --version / gemini --version"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
[Context]
2+
filesystems=xdg-config/dconf:ro;xdg-config/gtk-3.0:ro;xdg-config/gtk-4.0:ro;
3+
14
[Environment]
25
GSK_RENDERER=cairo
36
LIBGL_ALWAYS_SOFTWARE=1
47
GALLIUM_DRIVER=llvmpipe
58
LIBGL_KOPPER_DISABLE=1
9+
WEBKIT_DISABLE_COMPOSITING_MODE=1
610
ADW_DEBUG_COLOR_SCHEME=force-dark

var/lib/flatpak/overrides/com.mattjakeman.ExtensionManager

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[Context]
2+
filesystems=xdg-config/dconf:ro;xdg-config/gtk-3.0:ro;xdg-config/gtk-4.0:ro;
3+
14
[Environment]
25
GSK_RENDERER=cairo
36
LIBGL_ALWAYS_SOFTWARE=1

var/lib/flatpak/overrides/org.gnome.Epiphany

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[Context]
2+
filesystems=xdg-config/dconf:ro;xdg-config/gtk-3.0:ro;xdg-config/gtk-4.0:ro;
3+
14
[Environment]
25
GSK_RENDERER=cairo
36
LIBGL_ALWAYS_SOFTWARE=1

var/lib/flatpak/overrides/org.gnome.Nautilus

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[Context]
2+
filesystems=xdg-config/dconf:ro;xdg-config/gtk-3.0:ro;xdg-config/gtk-4.0:ro;
3+
14
[Environment]
25
GSK_RENDERER=cairo
36
LIBGL_ALWAYS_SOFTWARE=1

var/lib/flatpak/overrides/org.gnome.Software

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[Context]
2+
filesystems=xdg-config/dconf:ro;xdg-config/gtk-3.0:ro;xdg-config/gtk-4.0:ro;
3+
14
[Environment]
25
GSK_RENDERER=cairo
36
LIBGL_ALWAYS_SOFTWARE=1

0 commit comments

Comments
 (0)