#!/bin/bash

if [ $UID -ne 0 ];then
	sudo $0
	exit;
fi

#delete themes
MDM_THEME_DIR="/usr/share/mdm/themes"
for dir in Leaf Greenery Wooden "Transparent UserList" Split SimplyFree "Simple UserList" SimpleGreeter Simple Sea Purple Metal Elegance Dark Autum Arc-Wine Arc-Wine-Userlist Arc-Noble Arc-Noble-Userlist Arc-Illustrious Arc-Illustrious-Userlist circles Arc-Dust Arc-Dust-Userlist Arc-Brave Arc-Brave-Userlist
do
	if [ -d "$MDM_THEME_DIR/$dir" ]; then rm -rf "$MDM_THEME_DIR/$dir"; fi;
done
MDM_THEME_DIR="/usr/share/mdm/html-themes"
for dir in Carbon Clouds FullMoon Mint-X Numix SpaceRace Zukitwo Zukitwo-Circle Synergy
do
	if [ -d "$MDM_THEME_DIR/$dir" ]; then rm -rf "$MDM_THEME_DIR/$dir"; fi;
done

#Delete musor

#sudo apt-get --force-yes 
#sudo apt-get -y purge 

sudo apt-get -y -m install htop mc vim p7zip* gvfs-backends gvfs-fuse
sudo apt-get -y -m install gcc-avr avrdude avr-libc git
sudo apt-get -y -m install language-pack-gnome-ru language-pack-gnome-ru-base language-pack-ru language-pack-ru-base

#configs

#MY_USER="drsmyrke"
#if [ -d "/home/$MY_USER" ]; then
#	su -l -c "dconf write /org/mate/terminal/global/use-menu-accelerators false" $MY_USER
#	su -l -c "dconf write /org/mate/terminal/profiles/default/cursor-shape \"'ibeam'\"" $MY_USER
#	su -l -c "dconf write /org/mate/terminal/profiles/default/use-theme-colors false" $MY_USER
#	su -l -c "dconf write /org/mate/terminal/profiles/default/background-color \"'#000000000000'\"" $MY_USER
#	su -l -c "dconf write /org/mate/terminal/profiles/default/foreground-color \"'#AAAAAAAAAAAA'\"" $MY_USER
#	su -l -c "dconf write /org/mate/terminal/profiles/default/scrollback-lines 10000" $MY_USER
#	su -l -c "dconf write /org/mate/terminal/profiles/default/cursor-blink-mode \"'on'\"" $MY_USER

#	su -l -c "dconf write /org/mate/desktop/peripherals/keyboard/general/group-per-window false" $MY_USER
#	su -l -c "dconf write /org/mate/desktop/peripherals/keyboard/kbd/options \"['terminate\tterminate:ctrl_alt_bksp', 'grp\tgrp:alt_shift_toggle']\"" $MY_USER
	
#	su -l -c "dconf write /org/mate/pluma/display-line-numbers true" $MY_USER
#	su -l -c "dconf write /org/mate/pluma/highlight-current-line true" $MY_USER
#	su -l -c "dconf write /org/mate/pluma/auto-save true" $MY_USER
#	su -l -c "dconf write /org/mate/pluma/create-backup-copy false" $MY_USER
#	su -l -c "dconf write /org/mate/pluma/auto-save-interval 10" $MY_USER
	
#	su -l -c "dconf write /org/mate/caja/desktop/computer-icon-visible false" $MY_USER
#	su -l -c "dconf write /org/mate/caja/desktop/volumes-visible false" $MY_USER
#	su -l -c "dconf write /org/mate/caja/desktop/trash-icon-visible true" $MY_USER
#	su -l -c "dconf write /org/mate/caja/desktop/home-icon-name \"'Хомяк'\"" $MY_USER
#	su -l -c "dconf write /org/mate/caja/desktop/trash-icon-name \"'Отходоприемник'\"" $MY_USER
#	su -l -c "dconf write /com/linuxmint/terminal/show-fortunes false" $MY_USER
	
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/core/hsize 2" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/core/vsize 1" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/core/active-plugins \"['core', 'composite', 'opengl', 'compiztoolbox', 'decor', 'regex', 'copytex', 'move', 'resize', 'imgpng', 'shift', 'commands', 'screenshot', 'gnomecompat', 'grid', 'animation', 'wobbly', 'scale', 'expo']\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/screenshot/directory \"'~/Desktop'\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/expo/expo-edge \"'TopLeft'\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/scale/initiate-all-key \"'<Alt>Tab'\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/shift/initiate-key \"'Disabled'\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/shift/next-key \"'Disabled'\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/shift/next-all-key \"'<Super>Tab'\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/grid/top-edge-threshold 10" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/animation/minimize-effects \"['animation:Magic Lamp']\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/animation/unminimize-effects \"['animation:Magic Lamp']\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/animation/open-durations \"[200, 100, 120]\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/animation/open-durations \"['animation:Glide 1', 'animation:Wave', 'animation:Horizontal Folds']\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/animation/close-durations \"[150, 100, 70]\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/animation/close-durations \"['animation:Glide 1', 'animation:Wave', 'animation:Fade']\"" $MY_USER
#	su -l -c "dconf write /org/compiz/profiles/mint/plugins/animation/focus-effects \"['animation:Dodge']\"" $MY_USER

#	su -l -c "dconf write /org/mate/desktop/interface/gtk-color-scheme \"'fg_color:#212121212121\nbg_color:#d6d6d6d6d6d6\ntext_color:#212121212121\nbase_color:#f7f7f7f7f7f7\nselected_fg_color:#000000000000\nselected_bg_color:#f00d9d1e4cdc\ntooltip_fg_color:#212121212121\ntooltip_bg_color:#fbfbeaeaa0a0'\"" $MY_USER

#	su -l -c "dconf write /org/mate/desktop/session/idle-delay 30" $MY_USER
#	su -l -c "dconf write /org/mate/power-manager/button-power \"'shutdown'\"" $MY_USER
#	su -l -c "dconf write /org/mate/desktop/peripherals/keyboard/general/group-per-window false" $MY_USER
#	su -l -c "dconf write /org/mate/desktop/font-rendering/antialiasing \"'grayscale'\"" $MY_USER
#	su -l -c "dconf write /org/mate/desktop/font-rendering/hinting \"'medium'\"" $MY_USER
#	su -l -c "dconf write /org/mate/desktop/font-rendering/antialiasing \"'rgba'\"" $MY_USER
#	su -l -c "dconf write /org/mate/desktop/font-rendering/hinting \"'slight'\"" $MY_USER
#	su -l -c "dconf write /org/gnome/desktop/wm/preferences/button-layout \"'menu:minimize,maximize,close'\"" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
	#su -l -c "dconf write /" $MY_USER
fi

#rename dirs
if [ -d "/home/$MY_USER" ]; then
	if [ -d "/home/$MY_USER/Видео" ]; then
		mv "/home/$MY_USER/Видео" "/home/$MY_USER/Video"
		su -l -c "xdg-user-dirs-update --set VIDEOS ~/Video" $MY_USER
	fi
	if [ -d "/home/$MY_USER/Документы" ]; then
		mv "/home/$MY_USER/Документы" "/home/$MY_USER/Docs"
		su -l -c "xdg-user-dirs-update --set DOCUMENTS ~/Docs" $MY_USER
	fi
	if [ -d "/home/$MY_USER/Загрузки" ]; then
		mv "/home/$MY_USER/Загрузки" "/home/$MY_USER/Downloads"
		su -l -c "xdg-user-dirs-update --set DOWNLOAD ~/Downloads" $MY_USER
	fi
	if [ -d "/home/$MY_USER/Изображения" ]; then
		mv "/home/$MY_USER/Изображения" "/home/$MY_USER/Images"
		su -l -c "xdg-user-dirs-update --set PICTURES ~/Images" $MY_USER
	fi
	if [ -d "/home/$MY_USER/Музыка" ]; then
		mv "/home/$MY_USER/Музыка" "/home/$MY_USER/Music"
		su -l -c "xdg-user-dirs-update --set MUSIC ~/Music" $MY_USER
	fi
	if [ -d "/home/$MY_USER/Общедоступные" ]; then
		mv "/home/$MY_USER/Общедоступные" "/home/$MY_USER/Share"
		su -l -c "xdg-user-dirs-update --set PUBLICSHARE ~/Share" $MY_USER
	fi
	if [ -d "/home/$MY_USER/Рабочий стол" ]; then
		mv "/home/$MY_USER/Рабочий стол" "/home/$MY_USER/Desktop"
		su -l -c "xdg-user-dirs-update --set DESKTOP ~/Desktop" $MY_USER
	fi
	if [ -d "/home/$MY_USER/Шаблоны" ]; then
		#mv "/home/$MY_USER/Шаблоны" "/home/$MY_USER/Templates"
		rm -rf "/home/$MY_USER/Шаблоны"
		rm -rf "/home/$MY_USER/Templates"
		su -l -c "xdg-user-dirs-update --set TEMPLATES /usr/share/Templates" $MY_USER
	fi
fi
