Skip to content

Commit d8c8fc4

Browse files
Kabuki94claude
andcommitted
flatpak per-remote + bwrap tmpfs fix + btop system-wide preset + WSLg GUI export
Six regressions surfaced in operator's 2026-05-10 20:51 install screenshot. 1. `usr/lib/tmpfiles.d/mios-wslg.conf` `L+` -> `d`. Was force-symlinking /tmp/.X11-unix -> /mnt/wslg/.X11-unix every boot; flatpak bwrap then died with "Can't mount tmpfs on /newroot/tmp/.X11-unix: No such file or directory" (bwrap can't tmpfs over a symlink). Real directory lets bwrap tmpfs cleanly; mios-wslg-permissions-fix.service still bind-mounts the WSLg X11 socket dir onto it for non-sandboxed apps. 2. `etc/wsl.conf` add [gui] guiApplications=true. Was missing, so WSLg's auto-export of Linux GUI apps (.desktop -> Windows Start Menu) didn't fire. Operator: "no MiOS Linux apps in windows start menus". With this enabled, every flatpak in /var/lib/flatpak/exports/share/applications/ surfaces as a Windows Start Menu entry under the distro folder. 3. `etc/profile.d/mios-btop.sh` add BTOP_CONFIG_DIR resolver. Operator's btop screenshot showed preset 3 = cpu+net (btop's compiled-in default, NOT ours) with update_ms=2000. btop reads $XDG_CONFIG_HOME/btop or $HOME/.config/btop and does NOT fall back to /etc on miss. On the /=git dev VM, $HOME for 'mios' can resolve to / so the config seeded to `~/.config/btop/btop.conf` is hit-or-miss. Force the resolver to point at /etc/btop/ when no user copy exists. 4. New `etc/btop/btop.conf` + `etc/btop/themes/mios.theme`. System-wide fallback baked into the OCI image so #3's resolver has a real target. Mirrors mios-bootstrap/src/btop/btop.conf exactly (preset 3 = cpu+mem full, update_ms=500, theme_background=False for acrylic, mios palette). 5. `automation/40-flatpak-bake.sh` parse `<remote>:<appid>`. Was hardcoding `flathub` as the remote, so mios.toml entries `gnome-nightly:org.gnome.Nautilus.Devel` and `fedora:org.gnome.Epiphany` tried to install from flathub and failed silently (operator: "epiphany error: app/org.gnome.Epiphany/x86_64/master not installed"). Now splits on first colon, ensures the named remote exists (adds gnome-nightly / fedora / flathub-beta on-demand with known URLs), and installs from the correct remote. 6. `usr/libexec/mios-flatpak-install` same parser. First-boot retry path had the same bug; fixed in parallel so a deferred install hits the right remote too. Net effect on next fresh install: nautilus / epiphany launch cleanly (no bwrap error, correct app version), btop renders the MiOS preset out of the box, and the Linux flatpaks surface in the Windows Start Menu under the distro folder. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 0191bb3 commit d8c8fc4

8 files changed

Lines changed: 427 additions & 39 deletions

File tree

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@ etc/fapolicyd/*
136136
!/etc/aichat/
137137
!/etc/aichat/**
138138

139+
# /etc/btop/ -- system-wide btop preset + MiOS palette theme. mios-btop.sh
140+
# resolves BTOP_CONFIG_DIR=/etc/btop when the user has no ~/.config/btop,
141+
# so this is the canonical fallback that ships with the image. Operator
142+
# can override per-user; the system-wide copy guarantees `btop` and
143+
# `btop -p 3` render the MiOS preset out of the box.
144+
!/etc/btop/
145+
!/etc/btop/btop.conf
146+
!/etc/btop/themes/
147+
!/etc/btop/themes/mios.theme
148+
139149
# /etc/profile.d/ -- login-shell environment resolver (INDEX.md sec 4).
140150
# mios-env.sh walks the five-layer env overlay and exports MIOS_AI_* +
141151
# identity vars system-wide. Bash sources /etc/profile.d/*.sh from

automation/40-flatpak-bake.sh

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ flatpak remote-add --system --if-not-exists flathub \
7676
log "[40-flatpak-bake] selected refs: ${FLATPAK_LIST}"
7777
log "[40-flatpak-bake] beginning system-wide install (this may take several minutes)"
7878

79+
# Per-remote install: mios.toml accepts `<remote>:<appid>` entries so
80+
# the operator can pull Nautilus.Devel from gnome-nightly and Epiphany
81+
# from fedora's flatpak registry rather than the stale Flathub copy.
82+
# Bare `<appid>` still defaults to flathub.
7983
INSTALLED=0
8084
FAILED=0
8185
IFS=',' read -ra REFS <<< "$FLATPAK_LIST"
@@ -89,15 +93,50 @@ for raw in "${REFS[@]}"; do
8993
\#*) continue ;;
9094
esac
9195

92-
log "[40-flatpak-bake] installing ${ref}"
96+
# Split on first colon -- `gnome-nightly:org.gnome.Nautilus.Devel`
97+
# -> remote=gnome-nightly, app=org.gnome.Nautilus.Devel. No colon
98+
# means bare app id -> flathub.
99+
case "$ref" in
100+
*:*)
101+
remote="${ref%%:*}"
102+
app="${ref#*:}"
103+
;;
104+
*)
105+
remote="flathub"
106+
app="$ref"
107+
;;
108+
esac
109+
110+
# Ensure the remote exists. flathub is added above; other remotes
111+
# are added on-demand here (the standard URLs are well-known).
112+
if ! flatpak remote-list --system --columns=name 2>/dev/null | grep -qw "$remote"; then
113+
case "$remote" in
114+
flathub)
115+
flatpak remote-add --system --if-not-exists flathub \
116+
https://dl.flathub.org/repo/flathub.flatpakrepo 2>/dev/null || true ;;
117+
flathub-beta)
118+
flatpak remote-add --system --if-not-exists flathub-beta \
119+
https://flathub.org/beta-repo/flathub-beta.flatpakrepo 2>/dev/null || true ;;
120+
gnome-nightly)
121+
flatpak remote-add --system --if-not-exists gnome-nightly \
122+
https://nightly.gnome.org/gnome-nightly.flatpakrepo 2>/dev/null || true ;;
123+
fedora)
124+
flatpak remote-add --system --if-not-exists fedora \
125+
oci+https://registry.fedoraproject.org 2>/dev/null || true ;;
126+
*)
127+
warn "[40-flatpak-bake] unknown remote '$remote' for $ref -- attempting install anyway" ;;
128+
esac
129+
fi
130+
131+
log "[40-flatpak-bake] installing ${app} (from ${remote})"
93132
if flatpak install --system --noninteractive --assumeyes --or-update \
94-
flathub "${ref}" 2>&1 \
133+
"${remote}" "${app}" 2>&1 \
95134
| grep -E '^(Installing|Updating|Already installed|Skipping|Error|Warning)' \
96135
|| true; then
97136
INSTALLED=$((INSTALLED + 1))
98137
else
99138
FAILED=$((FAILED + 1))
100-
warn "[40-flatpak-bake] ${ref} install returned non-zero -- will retry at first boot"
139+
warn "[40-flatpak-bake] ${remote}:${app} install returned non-zero -- will retry at first boot"
101140
fi
102141
done
103142

etc/btop/btop.conf

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
#? Config file for btop v. 1.4.x -- MiOS preset (80x20 portal)
2+
#
3+
# Operator 2026-05-09: "btop can run if a preset can fit the dimensions
4+
# provided--just need a profile preset(make it match the entire MiOS
5+
# themes and color palette". This preset trims the default config to
6+
# fit the 80x20 MiOS canonical terminal size: hides net + processes
7+
# boxes, packs cpu+mem into the smallest layout that still shows
8+
# meaningful info.
9+
10+
# Color theme -- MiOS palette via mios.theme.
11+
color_theme = "mios"
12+
13+
# Theme background (true = use theme bg, false = terminal default).
14+
# false preserves WT's acrylic backdrop.
15+
theme_background = False
16+
17+
# Sets if 24-bit truecolor should be used.
18+
truecolor = True
19+
20+
# Force tty mode (off -- we have a real terminal).
21+
force_tty = False
22+
23+
# Presets accessible by pressing `p` then 0-9 in btop. Format:
24+
# <boxes>:<mode>:<theme>
25+
# where mode = 0 (full) or 1 (compact/minimal).
26+
#
27+
# Operator 2026-05-10: "btop -p 3 that's the correct profile -- make
28+
# it default launch to preset 3 and have the background be uncolored
29+
# so we can utilize the Windows acrylic rendering -- make btops
30+
# colorpalette match and preset 4 to be only showing processes
31+
# section". The `btop` shell function in /etc/profile.d/mios-verbs.sh
32+
# (and the Windows-side `btop` wrapper) calls `btop -p 3 "$@"` so the
33+
# operator's launch defaults match this slot.
34+
#
35+
# Preset slots:
36+
# 0 cpu compact (fallback for tiny windows < 75 cols)
37+
# 1 cpu full
38+
# 2 cpu+mem compact
39+
# 3 cpu+mem full <- canonical launch via `btop -p 3`
40+
# 4 processes only <- operator-requested process viewer
41+
# 5 cpu+mem+net+proc full (legacy verbose mode)
42+
presets = "cpu:1:default,cpu:0:default,cpu mem:1:default,cpu mem:0:default,proc:0:default,cpu mem net proc:0:default user mios"
43+
44+
# Set to True to add "v" mark when value is volatile.
45+
vim_keys = False
46+
47+
# Rounded corners on boxes (matches MiOS frame chars).
48+
rounded_corners = True
49+
50+
# Default symbols for graphs: "braille", "block", "tty".
51+
graph_symbol = "block"
52+
53+
# Individual graph symbol (for cpu graph).
54+
graph_symbol_cpu = "block"
55+
graph_symbol_gpu = "block"
56+
graph_symbol_mem = "block"
57+
graph_symbol_net = "block"
58+
graph_symbol_proc = "block"
59+
60+
# Boxes shown at launch. Matches the canonical -p 3 preset
61+
# (cpu+mem full) so even if btop is invoked without an explicit -p
62+
# arg, it still loads the operator's intended view.
63+
shown_boxes = "cpu mem"
64+
65+
# Update time in milliseconds. Operator 2026-05-10: "not 500ms update
66+
# speed" -- the displayed value was 2000ms. Lock to 500ms here so
67+
# btop refreshes 2x/sec on the dev VM out of the box.
68+
update_ms = 500
69+
70+
# Process sort column (when proc box re-enabled).
71+
proc_sorting = "cpu lazy"
72+
73+
# Reverse sort.
74+
proc_reversed = False
75+
76+
# Show command line of processes.
77+
proc_tree = False
78+
79+
# Show colliding cpu colors in tree mode.
80+
proc_colors = True
81+
82+
# Show graph for each process (cpu / mem usage).
83+
proc_gradient = True
84+
85+
# Filter via "/" key.
86+
proc_filter_kernel = False
87+
88+
# Display PID by default.
89+
proc_per_core = False
90+
91+
# Show memory in process box.
92+
proc_mem_bytes = True
93+
94+
# Show CPU graph in process box.
95+
proc_cpu_graphs = True
96+
97+
# Use psutil for process info (Linux).
98+
proc_info_smaps = False
99+
100+
# Show command in process box.
101+
proc_left = False
102+
103+
# Display CPU as percentage (true) or single core load (false).
104+
proc_filter = ""
105+
106+
# CPU graph height (rows). Minimal for 80x20.
107+
cpu_graph_upper = "total"
108+
cpu_graph_lower = "total"
109+
cpu_invert_lower = True
110+
cpu_single_graph = True
111+
cpu_bottom = False
112+
113+
# Show top of CPU box.
114+
show_uptime = True
115+
116+
# Show cpu temperatures (per-core if available).
117+
check_temp = True
118+
119+
# Which sensor to use for cpu temperature.
120+
cpu_sensor = "Auto"
121+
122+
# Show all cores in cpu temp.
123+
show_coretemp = True
124+
125+
# CPU core map order: layout/numa/etc.
126+
cpu_core_map = ""
127+
128+
# Custom cpu model name in cpu percentage box.
129+
custom_cpu_name = ""
130+
131+
# Cpu freq display: True/False.
132+
show_cpu_freq = True
133+
134+
# Update graphs for processes / cpu freq even when paused.
135+
clock_format = "%X"
136+
137+
# Background update while paused.
138+
background_update = True
139+
140+
# Filter all-zero CPU.
141+
custom_filters = ""
142+
143+
# Memory box -- compact.
144+
show_swap = True
145+
swap_disk = True
146+
show_disks = True
147+
only_physical = True
148+
use_fstab = False
149+
zfs_hide_datasets = False
150+
151+
# Disable disk meter graph for compact 80x20 fit.
152+
disk_free_priv = False
153+
show_io_stat = False
154+
io_mode = False
155+
io_graph_combined = False
156+
io_graph_speeds = ""
157+
158+
# Network box (hidden via shown_boxes -- still configured for when re-enabled).
159+
net_download = 100
160+
net_upload = 100
161+
net_auto = True
162+
net_sync = False
163+
net_iface = ""
164+
165+
# Show battery status (when applicable).
166+
show_battery = True
167+
selected_battery = "Auto"
168+
show_battery_watts = True
169+
170+
# Logging level.
171+
log_level = "WARNING"

etc/btop/themes/mios.theme

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# mios.theme -- MiOS color palette for btop
2+
#
3+
# Sourced from mios.toml [colors]:
4+
# accent #1A407F (operator-blue, primary brand color)
5+
# bg #0A0E1A (deep blue-black)
6+
# fg #B7C9D7 (subtle dim text)
7+
# ok #6CC777 (cool green)
8+
# warn #E5B14B (amber)
9+
# err #E76F4F (warm red)
10+
# highlight #1A407F (operator-blue accent for selection)
11+
#
12+
# Operator 2026-05-09: btop config "needs to match the entire MiOS themes
13+
# and color palette". Theme keys map to btop's standard slots.
14+
15+
# Main background. Set "" for transparent (preserves WT acrylic).
16+
theme[main_bg]=""
17+
18+
# Main text color
19+
theme[main_fg]="#B7C9D7"
20+
21+
# Title color for boxes
22+
theme[title]="#1A407F"
23+
24+
# Highlight color for keyboard shortcuts
25+
theme[hi_fg]="#E5B14B"
26+
27+
# Background color of selected item in processes box
28+
theme[selected_bg]="#1A407F"
29+
30+
# Foreground color of selected item in processes box
31+
theme[selected_fg]="#FFFFFF"
32+
33+
# Color of inactive/disabled text
34+
theme[inactive_fg]="#5A6770"
35+
36+
# Color of text appearing on top of graphs (process name etc.)
37+
theme[graph_text]="#B7C9D7"
38+
39+
# Misc colors for processes box including mini cpu graphs, details memory graph and details status text
40+
theme[meter_bg]="#2A3A4F"
41+
42+
# Foreground color of summary/percentage text
43+
theme[proc_misc]="#6CC777"
44+
45+
# CPU box outline color
46+
theme[cpu_box]="#1A407F"
47+
48+
# Memory/disks box outline color
49+
theme[mem_box]="#1A407F"
50+
51+
# Network box outline color
52+
theme[net_box]="#1A407F"
53+
54+
# Processes box outline color
55+
theme[proc_box]="#1A407F"
56+
57+
# Box divider line and small boxes line color
58+
theme[div_line]="#2A3A4F"
59+
60+
# Temperature graph color (low - mid - high)
61+
theme[temp_start]="#6CC777"
62+
theme[temp_mid]="#E5B14B"
63+
theme[temp_end]="#E76F4F"
64+
65+
# CPU graph colors (start - mid - end)
66+
theme[cpu_start]="#1A407F"
67+
theme[cpu_mid]="#3D6CB8"
68+
theme[cpu_end]="#7AAAEE"
69+
70+
# Mem/Disk free meter (start - mid - end)
71+
theme[free_start]="#0F2547"
72+
theme[free_mid]="#1A407F"
73+
theme[free_end]="#3D6CB8"
74+
75+
# Mem/Disk cached meter (start - mid - end)
76+
theme[cached_start]="#5A6770"
77+
theme[cached_mid]="#7A8B9A"
78+
theme[cached_end]="#B7C9D7"
79+
80+
# Mem/Disk available meter (start - mid - end)
81+
theme[available_start]="#3A5234"
82+
theme[available_mid]="#4F8050"
83+
theme[available_end]="#6CC777"
84+
85+
# Mem/Disk used meter (start - mid - end)
86+
theme[used_start]="#5A2A1F"
87+
theme[used_mid]="#A04A33"
88+
theme[used_end]="#E76F4F"
89+
90+
# Download graph colors (start - mid - end)
91+
theme[download_start]="#1A407F"
92+
theme[download_mid]="#3D6CB8"
93+
theme[download_end]="#7AAAEE"
94+
95+
# Upload graph colors (start - mid - end)
96+
theme[upload_start]="#5A2A1F"
97+
theme[upload_mid]="#A04A33"
98+
theme[upload_end]="#E76F4F"
99+
100+
# Process box color gradient for threads, mem and cpu usage
101+
theme[process_start]="#3A5234"
102+
theme[process_mid]="#A0A040"
103+
theme[process_end]="#E76F4F"

etc/profile.d/mios-btop.sh

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,30 @@
99
# `btop -p 4` (also reachable via `mios proc`-style) shows only the
1010
# processes section per operator's preset-4 request.
1111
#
12-
# Operator can bypass by passing any explicit -p / --preset arg:
13-
# btop -> btop -p 3
14-
# btop -p 4 -> btop -p 4 (operator override wins)
15-
# btop --preset 1 -> btop --preset 1 (operator override wins)
16-
#
17-
# Interactive-shell only; cron/scripted btop sees the real binary.
12+
# Operator-flagged 2026-05-10 (screenshot): btop launched at preset 3
13+
# but rendered cpu+NET (btop's compiled-in default preset 3) with
14+
# update_ms=2000 (default). That's btop ignoring our config entirely.
15+
# Root cause: btop reads `$XDG_CONFIG_HOME/btop/btop.conf` ->
16+
# `$HOME/.config/btop/btop.conf` and DOESN'T fall back to /etc when
17+
# either is unset/invalid. On the dev VM, `mios` user's $HOME can
18+
# resolve to `/` (the /=git root), and `/.config/btop/btop.conf`
19+
# may not exist if the build-time seed missed that path. Force the
20+
# resolution explicitly via BTOP_CONFIG_DIR so the canonical MiOS
21+
# config under /etc/btop/ is always honored.
1822

1923
[ -n "${PS1:-}" ] || return 0
2024

25+
# Resolve BTOP_CONFIG_DIR if the operator hasn't pinned one. Prefer
26+
# the user's own config if it exists; otherwise fall back to the
27+
# system-wide MiOS preset baked into the image.
28+
if [ -z "${BTOP_CONFIG_DIR:-}" ]; then
29+
if [ -f "${HOME:-/root}/.config/btop/btop.conf" ]; then
30+
export BTOP_CONFIG_DIR="${HOME:-/root}/.config/btop"
31+
elif [ -f /etc/btop/btop.conf ]; then
32+
export BTOP_CONFIG_DIR=/etc/btop
33+
fi
34+
fi
35+
2136
btop() {
2237
local has_preset=0
2338
for arg in "$@"; do

0 commit comments

Comments
 (0)