#!/bin/sh

#copy files to user home
sed -i 's/#WaylandEnable=false/WaylandEnable=false/' /etc/gdm3/daemon.conf
sed -i 's/WaylandEnable=false/WaylandEnable=false/' /etc/gdm3/daemon.conf
sed -i 's/#WaylandEnable=true/WaylandEnable=false/' /etc/gdm3/daemon.conf
sed -i 's/WaylandEnable=true/WaylandEnable=false/' /etc/gdm3/daemon.conf

sed -i 's/AutomaticLogin=ogrenci/#AutomaticLogin=ogrenci/' /etc/gdm3/daemon.conf
sed -i 's/#AutomaticLogin=ogrenci/#AutomaticLogin=ogrenci/' /etc/gdm3/daemon.conf


if [ -d "/home" ]; then
    if ! [ -z "$(ls -A /home)" ]; then
        user=""
        for i in /home/*
        do
            cp -frv /tmp/musics/e-zil-ses "$i/"
            user=`basename $i`
            chown -Rv $user:$user "$i/e-zil-ses"

        done
    fi
fi
mkdir /usr/share/e-zil
chmod 777 /usr/share/e-zil
chmod 777 /usr/share/e-zil/*