le-dosvox: Creates a function which fix dosvox issues on wine

Signed-off-by: Dalmon Ian Martins de Oliveira <dimo13.c3sl.ufpr.br>
parent 6b306095
......@@ -19,14 +19,42 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# Verifies if $1 holds something
if [[ "$1" = "" || "$(grep $1 /etc/passwd)" = "" ]]; then
# Function which fix dosvox issues on wine
function configureDosvox () {
VAR1="Lucida Console"
VAR2="Droid Sans Mono"
VAR3="LARGURALETRA="
VAR4="ALTURALETRA="
VAR5="/home/dosvox_user"
DESKTOP="Área de Trabalho"
sed -e "s/${VAR1}/${VAR2}/" -e "s/${VAR3}/${VAR3}12/" \
-e "s/${VAR4}/${VAR4}29/" \
-i /home/$USER_TO_INSTALL/.wine/drive_c/winvox/dosvox.ini
cp "/home/$USER_TO_INSTALL/$DESKTOP/Dosvox.desktop" /home/$1
mv "/home/$USER_TO_INSTALL/$DESKTOP/Dosvox.lnk" "/home/$1/$DESKTOP/.Dosvox.lnk" &&
sed -i "s\/${1}/\/dosvox_user/\ " /home/$USER_TO_INSTALL/Dosvox.desktop
cp /home/$USER_TO_INSTALL/.wine/drive_c/winvox/dosvox.ini \
/home/$USER_TO_INSTALL/.wine/drive_c/windows/dosvox.ini
mkdir $VAR5/Área\ de\ Trabalho
cp /home/$USER_TO_INSTALL/Dosvox.desktop "$VAR5/$DESKTOP"
cp -R /home/$USER_TO_INSTALL/.wine $VAR5
cp/home/$USER_TO_INSTALL/.local/share/icons/hicolor/32x32/apps/150E_dosvox.0.png \
$VAR5/.local/share/icons/hicolor/32x32/apps
chown -Rf dosvox_user:dosvox_user $VAR5/.wine
chown dosvox_user:dosvox_user "$VAR5/$DESKTOP/Dosvox.desktop"
}
# Main
USER_TO_INSTALL=$1
# Verifies if $USER_TO_INSTALL holds something
if [[ "$USER_TO_INSTALL" = "" || "$(grep $1 /etc/passwd)" = "" ]]; then
zenity --error --title="Erro ao instalar" \
--text="O usuário não pode ser indentificado"
exit 1
fi
USER_TO_INSTALL=$USER_TO_INSTALL
# Info message about installation process
zenity --info --title="Instalação do dosvox no linux educacional 5" \
......@@ -64,32 +92,10 @@ zenity --info --title="ATENÇÃO" \
Porém ele ainda não foi configurado, e tu terás que fechar o dosvox \
usando Alt F4. Assim, o esse programa poderá configurar certos aspectos \
do dosvox."
gksudo -u $USER_TO_INSTALL "wine /home/$1/le-dosvox/dv45-setup.exe"
gksudo -u $USER_TO_INSTALL "wine /home/$USER_TO_INSTALL/le-dosvox/dv45-setup.exe"
# Modify some lines on dosvox configuration file
(
VAR1="Lucida Console"
VAR2="Droid Sans Mono"
VAR3="LARGURALETRA="
VAR4="ALTURALETRA="
VAR5="/home/dosvox_user"
DESKTOP="Área de Trabalho"
sed -e "s/${VAR1}/${VAR2}/" -e "s/${VAR3}/${VAR3}12/" \
-e "s/${VAR4}/${VAR4}29/" \
-i /home/$USER_TO_INSTALL/.wine/drive_c/winvox/dosvox.ini
cp "/home/$USER_TO_INSTALL/$DESKTOP/Dosvox.desktop" /home/$1
mv "/home/$USER_TO_INSTALL/$DESKTOP/Dosvox.lnk" "/home/$1/$DESKTOP/.Dosvox.lnk" &&
sed -i "s\/${1}/\/dosvox_user/\ " /home/$USER_TO_INSTALL/Dosvox.desktop
cp /home/$USER_TO_INSTALL/.wine/drive_c/winvox/dosvox.ini \
/home/$USER_TO_INSTALL/.wine/drive_c/windows/dosvox.ini
mkdir $VAR5/Área\ de\ Trabalho
cp /home/$USER_TO_INSTALL/Dosvox.desktop "$VAR5/$DESKTOP"
cp -R /home/$USER_TO_INSTALL/.wine $VAR5
cp/home/$USER_TO_INSTALL/.local/share/icons/hicolor/32x32/apps/150E_dosvox.0.png \
$VAR5/.local/share/icons/hicolor/32x32/apps
chown -Rf dosvox_user:dosvox_user $VAR5/.wine
chown dosvox_user:dosvox_user "$VAR5/$DESKTOP/Dosvox.desktop" ; EXITCODE=$?
) | zenity --progress --pulsate --text="Completando a instalação,\
| zenity --progress --pulsate --text="Completando a instalação,\
por favor aguarde" --title="Terminando a instalação"
if [[ "$EXITCODE" != "0" ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment