]> Creatis software - bbtk.git/blob - kernel/install/gnome/bbtk-install-gnome.sh
*** empty log message ***
[bbtk.git] / kernel / install / gnome / bbtk-install-gnome.sh
1 #!/bin/bash
2 echo "***** Installing bbi on gnome desktop *****"
3
4 BBI=$(which bbi)
5 echo "* bbi path = ${BBI}"
6
7 # The desktop launcher & its icon
8 echo "* Creating bbi launcher on desktop (${HOME}/.local/share/applications/bbi.desktop)"
9 sed s,HOME,${HOME},g bbi.desktop.in > tmp
10 sed s,BBI,${BBI},g tmp > tmp2
11 mv tmp2 ${HOME}/.local/share/applications/bbi.desktop
12 rm tmp
13
14 ln -s ${HOME}/.local/share/applications/bbi.desktop ${HOME}/Desktop/bbi.desktop
15
16 echo "* Copying bbi icons in ${HOME}/.local/share/applications/"
17 cp bbi-icon.png ${HOME}/.local/share/applications/
18 cp bbi-icon2.png ${HOME}/.local/share/applications/
19
20 # add the type 'text/bbs' to mime database
21 echo "* Adding mime-type 'text/bbs' to mime database (${HOME}/.local/share/mime/packages/bbs.xml)"
22 if [ ! -d ${HOME}/.local/share/mime ] 
23     then
24     mkdir  ${HOME}/.local/share/mime
25     if [ ! -d ${HOME}/.local/share/mime/packages ]
26         then
27         mkdir  ${HOME}/.local/share/mime/packages
28     fi 
29 fi 
30 cp bbs.xml ${HOME}/.local/share/mime/packages/
31 update-mime-database ${HOME}/.local/share/mime
32 nautilus --quit 
33 nautilus ${HOME}/Desktop &
34
35 # associate 'text/bbs' to the desktop launcher
36 # add the line 'text/bbs=bbi.desktop' 
37 # in file ${HOME}/.local/share/applications/defaults.list
38 line="text/bbs=bbi.desktop"
39 file="${HOME}/.local/share/applications/defaults.list"
40 if grep -q ${line} ${file} 
41 then
42     echo "* Mime-type 'text/bbs' already present in '${file}' : nothing to do"
43 else
44     echo "* Associating mime-type 'text/bbs' to 'bbi.desktop' (${file})"
45     echo ${line} | cat >> ${file}
46 fi