# Set background / OK
mkdir -p $(xdg-user-dir PICTURES)/wallpaper &&
cp -a -r ./background/. $(xdg-user-dir PICTURES)/wallpaper &&
# Right path to wallpaper / OK
sed -i -e "s/xubuntu/$USER/g" ./user2/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml &&
# Install Config User (local, config...) / OK
cp -a -r ./user2/.[!.]* $HOME/
# Install Config User (snap firefox) / OK
if (grep -r '\[Profile[^0]\]' $HOME/snap/firefox/common/.mozilla/firefox/profiles.ini)
then PROFPATH=$(grep -E '^\[Profile|^Path|^Default' $HOME/snap/firefox/common/.mozilla/firefox/profiles.ini | grep -1 '^Default=1' | grep '^Path' | cut -c6-)
else PROFPATH=$(grep 'Path=' $HOME/snap/firefox/common/.mozilla/firefox/profiles.ini | sed 's/^Path=//')
cp -a -r ./user2/config_firefox/* $HOME/snap/firefox/common/.mozilla/firefox/$PROFPATH
fi
# Create shortcut Thunar folder (left side) / OK
echo "file://$(xdg-user-dir DOCUMENTS)
file://$(xdg-user-dir PICTURES)
file://$(xdg-user-dir MUSIC)
file://$(xdg-user-dir VIDEOS)
file://$(xdg-user-dir DOWNLOAD)" > ./user2/.config/gtk-3.0/bookmarks &&
# Install shortcut Thunar folder (left side) / OK
cp -a ./user2/.config/gtk-3.0/bookmarks $HOME/.config/gtk-3.0/ &&
# sleep
sleep 5
# reboot
pkill -KILL -u `whoami`
