#!/bin/sh
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #
# Zakladam, ze w systemie istnieje uzytkownik  #
#      ksenos                                  #
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #


# Instalacja repozytorium Ksenos
rpm -Uvh http://packages.ksenos.fi/centos/6/x86_64/ksenos-release-0.1-3.noarch.rpm
# Instalacja Ksenos
yum -y install ksenos-gui ksenos-gallery
# Uprawnienia dla uzytkownika ksenos
chown -R ksenos:ksenos /var/lib/ksenos/capture 

yum -y update

rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm

yum -y install kmod-joydev nano gedit evince eog vlc gnome-system-monitor 

# Instalacja driverow nvidia
# --- # yum -y install nvidia-detect && yum -y install $(nvidia-detect)

# Automatyczne logowanie
echo "AutomaticLoginEnable=true" >> /etc/gdm/custom.conf
echo "AutomaticLogin=ksenos" >> /etc/gdm/custom.conf
    	
# Wylaczenie raportowania bledow do CentOS
chkconfig abrtd off
# Wylaczenie firewall
chkconfig iptables off
#(kdump is for creating crash dump from kernel crashes)
chkconfig kdump off

# konfiguracja masymalnej ilosci polaczen
echo "ksenos soft nofile 10000" >> /etc/security/limits.conf
echo "ksenos hard nofile 10000" >> /etc/security/limits.conf


# konfiguracja desktop
su - ksenos
#(Removes computer, home and trash icons from desktop)
gconftool-2 --type boolean --set /apps/nautilus/desktop/computer_icon_visible "false"
gconftool-2 --type boolean --set /apps/nautilus/desktop/home_icon_visible "false"
gconftool-2 --type boolean --set /apps/nautilus/desktop/trash_icon_visible "false"
#(Use browser style view on file explorer)
gconftool-2 --type boolean --set /apps/nautilus/preferences/always_use_browser "true"
#(Disable system hibernate and suspend)
gconftool-2 --type boolean --set /apps/gnome-power-manager/can_hibernate "false"
gconftool-2 --type boolean --set /apps/gnome-power-manager/can_suspend "false"
#(Disable screensaver and locking)
gconftool-2 --type boolean --set /apps/gnome-screensaver/lock_enabled "false"
gconftool-2 --type boolean --set /apps/gnome-screensaver/idle_activation_enabled "false"
#(Disable monitor and computer sleep)
gconftool-2 --type string --set /apps/gnome-power-manager/timeout/sleep_computer_ac "0"
gconftool-2 --type string --set /apps/gnome-power-manager/timeout/sleep_display_ac "0"
#(Set solid black background)
gconftool-2 --type string --set /desktop/gnome/background/color_shading_type "solid"
gconftool-2 --type string --set /desktop/gnome/background/picture_filename ""
gconftool-2 --type string --set /desktop/gnome/background/picture_options "none"
gconftool-2 --type string --set /desktop/gnome/background/primary_color "#000000"
exit

