summarylogtreecommitdiffstats
path: root/autenticacao-gov-pt-bin.install
blob: d5989687cd7ac02c5115d106f03a19a91a61d80b (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
set -e

setup_icons() {
	cd /usr/share/pixmaps
	regex="([^_]+)_([0-9]+).png$"
	for file in *.png
	do
		if [[ $file  =~ $regex ]]
		then
			icon="${BASH_REMATCH[1]##*/}"
			size="${BASH_REMATCH[2]}"
			case "$1" in
				install)
					echo xdg-icon-resource install --context apps --size "$size" "$file" "$icon"
					;;
				uninstall)
					echo xdg-icon-resource uninstall --context apps --size "$size" "$icon"
					;;
				*)
					exit 1
					;;
			esac
		fi
	done
}

setup_fonts() {
 fc-cache /usr/share/fonts/pteid/lato
}

post_upgrade() {
	post_install
	setup_fonts
}

post_install() {
	setup_icons install
	setup_fonts
}

pre_remove() {
	setup_icons uninstall
}