#!/bin/bash

user=$1
path=$(awk -F":" "/$user/ {print \$6}" /etc/passwd)
#echo $path /root/path
if [[ "${LANG%_*}" = "fr" ]]
        then
                if [[ -f $path/.config/openbox/menu.xml ]]
                        then
                                exit
                        else
                                mkdir -p $path/.config/openbox
                                cp -a /etc/xdg/openbox/autostart.vp $path/.config/openbox/autostart
                                cp /etc/xdg/openbox/menu.xml.fr $path/.config/openbox/menu.xml
                                chown -R $user:$user $path/.config/
                fi
        else
                if [[ -f $path/.config/openbox/menu.xml ]]
                        then
                                exit
                       else
                                mkdir -p $path/.config/openbox
                                cp -a /etc/xdg/openbox/autostart.vp $path/.config/openbox/autostart
                                cp /etc/xdg/openbox/menu.xml.us $path/.config/openbox/menu.xml
                                chown -R $user:$user $path/.config/
                fi
echo
fi

