source: lliurex-jclic-user-library/trunk/fuentes/lliurex-jclic-user-library.install/usr/bin/lliurex-jclic-user-library @ 5474

Last change on this file since 5474 was 5474, checked in by hectorgh, 23 months ago

disabling this until jclic share development is ready

File size: 3.4 KB
Line 
1#!/bin/bash
2
3# DISABLING THIS UNTIL JCLIC SHARE REDESIGN IS READY
4
5exit 0
6
7# ### #
8
9share_locale=$(xdg_translator $LANG Share)
10
11lib_path="$HOME/$share_locale/jclic-aula/"
12
13if [ ! -e "$lib_path" ];then
14
15        exit 0
16
17fi
18
19libs=$(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
21L_RATOLI=''
22L_MESTRE=''
23L_MURCIA=''
24
25for 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
35done;
36
37if [ -z "$L_RATOLI" -a -z "$L_MESTRE" -a -z "$L_MURCIA" ]; then
38    exit 0
39fi
40
41# Creacion plantillas de ficheros
42IFS=''
43edu_xtec_properties='#Tue Nov 08 13:04:30 CET 2016
44JClic=/home/__alumno__/JClic
45language=es'
46
47
48jclic_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
67library_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
102local_path="/home/$USER/"
103moving_path="/home/$USER/Documents/.moving_profiles"
104jclic_path="JClic/projects"
105
106properties_file=$(echo $edu_xtec_properties|sed -e "s%__alumno__%$USER%g")
107library_file=$library_jclic 
108cfg_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
110mkdir -p $moving_path/$jclic_path
111echo $properties_file > $moving_path/.edu.xtec.properties
112echo $library_file > $moving_path/$jclic_path/library.jclic
113echo $cfg_file > $moving_path/JClic/jclic.cfg
114chown $USER:students $moving_path/.edu.xtec.properties
115chown -R $USER:students $moving_path/JClic
116
117mkdir -p $local_path/$jclic_path
118cp $moving_path/.edu.xtec.properties $local_path
119cp -R $moving_path/JClic $local_path
120
121exit 0
Note: See TracBrowser for help on using the repository browser.