dev.sh run: home folder, render nodes, build first

Issue #1: run mounts the home folder at its own path with HOME there,
so the app reads the user's files and theme. Issue #2: each render
node passes with its group, which Mesa's EGL needs. run builds before
it starts the app.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
雷电芽衣andClaude committed 2026-09-26 14:29:56 -04:00
1 parent 2d219dd115
commit 8881bfead1
4 files changed
+14 -8

No files matched your search

+7 -5
View File
@@ -26,12 +26,14 @@ run)
socket=$WAYLAND_DISPLAY
[[ $socket = /* ]] || socket=$XDG_RUNTIME_DIR/$socket
socket=$(readlink -f "$socket")
# The desktop's theme, where Omarchy keeps it, read-only.
theme=$HOME/.local/state/omarchy
mounts=()
[[ -d $theme ]] && mounts=(-v "$theme:/tmp/.local/state/omarchy:ro")
# The home folder at its own path: files, settings, theme.
mounts=(-v "$HOME:$HOME" -e HOME="$HOME")
# The GPU's render nodes, which Mesa's EGL needs.
for node in /dev/dri/renderD*; do
[[ -e $node ]] && mounts+=(--device "$node" --group-add "$(stat -c %g "$node")")
done
in_container "${mounts[@]}" -v "$socket:$runtime/wayland-0" -e WAYLAND_DISPLAY=wayland-0 \
-e QT_QPA_PLATFORM=wayland "$image" build/omaphoto "${@:2}"
-e QT_QPA_PLATFORM=wayland "$image" sh -c "$configure_and_build && exec build/omaphoto \"\$@\"" sh "${@:2}"
;;
*)
echo "usage: dev.sh build|test|run [args]" >&2