1 | #!/bin/bash |
---|
2 | |
---|
3 | prefs_file=/home/$USER/Library/Preferences/com.halfbakedsoftware/hotpot6prefs.xml |
---|
4 | interface_path=/usr/share/hotpotatoes/interface |
---|
5 | config_path=/usr/share/hotpotatoes/config |
---|
6 | original_prefs=/usr/share/hotpotatoes/hotpot6prefs.xml |
---|
7 | user_conf_path=/home/$USER/config |
---|
8 | user_interface_path=/home/$USER/interface |
---|
9 | |
---|
10 | |
---|
11 | conf_option="none" |
---|
12 | int_option="none" |
---|
13 | |
---|
14 | langs="es_ES.utf8 es_ES.UTF-8" |
---|
15 | |
---|
16 | langs_val="ca_ES.UTF-8@valencia" |
---|
17 | |
---|
18 | |
---|
19 | #### Comprobando idioma del sistema y configurando el script en base a ello... |
---|
20 | |
---|
21 | rm $prefs_file |
---|
22 | |
---|
23 | echo $langs | grep $LANG && rc=0 || rc=1 |
---|
24 | echo $langs_val | grep $LANG && rc_v=0 || rc_v=1 |
---|
25 | |
---|
26 | if [ "$rc" = 0 ] |
---|
27 | then |
---|
28 | #echo "Configuracion en español" |
---|
29 | #echo "Instalando..." |
---|
30 | interface_file=$interface_path/espanol6.xml |
---|
31 | config_file=$config_path/espanol6.cfg |
---|
32 | user_conf_file=$user_conf_path/espanol6.cfg |
---|
33 | user_interface_file=$user_interface_path/espanol6.xml |
---|
34 | conf_option="espanol6" |
---|
35 | int_option="espanol6" |
---|
36 | |
---|
37 | elif [ "$rc_v" = 0 ] |
---|
38 | then |
---|
39 | #echo "Configuracion en valenciano" |
---|
40 | #echo "Instalando..." |
---|
41 | interface_file=$interface_path/valencian.xml |
---|
42 | config_file=$config_path/valencian.cfg |
---|
43 | user_conf_file=$user_conf_path/valencian.cfg |
---|
44 | user_interface_file=$user_interface_path/valencian.xml |
---|
45 | conf_option="valencian" |
---|
46 | int_option="valencian" |
---|
47 | export LANG=ca_ES.utf-8 |
---|
48 | else |
---|
49 | #echo "English configuration" |
---|
50 | #echo "Installing..." |
---|
51 | interface_file=$interface_path/JHP6English.xml |
---|
52 | config_file=$config_path/English6.cfg |
---|
53 | user_conf_file=$user_conf_path/English6.cfg |
---|
54 | user_interface_file=$user_interface_path/JHP6English.xml |
---|
55 | conf_option="English6" |
---|
56 | int_option="JHP6English" |
---|
57 | fi |
---|
58 | |
---|
59 | ############################ |
---|
60 | |
---|
61 | #### Comprobando existencia de archivos ... |
---|
62 | |
---|
63 | if [ ! -f $prefs_file ] |
---|
64 | then |
---|
65 | #echo "Creando archivo de preferencias..." |
---|
66 | cat $original_prefs | sed -e "s/__@__user__@__/$USER/g" -e "s/__@__interface-language__@__/$int_option/g" -e "s/__@__config-language__@__/$conf_option/g" > /tmp/hotpot6prefs.xml |
---|
67 | mkdir -p /home/$USER/Library/Preferences/com.halfbakedsoftware/ |
---|
68 | cp /tmp/hotpot6prefs.xml $prefs_file |
---|
69 | rm /tmp/hotpot6prefs.xml |
---|
70 | fi |
---|
71 | |
---|
72 | if [ ! -f $user_conf_file ] |
---|
73 | then |
---|
74 | #echo "Copiando archivo de configuracion de lenguaje... $config_file" |
---|
75 | mkdir -p $user_conf_path |
---|
76 | cp $config_file $user_conf_file |
---|
77 | fi |
---|
78 | |
---|
79 | |
---|
80 | if [ ! -f $user_interface_file ] |
---|
81 | then |
---|
82 | #echo "Creando archivo de lenguaje de interface... $interface_file" |
---|
83 | mkdir -p $user_interface_path |
---|
84 | cp $interface_file $user_interface_file |
---|
85 | fi |
---|
86 | |
---|
87 | |
---|
88 | |
---|
89 | |
---|
90 | |
---|
91 | ################################# |
---|
92 | |
---|
93 | #### Ejecutando hotpot6.jar desde subdirectorio... |
---|
94 | cd /usr/share/hotpotatoes/ |
---|
95 | java -jar /usr/share/hotpotatoes/JavaHotPotatoes6.app/Contents/Resources/Java/hotpot6.jar |
---|
96 | |
---|
97 | |
---|
98 | |
---|
99 | |
---|