Salut,
juste un petit truc que tu devrais faire c'est vérifier que zenity est bien installer sur la machine 😉
if [ ! $(which zenity) ] ; then
echo "Install zenity merde (puis le lit le tutos aussi ! ) "
exit 1
fi
Ensuite tu devrais rajouter le support pour kdialog 😉
Voici une liste de fonction toute prête pour kdialog tirée des premières version de PlayOnLinux (1.7.x) 🙂
#!/bin/bash
# Copyright (C) 2007 Pâris Quentin
# Cassarin-Grand Arthur
# Petit Aymeric
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
message ()
{
kdialog --title "$TITRE" --msgbox "$1"
}
champ ()
{
kdialog --title "$TITRE" --inputbox "$1" "$2"
}
erreur ()
{
kdialog --title "$TITRE" --error "Erreur : $1"
}
question ()
{
kdialog --title "$TITRE" --yesno "$1"
echo $?
}
attention ()
{
kdialog --title "$TITRE" --sorry "ATTENTION : $1"
}
menu ()
{
kdialog --title "$TITRE" --combobox "$1" $2
}
attendre ()
{
dcopRef=`kdialog --title "$TITRE" --progressbar "$1"`
dcop $dcopRef setAutoClose true
$2
dcop $dcopRef setProgress 100;
dcop $dcopRef close
}
faire()
{
read lecture
if [ ! "$lecture" = "" ]
then
faire
fi
}
attendre_multiple()
{
dcopRef=`kdialog --title "$TITRE" --progressbar "$1"`
dcop $dcopRef setAutoClose true
faire
dcop $dcopRef setProgress 100;
dcop $dcopRef close
}
renvoi ()
{
inc=0
read inc
if [ ! "$inc" = "" ]
then
dcop $dcopRef setProgress $inc;
echo $inc
renvoi
fi
}
telecharger ()
{
dcopRef=`kdialog --title "$TITRE" --progressbar "$1"`
dcop $dcopRef setAutoClose true
wget -nc "$2" 2>&1 | sed -u -n -r 's/^.* ([0-9]{1,3})%.*$/\1/p'| renvoi
dcop $dcopRef setProgress 100;
dcop $dcopRef close
echo "Telechargement terminé"
}
selectionner_fichier ()
{
fichier=$(kdialog --title "$TITRE" --getopenurl ~)
fichier=${fichier:7}
echo $fichier
}
afficher_fichier ()
{
kdialog --title "$TITRE" --textbox "$1" 500 500
}
et même si tu est courageux tu peut aussi utilisé dialog pour les (K)(G)(X)onsoliste 😃
PS : Il s'agit du fichier interface_qt de PlayOnLinux 1.7.x. Je peux te passer aussi le fichier qui permet de gérer l'interface gtk (zenity) et dialog tout en utilisant les mêmes commandes (message, question ...) et le resultat et juste une meilleure intégration dans l'environnement 🙂
PPS : Non je ne suis pas utilisateur de ton script, je suis un "cliqueur" de lien et passionné du bash :cool:
PPPS : Je peux voir si j'ai pas une version plus récente des fichiers interface_* (quelque fonction de rajouté je crois).
PPPPS : Pense a mettre ton script sous une licence 😉
PPPPPS : Je crois que c'est tout 😃
EDIT :
dd=${date:0:2}
mm=${date:3:2}
yy=${date:6:2}
date_us="$mm/$dd/$yy"
Pourquoi ce faire ch*er a découpé une chaine alors que date peut te retourner directement les bon truc ?