1 | #!/bin/bash |
---|
2 | |
---|
3 | # DISABLING THIS UNTIL JCLIC SHARE REDESIGN IS READY |
---|
4 | |
---|
5 | exit 0 |
---|
6 | |
---|
7 | # ### # |
---|
8 | |
---|
9 | share_locale=$(xdg_translator $LANG Share) |
---|
10 | |
---|
11 | lib_path="$HOME/$share_locale/jclic-aula/" |
---|
12 | |
---|
13 | if [ ! -e "$lib_path" ];then |
---|
14 | |
---|
15 | exit 0 |
---|
16 | |
---|
17 | fi |
---|
18 | |
---|
19 | libs=$(for x in $(find "$lib_path" -maxdepth 2 -name library.jclic -o -name jclic.jclic);do if [ "$(cat $x|grep menuElement|wc -l)" -gt "9" ]; then echo $x; fi; done;) |
---|
20 | |
---|
21 | L_RATOLI='' |
---|
22 | L_MESTRE='' |
---|
23 | L_MURCIA='' |
---|
24 | |
---|
25 | for x in $libs; do |
---|
26 | if [ -n "$(echo $x|egrep -i -o 'ratoli'|uniq)" ];then |
---|
27 | L_RATOLI='<library name="Activitats JClic Infantil i Primària 29/07/2012" path="$lib_path/ratoli/library.jclic" />' |
---|
28 | fi |
---|
29 | if [ -n "$(echo $x|egrep -i -o 'elteumestre'|uniq)" ];then |
---|
30 | L_MESTRE='<library name="elteumestre JClic Infantil i Primària" path="$lib_path/elteumestre_JClic_Infantil_Primaria_13.7/jclic.jclic" />' |
---|
31 | fi |
---|
32 | if [ -n "$(echo $x|egrep -i -o 'murcia'|uniq)" ];then |
---|
33 | L_MURCIA='<library name="Biblioteca CPR MURCIA II 08/09" path="$lib_path/Murcia/library.jclic" />' |
---|
34 | fi |
---|
35 | done; |
---|
36 | |
---|
37 | if [ -z "$L_RATOLI" -a -z "$L_MESTRE" -a -z "$L_MURCIA" ]; then |
---|
38 | exit 0 |
---|
39 | fi |
---|
40 | |
---|
41 | # Creacion plantillas de ficheros |
---|
42 | IFS='' |
---|
43 | edu_xtec_properties='#Tue Nov 08 13:04:30 CET 2016 |
---|
44 | JClic=/home/__alumno__/JClic |
---|
45 | language=es' |
---|
46 | |
---|
47 | |
---|
48 | jclic_cfg='<?xml version="1.0" encoding="UTF-8"?> |
---|
49 | <JClicSettings> |
---|
50 | <libraryManager autoRun="true"> |
---|
51 | __lib1__ |
---|
52 | __lib2__ |
---|
53 | __lib3__ |
---|
54 | </libraryManager> |
---|
55 | <language id="es" /> |
---|
56 | <paths> |
---|
57 | <path id="root" path="/home/__alumno__/JClic/projects" /> |
---|
58 | </paths> |
---|
59 | <reporter enabled="false" class="TCPReporter" params="path=server:9000" /> |
---|
60 | <sound enabled="true" system="true" mediaSystem="default" /> |
---|
61 | <lookAndFeel id="default" /> |
---|
62 | <browser id="" /> |
---|
63 | <skin id="@default.xml" /> |
---|
64 | <recentFiles /> |
---|
65 | </JClicSettings>' |
---|
66 | |
---|
67 | library_jclic='<?xml version="1.0" encoding="UTF-8"?> |
---|
68 | <JClicProject name="Sin_nombre" version="0.1.3" type="library"> |
---|
69 | <settings> |
---|
70 | <title>Biblioteca principal</title> |
---|
71 | <revision description="created" date="11/8/16" /> |
---|
72 | <descriptors /> |
---|
73 | </settings> |
---|
74 | <sequence> |
---|
75 | <item id="main" name="main"> |
---|
76 | <jump action="STOP" id="forward" /> |
---|
77 | <jump action="RETURN" id="back" /> |
---|
78 | </item> |
---|
79 | </sequence> |
---|
80 | <activities> |
---|
81 | <activity class="@panels.Menu" name="main"> |
---|
82 | <description> |
---|
83 | <p>Menú principal</p> |
---|
84 | </description> |
---|
85 | <messages> |
---|
86 | <cell type="initial"> |
---|
87 | <style /> |
---|
88 | <p>Menú principal</p> |
---|
89 | </cell> |
---|
90 | </messages> |
---|
91 | <settings margin="8" report="false"> |
---|
92 | <container bgColor="0xC0C0C0"> |
---|
93 | <counters time="false" actions="false" score="false" /> |
---|
94 | </container> |
---|
95 | <window bgColor="0xC0C0C0" border="true" /> |
---|
96 | </settings> |
---|
97 | </activity> |
---|
98 | </activities> |
---|
99 | <mediaBag /> |
---|
100 | </JClicProject>' |
---|
101 | |
---|
102 | local_path="/home/$USER/" |
---|
103 | moving_path="/home/$USER/Documents/.moving_profiles" |
---|
104 | jclic_path="JClic/projects" |
---|
105 | |
---|
106 | properties_file=$(echo $edu_xtec_properties|sed -e "s%__alumno__%$USER%g") |
---|
107 | library_file=$library_jclic |
---|
108 | cfg_file=$(echo $jclic_cfg|sed -e "s%__lib1__%$L_RATOLI%g" -e "s%__lib2__%$L_MESTRE%g" -e "s%__lib3__%$L_MURCIA%g" -e "s%__alumno__%$USER%g" -e "/^\s*$/d") |
---|
109 | |
---|
110 | mkdir -p $moving_path/$jclic_path |
---|
111 | echo $properties_file > $moving_path/.edu.xtec.properties |
---|
112 | echo $library_file > $moving_path/$jclic_path/library.jclic |
---|
113 | echo $cfg_file > $moving_path/JClic/jclic.cfg |
---|
114 | chown $USER:students $moving_path/.edu.xtec.properties |
---|
115 | chown -R $USER:students $moving_path/JClic |
---|
116 | |
---|
117 | mkdir -p $local_path/$jclic_path |
---|
118 | cp $moving_path/.edu.xtec.properties $local_path |
---|
119 | cp -R $moving_path/JClic $local_path |
---|
120 | |
---|
121 | exit 0 |
---|