summarylogtreecommitdiffstats
path: root/pamac.install
blob: baa9e01f019fe74af836f0c9542152da706ef080 (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
45
46
47
48
49
50
#!/hint/bash

_add_flathub() {
	if [ -f /usr/bin/flatpak ]; then
		flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
	fi
}

post_install() {
	# remove file (#28, #29)
	[[ -e /var/tmp/pamac/dbs/sync/refresh_timestamp ]] && rm -f /var/tmp/pamac/dbs/sync/refresh_timestamp

	# enable flatpak repo
	_add_flathub
	
	# enable classic snap support
	if [ -f /usr/bin/snap ]; then
		#ln -s /var/lib/snapd/snap /snap
		systemctl enable snapd.socket
	fi
	
	# enable systemd timers
	mkdir -p /etc/systemd/system/timers.target.wants
	ln -sf /usr/lib/systemd/system/pamac-cleancache.timer /etc/systemd/system/multi-user.target.wants
	#ln -sf /usr/lib/systemd/system/pamac-mirrorlist.timer /etc/systemd/system/multi-user.target.wants
	
	# polkit agent
	echo '==> An authentication agent is required'
	echo '    Cinnamon, Deepin, GNOME, GNOME Flashback, KDE, LXDE, LXQt, MATE and Xfce'
	echo '    have an authentication agent already.'
	echo '    See https://wiki.archlinux.org/index.php/Polkit#Authentication_agents'
	echo '    for other desktop environments.'
}

post_upgrade() {
	# enable flatpak repo
	_add_flathub
	
	# enable classic snap support
	if [ -f /usr/bin/snap ]; then
		#ln -s /var/lib/snapd/snap /snap
		systemctl is-active snapd.socket >/dev/null || systemctl enable snapd.socket
	fi
}

post_remove() {
	# disable systemd timers
	rm -f /etc/systemd/system/multi-user.target.wants/pamac-cleancache.timer
	#rm -f /etc/systemd/system/multi-user.target.wants/pamac-mirrorlist.timer
}