23 lines
744 B
Bash
23 lines
744 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
(
|
|
exec bwrap \
|
|
--ro-bind /usr/bin/evince /usr/bin/evince \
|
|
--ro-bind /usr/share /usr/share \
|
|
--ro-bind /usr/lib /usr/lib \
|
|
--ro-bind /usr/lib64 /usr/lib64 \
|
|
--symlink /usr/lib64 /lib64 \
|
|
--proc /proc \
|
|
--dev /dev \
|
|
--ro-bind /etc/fonts /etc/fonts \
|
|
--ro-bind /run/user/"$(id -u)"/"$WAYLAND_DISPLAY" /run/user/"$(id -u)"/"$WAYLAND_DISPLAY" \
|
|
--ro-bind-try ~/.cache/fontconfig ~/.cache/fontconfig \
|
|
--ro-bind-try ~/.config/evince ~/.config/evince \
|
|
--ro-bind-try "${@: -1}" "$(realpath "${@: -1}")" \
|
|
--unshare-all \
|
|
--new-session \
|
|
--seccomp 10 \
|
|
10< /usr/local/bin/seccomp_default_filter.bpf \
|
|
/usr/bin/evince "$@"
|
|
)
|