Skip to content

Commit 1f7ae54

Browse files
committed
feat: expose host apps in the cpak session
1 parent 82c51db commit 1f7ae54

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

cpak.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,17 @@
3939
"deviceAll": false,
4040
"notification": false,
4141
"openURI": false,
42-
"filesystem": [],
42+
"hostApplications": true,
43+
"filesystem": [
44+
{ "path": "xdg-desktop", "access": "read-write" },
45+
{ "path": "xdg-documents", "access": "read-write" },
46+
{ "path": "xdg-download", "access": "read-write" },
47+
{ "path": "xdg-music", "access": "read-write" },
48+
{ "path": "xdg-pictures", "access": "read-write" },
49+
{ "path": "xdg-public-share", "access": "read-write" },
50+
{ "path": "xdg-templates", "access": "read-write" },
51+
{ "path": "xdg-videos", "access": "read-write" }
52+
],
4353
"env": [
4454
"PATH=/opt/singularity/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
4555
"LD_LIBRARY_PATH=/opt/singularity/lib",

cpak/singularity-cpak-session

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,14 @@ if [ -z "$owner" ] || ! kill -0 "$owner" 2>/dev/null; then
1919
chmod 0444 "$lock"
2020
fi
2121

22+
if [ -n "${CPAK_DESKTOP_RUNTIME:-}" ]; then
23+
outer_wayland="${WAYLAND_DISPLAY:-wayland-0}"
24+
case "$outer_wayland" in
25+
/*) ;;
26+
*) outer_wayland="${XDG_RUNTIME_DIR}/${outer_wayland}" ;;
27+
esac
28+
export XDG_RUNTIME_DIR="$CPAK_DESKTOP_RUNTIME"
29+
export WAYLAND_DISPLAY="$outer_wayland"
30+
fi
31+
2232
exec /opt/singularity/bin/singularity-labwc-session "$@"

0 commit comments

Comments
 (0)