summarylogtreecommitdiffstats
path: root/ricoh-sp220-som.install
blob: 41da3dc61254645ba63788b685fd00e324bf3ce8 (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
51

name=smart-organizing-monitor-for-sp-200series

install_system_icons() {
	# Add icons to the system icons
	XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null`"
	if [ -x "$XDG_ICON_RESOURCE" ]; then
	    for icon in "/opt/$name/som_"*.png; do
			size="${icon##*/som_}"
			"$XDG_ICON_RESOURCE" $1 --size "${size%.png}" "$icon" $name
	    done
	fi
}

update_menus() {
	#update the menu
	UPDATE_MENUS="`which update-menus 2> /dev/null`"
	#update the menu
	if [ -x "$UPDATE_MENUS" ]; then
	  update-menus
	fi
}

post_install() {
	install_system_icons install

	update_menus

	#add w+r for DevCfg.ini
	rm -f /home/*/.sdcdevcfgnetb.ini
	rm -f /home/*/.som200series.ini
	rm -f /home/*/.som200seriesa.ini
	rm -f /home/*/.som_ui.ini
	rm -f /home/*/.som_uia.ini
}

pre_remove() {
	install_system_icons uninstall
}

post_remove() {
	update_menus
}

pre_upgrade() {
	pre_remove
}

post_upgrade() {
	post_install
}