aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/run_onchange_after_deploy-flatpak-overrides.sh.tmpl
blob: 6ce657dee9fef51a19f43f0a1daf18a2bd86648c (plain) (blame)
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
27
28
29
30
31
#!/bin/sh
# Read-only host config bindings for flatpaks that should pick up our
# chezmoi-managed ~/.config/<app>/ rather than maintaining a separate
# in-sandbox copy. Idempotent; flatpak override merges entries.
#
# script hash: {{ output "sh" "-c" (printf "sha256sum %q/run_onchange_after_deploy-flatpak-overrides.sh.tmpl 2>/dev/null || true" .chezmoi.sourceDir) }}
set -eu

apply() {
	app=$1
	shift
	flatpak info --user "$app" >/dev/null 2>&1 || return 0
	flatpak override --user "$@" "$app"
}

apply org.pwmt.zathura --filesystem=xdg-config/zathura:ro
apply io.mpv.Mpv --filesystem=xdg-config/mpv:ro

# LibreWolf needs raw /dev access for v4l2 webcams. Flatpak has no
# finer-grained device option, so this opens video/dri/snd at once.
apply io.gitlab.librewolf-community --device=all

# Host fonts (notably noto-fonts-emoji) for every flatpak. Without this,
# browsers and other GUI apps fall back to tofu boxes for emoji and
# nerd-font glyphs. Applied globally with `flatpak override --user`
# (no app argument).
flatpak override --user \
	--filesystem=/usr/share/fonts:ro \
	--filesystem=/usr/local/share/fonts:ro \
	--filesystem=xdg-data/fonts:ro \
	--filesystem=xdg-config/fontconfig:ro