Monday, April 13, 2026

bedrock linux: krusader in arch strata does not open files with "Open with" menu from strata

On Bedrock Linux (hijacked gentoo with xfce4) with a non-KDE host session, Krusader's (installed in the arch linux strata) "Open With" silently fails for apps in a guest stratum because KDE's KRun launcher depends on session services that are never started outside a KDE session. The fix is to override the affected .desktop files locally and prepend their Exec lines with strat:
cp /bedrock/strata/arch/usr/share/applications/appname.desktop ~/.local/share/applications/appname.desktop

sed -i 's|^Exec=|Exec=strat arch |' ~/.local/share/applications/appname.desktop

update-desktop-database ~/.local/share/applications/



The simble bash script to do it automatically (fix-strata-desktop.sh) is: #!/bin/bash

STRATA="arch"
SRC="/bedrock/strata/$STRATA/usr/share/applications"
SRC_CROSS="/bedrock/strata/$STRATA/bedrock/cross/applications"
DEST="$HOME/.local/share/applications"

mkdir -p "$DEST"

for src_file in "$SRC"/*.desktop "$SRC_CROSS"/*.desktop; do
# Skip if not a regular file (e.g. broken symlinks from Bedrock cross-mount)
[[ ! -f "$src_file" ]] && echo "Skipping: $(basename $src_file)" && continue

filename=$(basename "$src_file")
dest_file="$DEST/$filename"

cp "$src_file" "$dest_file"

# Only modify Exec lines that don't already have strat
if ! grep -q "Exec=strat $STRATA" "$dest_file"; then
sed -i "s|^Exec=|Exec=strat $STRATA |" "$dest_file"
fi

echo "Processed: $filename"
done

update-desktop-database "$DEST"
echo "Done."