Configurations for Mint

parent 778be466
#!/bin/bash
USERS="01-mini 02-super 03-maxi administrateur prof direction"
USERS="administrateur direction"
for u in $USERS
do
profile=`awk -F = '/^Path/{print $2}' /home/$u/.mozilla/firefox/profiles.ini`
......
#!/bin/bash
# Copyright (C) 2018 Tetras Libre <Contact@Tetras-Libre.fr>
# Author: Beniamine, David <David.Beniamine@Tetras-Libre.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
add-apt-repository ppa:libreoffice/ppa
apt-get update
DEBIAN_FRONTEND='noninteractive' apt-get -o Dpkg::Options::="--force-confold" -y upgrade
if [ "`whoami`" != "root" ]
then
echo "This script should be run as root"
exit 1
fi
# Install missing libreoffice gtk
if [ -z "`dpkg -l | grep libreoffice-gtk`" ]
then
apt-get install -y libreoffice-gtk
fi
cd /home
for u in *
do
if [ $u != "shares" ]
then
echo $u
cd $u/.config/libreoffice/4/user
sed -i.bak -e 's@^\(.*CreateBackup.*\)true\(.*\)$@\1false\2@' registrymodifications.xcu
if [ $u != "01-mini" ] && [ $u != "02-super" ]
then
sed -i -e 's@\(private:resource/toolbar/textobjectbar.*Visible.*\)false@\1true@' registrymodifications.xcu
fi
sed -i.bak -e "s/administrateur/$u/g" ecole/nom_rep.ini
if [ -z "$(grep '$(work)/Partages_Serveur' registrymodifications.xcu)" ]
then
sed -i "/<\/oor:items>/d" registrymodifications.xcu
cat <<EOF >> registrymodifications.xcu
<item oor:path="/org.openoffice.Office.Common/Path/Info"><prop oor:name="WorkPathChanged" oor:op="fuse"><value>true</value></prop></item>
<item oor:path="/org.openoffice.Office.Common/Path/Current"><prop oor:name="Work" oor:op="fuse"><value xsi:nil="true"/></prop></item>
<item oor:path="/org.openoffice.Office.Paths/Paths/org.openoffice.Office.Paths:NamedPath['Work']"><prop oor:name="WritePath" oor:op="fuse"><value>\$(work)/Partages_Serveur</value></prop></item>
</oor:items>
EOF
fi
diff registrymodifications.xcu registrymodifications.xcu.bak
fi
cd /home
done
#!/bin/bash
kmajor=$(uname -r | cut -d '.' -f 1)
kminor=$(uname -r | cut -d '.' -f 2)
echo $kver
if (( $(echo "$kmajor <= 4" | bc -l) )) && (( $(echo "$kminor < 19" | bc -l) ))
then
rm -f /etc/modprobe.d/alsa-base.conf
echo "deb http://deb.debian.org/debian stretch-backports main" \
> /etc/apt/sources.list.d/backports.list
apt-get update
pkg=$(apt-cache search "linux-image-4.19.*[0-9]-amd64" | \
sort -n | grep -v "amd64-.*" | tail -n 1 | awk '{print $1}')
apt-get install -y $pkg
echo "Pour prise en compte de la configuration de son, un redémarrage peut être nécessaire"
else
echo "kernel $kmajor.$kminor >= to 4.19, doing nothing"
fi
sed -i -e 's@^#\(session-cleanup-script=\)@\1/opt/primtux-eole/end_session.sh@' /etc/lightdm/lightdm.conf
#!/bin/bash
USERS="01-mini 02-super 03-maxi prof direction administrateur"
for u in $USERS
do
file="/home/$u/.xscreensaver"
if [ ! -e $file ]
then
cat <<EOF >$file
# XScreenSaver Preferences File
# Written by xscreensaver-demo 5.36 for david on Sat Jan 27 19:16:00 2018.
# https://www.jwz.org/xscreensaver/
timeout: 0:30:00
cycle: 0:10:00
lock: False
lockTimeout: 0:00:00
passwdTimeout: 0:00:30
visualID: default
installColormap: True
verbose: False
timestamp: True
splash: True
splashDuration: 0:00:05
demoCommand: xscreensaver-demo
prefsCommand: xscreensaver-demo -prefs
nice: 10
memoryLimit: 0
fade: True
unfade: False
fadeSeconds: 0:00:03
fadeTicks: 20
captureStderr: True
ignoreUninstalledPrograms:False
font: *-medium-r-*-140-*-m-*
dpmsEnabled: False
dpmsQuickOff: False
dpmsStandby: 2:00:00
dpmsSuspend: 2:00:00
dpmsOff: 4:00:00
grabDesktopImages: False
grabVideoFrames: False
chooseRandomImages: False
imageDirectory:
mode: random
selected: -1
textMode: url
textLiteral: XScreenSaver
textFile:
textProgram: fortune
textURL: http://planet.debian.org/rss20.xml
programs: \
- maze -root \n\
- GL: superquadrics -root \n\
attraction -root \n\
blitspin -root \n\
- greynetic -root \n\
- helix -root \n\
- hopalong -root \n\
- imsmap -root \n\
- noseguy -root \n\
- pyro -root \n\
- qix -root \n\
- rocks -root \n\
- rorschach -root \n\
- decayscreen -root \n\
- flame -root \n\
- halo -root \n\
- slidescreen -root \n\
- pedal -root \n\
bouboule -root \n\
- braid -root \n\
- coral -root \n\
- deco -root \n\
- drift -root \n\
- fadeplot -root \n\
galaxy -root \n\
- goop -root \n\
- grav -root \n\
- ifs -root \n\
- unicode -root \n\
- GL: jigsaw -root \n\
- julia -root \n\
- kaleidescope -root \n\
- GL: moebius -root \n\
- moire -root \n\
- GL: morph3d -root \n\
- mountain -root \n\
- munch -root \n\
penrose -root \n\
- GL: pipes -root \n\
- rd-bomb -root \n\
- GL: rubik -root \n\
- sierpinski -root \n\
- slip -root \n\
- GL: sproingies -root \n\
- starfish -root \n\
- strange -root \n\
- swirl -root \n\
- triangle -root \n\
- xjack -root \n\
xlyap -root \n\
- GL: atlantis -root \n\
bsod -root \n\
- GL: bubble3d -root \n\
- GL: cage -root \n\
- crystal -root \n\
- cynosure -root \n\
- discrete -root \n\
- distort -root \n\
- epicycle -root \n\
- flow -root \n\
- GL: glplanet -root \n\
- interference -root \n\
- kumppa -root \n\
- GL: lament -root \n\
- moire2 -root \n\
- GL: sonar -root \n\
- GL: stairs -root \n\
- truchet -root \n\
- vidwhacker -root \n\
blaster -root \n\
bumps -root \n\
ccurve -root \n\
- compass -root \n\
- deluxe -root \n\
- demon -root \n\
- GL: extrusion -root \n\
- loop -root \n\
- penetrate -root \n\
- petri -root \n\
- phosphor -root \n\
- GL: pulsar -root \n\
- ripples -root \n\
shadebobs -root \n\
- GL: sierpinski3d -root \n\
- spotlight -root \n\
- squiral -root \n\
- wander -root \n\
- webcollage -root \n\
- xflame -root \n\
- xmatrix -root \n\
- GL: gflux -root \n\
- nerverot -root \n\
- xrayswarm -root \n\
- xspirograph -root \n\
- GL: circuit -root \n\
- GL: dangerball -root \n\
- GL: engine -root \n\
- GL: flipscreen3d -root \n\
- GL: gltext -root \n\
- GL: menger -root \n\
- GL: molecule -root \n\
- rotzoomer -root \n\
- speedmine -root \n\
- GL: starwars -root \n\
- GL: stonerview -root \n\
- vermiculate -root \n\
- whirlwindwarp -root \n\
- zoom -root \n\
- anemone -root \n\
apollonian -root \n\
- GL: boxed -root \n\
- GL: cubenetic -root \n\
- GL: endgame -root \n\
- euler2d -root \n\
- fluidballs -root \n\
- GL: flurry -root \n\
- GL: glblur -root \n\
- GL: glsnake -root \n\
- halftone -root \n\
- GL: juggler3d -root \n\
- GL: lavalite -root \n\
- polyominoes -root \n\
- GL: queens -root \n\
- GL: sballs -root \n\
- GL: spheremonics -root \n\
- thornbird -root \n\
- twang -root \n\
- GL: antspotlight -root \n\
apple2 -root \n\
- GL: atunnel -root \n\
barcode -root \n\
- GL: blinkbox -root \n\
- GL: blocktube -root \n\
- GL: bouncingcow -root \n\
- cloudlife -root \n\
- GL: cubestorm -root \n\
- eruption -root \n\
- GL: flipflop -root \n\
- GL: flyingtoasters -root \n\
- fontglide -root \n\
- GL: gleidescope -root \n\
- GL: glknots -root \n\
- GL: glmatrix -root \n\
- GL: glslideshow -root \n\
- GL: hypertorus -root \n\
- GL: jigglypuff -root \n\
metaballs -root \n\
- GL: mirrorblob -root \n\
- piecewise -root \n\
- GL: polytopes -root \n\
- pong -root \n\
- popsquares -root \n\
- GL: surfaces -root \n\
- xanalogtv -root \n\
abstractile -root \n\
anemotaxis -root \n\
- GL: antinspect -root \n\
- fireworkx -root \n\
- fuzzyflakes -root \n\
- interaggregate -root \n\
- intermomentary -root \n\
- memscroller -root \n\
- GL: noof -root \n\
- pacman -root \n\
- GL: pinion -root \n\
- GL: polyhedra -root \n\
- GL: providence -root \n\
- substrate -root \n\
- wormhole -root \n\
- GL: antmaze -root \n\
- GL: boing -root \n\
boxfit -root \n\
- GL: carousel -root \n\
- celtic -root \n\
- GL: crackberg -root \n\
- GL: cube21 -root \n\
fiberlamp -root \n\
- GL: fliptext -root \n\
- GL: glhanoi -root \n\
- GL: tangram -root \n\
- GL: timetunnel -root \n\
- GL: glschool -root \n\
- GL: topblock -root \n\
- GL: cubicgrid -root \n\
- cwaves -root \n\
- GL: gears -root \n\
- GL: glcells -root \n\
- GL: lockward -root \n\
- m6502 -root \n\
- GL: moebiusgears -root \n\
- GL: voronoi -root \n\
- GL: hypnowheel -root \n\
- GL: klein -root \n\
- lcdscrub -root \n\
- GL: photopile -root \n\
- GL: skytentacles -root \n\
- GL: rubikblocks -root \n\
- GL: companioncube -root \n\
- GL: hilbert -root \n\
- GL: tronbit -root \n\
- GL: geodesic -root \n\
- hexadrop -root \n\
- GL: kaleidocycle -root \n\
- GL: quasicrystal -root \n\
- GL: unknownpleasures -root \n\
binaryring -root \n\
- GL: cityflow -root \n\
- GL: geodesicgears -root \n\
- GL: projectiveplane -root \n\
- GL: romanboy -root \n\
- tessellimage -root \n\
- GL: winduprobot -root \n\
- GL: splitflap -root \n\
- GL: cubestack -root \n\
- GL: cubetwist -root \n\
- GL: discoball -root \n\
- GL: dymaxionmap -root \n\
- GL: energystream -root \n\
- GL: hexstrut -root \n\
- GL: hydrostat -root \n\
- GL: raverhoop -root \n\
- GL: splodesic -root \n\
- GL: unicrud -root \n\
pointerPollTime: 0:00:05
pointerHysteresis: 10
windowCreationTimeout:0:00:30
initialDelay: 0:00:00
GetViewPortIsFullOfLies:False
procInterrupts: True
xinputExtensionDev: False
overlayStderr: True
authWarningSlack: 20
EOF
else
sed -ie 's/\(timeout:\s*\)\S*\s*$/\1\t0:30:00/' $file
fi
done
#!/bin/bash
if [ -z "$(dpkg -l | grep catfish)" ]
then
export DEBIAN_FRONTEND=noninteractive
apt-get install -y catfish
fi
USERS="prof direction administrateur"
for u in $USERS
do
launcher_path="/home/$u/.config/xfce4/panel/launcher-18/catfish.desktop"
mkdir -p /home/$u/.config/xfce4/panel/launcher-18
cp /usr/share/applications/catfish.desktop $launcher_path
xml_path="/home/$u/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml"
if [ -z "`grep plugin-18 $xml_path`" ]
then
sed -i.bak \
-e 's@\(\s*\)\(<value type="int" value="2"/>\)@\1<value type="int" value="18"/>\n\1\2@' \
$xml_path
tmp_path="/tmp/$$"
head -n -2 $xml_path > $tmp_path
cat << EOF >> $tmp_path
<property name="plugin-18" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="catfish.desktop"/>
</property>
</property>
</property>
</channel>
EOF
mv /tmp/$$ $xml_path
chown -R $u:$u $xml_path
chown $u:$u $xml_path
fi
done
#!/bin/bash
DIR=$(realpath $(dirname $0))
USERS="01-mini 02-super 03-maxi prof"
if [ -z "$(dpkg -l | grep orca)" ]
then
apt-get update
apt-get install -y gnome-orca speech-dispatcher-espeak-ng python3-yaml
fi
for u in $USERS
do
confdir="/home/$u/.local/share/orca/"
mkdir -p $confdir
cp $DIR/orca.conf $confdir/user-settings.conf
chown -R $u:$u $confdir
done
$DIR/add_to_handy_menu.py $DIR/orca.desktop "Accessibilité langue" mini maxi super prof
......@@ -22,22 +22,9 @@ fi
DIR=`dirname $0`
echo "Fixing network issues"
$DIR/fix_network.sh
#echo "Fixing network issues"
#$DIR/fix_network.sh
NEW_USERS="prof direction"
USERS="01-mini 02-super 03-maxi administrateur $NEW_USERS"
declare -A USER_COMMENTS
USER_COMMENTS=( \
[01-mini]="01-CP"\
[02-super]="02-CE1-CE2"\
[03-maxi]="03-CM1-CM2"\
[prof]="04-prof"\
[direction]="05-direction"\
[administrateur]="administrateur"\
)
MANUAL_APP_TO_REMOVE="seamonkey dillo"
PROXY_URL="http://dnsproxy:3128"
......@@ -48,67 +35,34 @@ DEBIAN_FRONTEND='noninteractive' apt-get -o Dpkg::Options::="--force-confold" -y
test_and_fail $? "Cannot run upgrade"
DEBIAN_FRONTEND='noninteractive' apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade
test_and_fail $? "Cannot run dist upgrade"
logicielsAllFile="/usr/local/bin/primtux/logiciels-all"
if [ -x "$logicielsAllFile" ]
then
export DEBIAN_FRONTEND='noninteractive'
$logicielsAllFile
else
additionalSoftwares=$(cat $logicielsAllFile)
fi
# TODO : install repo Primtux
DEBIAN_FRONTEND='noninteractive' apt-get -o Dpkg::Options::="--force-confold" -y install \
appliplanet-primtux \
ardora-primtux \
cifs-utils \
conky \
cups-browsed \
evince \
flash-primtux \
libdvdcss2 \
libreoffice-gtk \
netcat \
openjdk-8-jre \
openjdk-8-jdk \
photofiltre-primtux \
numlockx \
polices-ecole-primtux \
tftp \
thunderbird \
thunderbird-l10n-fr \
ttf-mscorefonts-installer \
vlc-plugin-fluidsynth \
x11vnc \
xnview \
$additionalSoftwares
test_and_fail $? "Cannot install required packages"
DEBIAN_FRONTEND='noninteractive' apt-get -y remove --purge \
ctparental \
dillo \
proxy-protect-firefox-esr \
tinyproxy \
webstrict-primtux \
xournal \
xpdf
apt-get -y autoremove --purge
systemctl disable dnsmasq
echo "Adding x11vnc"
cp $DIR/x11vnc.desktop /usr/share/applications/
echo "Creating users $NEW_USERS"
for u in $NEW_USERS
do
groupadd $u
useradd $u --create-home \
--groups $u,lp,users,cdrom,audio,video,plugdev,netdev,lpadmin,scanner,sambashare \
--gid $u \
--shell /bin/bash
done
echo "Renaming users"
for u in "${!USER_COMMENTS[@]}"
do
usermod -c ${USER_COMMENTS[$u]} $u
done
u="direction"
echo "Creating users $u"
groupadd direction
useradd $u --create-home \
--groups $u,cdrom,dip,plugdev,lpadmin,sambashare \
--gid $u \
--shell /bin/bash
echo "Configuring user session"
cp $DIR/session.sh /usr/local/bin/
......@@ -128,32 +82,4 @@ sed -i.bak -e '/Acquire::http::Proxy/d' $debfile
echo "Acquire::http::Proxy \"$PROXY_URL\";" >> $debfile
echo "Acquire::https::Proxy \"$PROXY_URL\";" >> $debfile
echo "Removing seamonkey and dillo"
for u in $USERS
do
for prog in $MANUAL_APP_TO_REMOVE
do
find /home/$u -name "*$prog*" -exec rm -rf {} \;
done
done
$DIR/fix_libreoffice.sh
# Copy .config files
echo "Copying conf files"
OLDDIR=$PWD
cd $DIR/config
for u in *
do
cd $u
for f in `find . -type f`
do
dir="/home/$u/.config/`dirname $f`"
mkdir -p $dir
cp -v $f $dir
done
cd -
done
cd $OLDDIR
$DIR/update_configurations.sh
......@@ -9,11 +9,6 @@ then
echo "@weekly 15 UpdatePrimtux $DIR/$name > /var/log/ptUpdate.log 2>&1" >> $tabfile
fi
if [ -z "$(dpkg -l | grep python3-yaml)" ]
then
apt-get install -y python3-yaml
fi
run_script(){
echo "Running $1"
$DIR/$1
......@@ -26,19 +21,12 @@ cp $DIR/session.sh /usr/local/bin/
run_script add_session_script.sh
run_script create_cifs_mounts.sh
run_script set_mime_apps.sh
run_script set_screens.sh
run_script install_print_drivers.sh
# run_script install_print_drivers.sh
run_script fix_libreoffice.sh
run_script install_vnc.sh
run_script install_conky.sh
run_script upgrade_repository.sh
run_script fix_sound.sh
run_script fix_xscreensaver.sh
run_script fix_pcmanfm.sh
run_script fix_cups.sh
run_script fix_firefox.sh
run_script fix_proxy.sh
run_script update_faces.sh
run_script install_orca.sh
run_script register.sh
run_script install_catfish.sh
#!/bin/bash
DIR=`dirname $0`
cd $DIR
for f in face_*
do
u=${f/*_/}
u=${u/\.*/}
cp "$f" /home/$u/.face
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment