diff --git a/hands/rec/ft-handrec b/hands/rec/ft-handrec index 86b5a98..a9d4da9 100755 --- a/hands/rec/ft-handrec +++ b/hands/rec/ft-handrec @@ -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" \ diff --git a/hands/rec/session.py b/hands/rec/session.py index 3f043d7..4bc1811 100755 --- a/hands/rec/session.py +++ b/hands/rec/session.py @@ -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):