24 lines
754 B
Bash
24 lines
754 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-1 /run/user/"$(id -u)"/wayland-1 \
|
|
--ro-bind ~/.cache/fontconfig ~/.cache/fontconfig \
|
|
--ro-bind ~/.config/evince ~/.config/evince \
|
|
--ro-bind "${@: -1}" ~/"$(basename "${@: -1}")" \
|
|
--chdir ~/ \
|
|
--unshare-all \
|
|
--new-session \
|
|
--seccomp 10 \
|
|
10< /usr/local/bin/seccomp_default_filter.bpf \
|
|
/usr/bin/evince "$(basename "${@: -1}")"
|
|
)
|