remplacement des zenity pulsate par une fonction 'ZenityPulsate'

This commit is contained in:
Djan GICQUEL 2021-07-24 14:06:49 +02:00
parent 2dd733908a
commit 554b2c9c75
1 changed files with 14 additions and 13 deletions

View File

@ -58,6 +58,10 @@ DossierPresent () {
fi
}
ZenityPulsate () {
zenity --width=$W --window-icon=$HOME/.icons/borg.svg --progress --pulsate --auto-close
}
# Profils et tests
#################################################################################
# si $1 n'est pas vide fichier de profil = $1
@ -88,12 +92,9 @@ cd $borg_repo
TestBorgRepo
#################################################################################
# MENU PRINCIPAL
# MENU PRINCIPAL Gestion des options du menu
#################################################################################
#################################################################################
# Gestion des options du menu
#################################################################################
while [ ! "$choixmenu" = "qu" ]
do
choixmenu=$(echo -e "\
@ -123,8 +124,8 @@ if [ "$choixmenu" = "cs" ] ;then
DossierPresent $borg_dir
if [ "$VarDossierPresent" != "false" ];then
borg create $borg_excludes $borg_compress $borg_repo::$borg_archive $borg_dir | zenity --width=$W --window-icon=$HOME/.icons/borg.svg --progress --pulsate --auto-close --title="Sauvegarde en cours..."
sync | zenity --width=$W --window-icon=$HOME/.icons/borg.svg --progress --pulsate --auto-close --title="Synchronisation des écritures..."
borg create $borg_excludes $borg_compress $borg_repo::$borg_archive $borg_dir | ZenityPulsate
sync | ZenityPulsate
zenity --notification --text "Sauvegarde $nomsauvegarde terminée"
zenity --width=$W --info --text "Sauvegarde $nomsauvegarde terminée"
fi
@ -139,7 +140,7 @@ elif [ "$choixmenu" = "ms" ];then
fi
mkdir $HOME/$borg_archive
borg mount $borg_repo::$borg_archive $HOME/$borg_archive | zenity --width=$W --progress --pulsate --auto-close
borg mount $borg_repo::$borg_archive $HOME/$borg_archive | ZenityPulsate
zenity --width=$W --info --text="La sauvegarde est disponible dans le dossier\n<tt>$HOME/$borg_archive</tt>"
elif [ "$choixmenu" = "dm" ];then
@ -147,9 +148,9 @@ elif [ "$choixmenu" = "dm" ];then
ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity --width=500 --height=$H --window-icon=$HOME/.icons/borg.svg --list --title "Liste des points de montages" --column "Archive")
if [ "$ptnmontage" != "" ];then
fusermount -u $ptnmontage | zenity --width=$W --progress --pulsate --auto-close
sleep 2 | zenity --width=$W --progress --pulsate --auto-close
rmdir $ptnmontage | zenity --width=$W --progress --pulsate --auto-close
fusermount -u $ptnmontage | ZenityPulsate
sleep 2 | ZenityPulsate
rmdir $ptnmontage | ZenityPulsate
fi
elif [ "$choixmenu" = "ss" ];then
@ -165,7 +166,7 @@ elif [ "$choixmenu" = "ss" ];then
if [ "$borg_archive" = "" ];then
zenity --width=$W --info --text "Aucune archive choisie, retour au menu"
else
borg delete $borg_repo::$borg_archive | zenity --width=$W --progress --pulsate --auto-close
borg delete $borg_repo::$borg_archive | ZenityPulsate
zenity --width=$W --info --text="Suppresion de l'archive $borg_archive terminée"
fi
@ -182,7 +183,7 @@ elif [ "$choixmenu" = "is" ];then
if [ "$borg_archive" = "" ];then
zenity --width=$W --info --text "Aucune archive choisie, retour au menu"
else
zenity --width=$W --info --text="<tt>$(borg info $borg_repo::$borg_archive)</tt>" | zenity --width=$W --progress --pulsate --auto-close
zenity --width=$W --info --text="<tt>$(borg info $borg_repo::$borg_archive)</tt>" | ZenityPulsate
fi
elif [ "$choixmenu" = "fi" ];then
@ -193,7 +194,7 @@ elif [ "$choixmenu" = "fi" ];then
elif [ "$choixmenu" = "id" ];then
# Information sur le dépôt
zenity --width=$W --info --text="<tt>$(borg info $borg_repo)</tt>" | zenity --width=$W --progress --pulsate --auto-close --title="Récupération des informations..."
zenity --width=$W --info --text="<tt>$(borg info $borg_repo)</tt>" | ZenityPulsate
elif [ "$choixmenu" = "ap" ];then
# Afficher le profil