mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 01:00:06 +02:00
Hands: the recorder's host commands run from the home folder
host-spawn starts a host command in the caller's folder. Started from /tmp, the app's folder in the container is /run/host/tmp, which the host doesn't have, so starting ft-camd (and every other host command) exited 127. host_command now runs from home (env -C), and the launcher cds there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fda6302bd3
commit
a05e500d30
2 files changed
+8
-2
No files matched your search
@@ -11,6 +11,9 @@ case $wl in /*) ;; *) wl="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}/$wl" ;; esac
|
||||
session_bus=${DBUS_SESSION_BUS_ADDRESS:-}
|
||||
export XDG_RUNTIME_DIR=/run/user/$(id -u)
|
||||
export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus
|
||||
# From the home folder: the app's host commands (distrobox-host-exec) run in its folder on the
|
||||
# host, and a folder only the container has, such as /run/host/tmp, makes them all fail.
|
||||
cd "$HOME" || exit 1
|
||||
"$here/../../scripts/container-up.sh"
|
||||
exec "$HOME/.local/bin/distrobox" enter dev -- env WAYLAND_DISPLAY="$wl" DISPLAY="${DISPLAY:-}" \
|
||||
XAUTHORITY="${XAUTHORITY:-}" DBUS_SESSION_BUS_ADDRESS="$session_bus" \
|
||||
|
||||
@@ -109,11 +109,14 @@ def in_container():
|
||||
|
||||
def host_command(*cmd):
|
||||
"""argv to run a command on the SteamOS host from the dev container (as in
|
||||
display-settings: distrobox-host-exec needs the user's real session bus)."""
|
||||
display-settings: distrobox-host-exec needs the user's real session bus). It runs from the
|
||||
home folder: host-spawn starts the command in the caller's folder, and a container-only
|
||||
one such as /run/host/tmp doesn't exist on the host (every command then exits 127)."""
|
||||
exe = shutil.which("distrobox-host-exec")
|
||||
if not in_container() or not exe:
|
||||
return list(cmd)
|
||||
return ["env", "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%d/bus" % os.getuid(), exe] + list(cmd)
|
||||
return ["env", "-C", os.path.expanduser("~"), "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%d/bus" % os.getuid(),
|
||||
exe] + list(cmd)
|
||||
|
||||
|
||||
def host_path(path):
|
||||
|
||||
Reference in new issue
Block a user