-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathzathura
26 lines (25 loc) · 990 Bytes
/
zathura
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
set -euo pipefail
(
exec bwrap \
--ro-bind /usr/bin/zathura-sandbox /usr/bin/zathura-sandbox \
--ro-bind /usr/share /usr/share \
--ro-bind /usr/lib /usr/lib \
--symlink /usr/lib /lib \
--ro-bind /usr/lib64 /usr/lib64 \
--symlink /usr/lib64 /lib64 \
--proc /proc \
--ro-bind /run/user/"$(id -u)"/"$WAYLAND_DISPLAY" /run/user/"$(id -u)"/"$WAYLAND_DISPLAY" \
--ro-bind /etc/fonts /etc/fonts \
--bind-try ~/.local/share/zathura ~/.local/share/zathura \
--ro-bind-try ~/.config/zathura ~/.config/zathura \
--bind-try ~/.cache/fontconfig ~/.cache/fontconfig \
--ro-bind-try "${@: -1}" "$(realpath "${@: -1}")" \
--unsetenv DBUS_SESSION_BUS_ADDRESS \
--unshare-all \
--new-session \
--seccomp 10 \
10< /usr/local/bin/seccomp_default_filter.bpf \
/usr/bin/zathura-sandbox "$@"
)
## zathura supports a native sandbox via seccomp and landlock in a separate zathura-sandbox binary