From 406734f8667cbb151dc04fb91959e6c9b369c6cc Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 8 Feb 2024 09:21:41 +0100 Subject: [PATCH] Suppression de "window-icon" qui introduisait un bug majeur --- borg-gui.sh | 30 ++++++++++++------------------ profile-manager.sh | 8 ++++---- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 663e873..40328d1 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -18,14 +18,12 @@ export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes dossierprofil="$HOME/.config/borg/profils-borg-zenity/" W="--width=600" H="--height=500" -iconborg="--icon=/usr/share/icons/borg.svg" # FONCTIONS ################################################################################# TestBorgRepo () { if [ ! -d "$borg_repo" ];then zenity $W --error --text="Impossible de trouver de dépôt borg." - echo "[KO] Impossible de trouver de dépôt borg." exit else echo "[OK] Le dépôt borg existe" @@ -33,7 +31,6 @@ TestBorgRepo () { if ! ls "$borg_repo";then zenity $W --error --text="Impossible d'accéder au dépôt borg.\nIl s'agit probablement d'un problème de droits" - echo "[KO] Impossible d'accéder au dépôt borg." exit else echo "[OK] L'accès au dépôt borg est possible" @@ -41,7 +38,6 @@ TestBorgRepo () { if ! ls "$borg_repo/data";then zenity $W --error --text="Impossible d'accéder aux données du dépôt borg.\nIl s'agit probablement d'un problème de droits" - echo "[KO] Impossible d'accéder aux données du dépôt borg." exit else echo "[OK] L'accès aux données du dépôt borg est possible" @@ -49,7 +45,6 @@ TestBorgRepo () { if [ ! -f "$borg_repo/config" ]; then infoerr="Impossible de trouver le fichier de configuration borg." - echo "[KO] $infoerr" zenity $W --error --text="$infoerr" exit else @@ -58,7 +53,6 @@ TestBorgRepo () { if [ -d "$borg_repo/lock.exclusive" ]; then infoerr="Le dépôt est verrouillé, une opération est peut-être en cours" - echo "[KO] $infoerr" zenity $W --error --text="$infoerr" exit else @@ -75,21 +69,21 @@ DossierPresent () { } ZenityPulsate () { - zenity $W $iconborg --title "borg-zenity" --progress --pulsate --auto-close --text "$1" + zenity $W --title "borg-zenity" --progress --pulsate --auto-close --text "$1" } ZenityNotification () { - zenity $iconborg --notification --text "$1" + zenity --notification --text "$1" } BorgFilter () { if [ "$filter" = "" ];then ZenityNotification "borg-zenity\nGénération de la liste des archives en cours..." BorgArchiveList=$(borg list --short "$borg_repo") - Borg_Archive=$(echo -e "$BorgArchiveList" | zenity $H $W $iconborg --list --title "Listes des archives" --column "Archive") + Borg_Archive=$(echo -e "$BorgArchiveList" | zenity $H $W --list --title "Listes des archives" --column "Archive") else BorgArchiveList=$(borg list --short "$borg_repo") - Borg_Archive=$(echo -e "$BorgArchiveList" | grep "$filter" | zenity $H $W $iconborg --list --title "Listes des archives" --column "Archive") + Borg_Archive=$(echo -e "$BorgArchiveList" | grep "$filter" | zenity $H $W --list --title "Listes des archives" --column "Archive") fi } @@ -99,7 +93,7 @@ BorgFilter () { cd "$dossierprofil" || exit fichierprofil=$(ls -1 *.conf | cut -d. -f1 | \ -zenity $W $H $iconborg --list \ +zenity $W $H --list \ --title "Liste des profils" \ --text "Choisir un profil dans la liste" \ --column "Fichier de profil" \ @@ -203,7 +197,7 @@ $(echo $MenuAfficherProfil)\ $(echo $MenuBarreHorizontale)\ $(echo $MenuEspaceDisque)\ $(echo $MenuQuitter)\ -" | zenity $iconborg --list $H $W --title "$nomsauvegarde" --hide-header --hide-column=1 --column "id" --column "choix") +" | zenity --list $H $W --title "$nomsauvegarde" --hide-header --hide-column=1 --column "id" --column "choix") else @@ -216,7 +210,7 @@ $(echo $MenuDemonter)\ $(echo $MenuSupprimer1)\ $(echo $MenuEspaceDisque)\ $(echo $MenuQuitter)\ -" | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" --hide-header --hide-column=1 --column "id" --column "choix") +" | zenity --list $H $W --title "BORG GUI : $nomsauvegarde" --hide-header --hide-column=1 --column "id" --column "choix") fi @@ -241,11 +235,11 @@ fi fi if borg list --short "$borg_repo" | grep "$borg_archive" ;then - zenity --warning $W $iconborg --text "L'archive existe déjà." + zenity --warning $W --text "L'archive existe déjà." else if [ "$VarDossierPresent" != "false" ];then log="/tmp/borg-zenity-$borg_archive-$(date +%H-%M-%S).log" - borg create ${borg_excludes} ${borg_compress} --exclude-caches "$borg_repo"::"$borg_archive" . 2> "$log" | zenity $W $iconborg --progress --pulsate --auto-close --no-cancel --text "Sauvegarde en cours..." --title "borg-zenity" + borg create ${borg_excludes} ${borg_compress} "$borg_repo"::"$borg_archive" . 2> "$log" | zenity $W --progress --pulsate --auto-close --no-cancel --text "Sauvegarde en cours..." --title "borg-zenity" chmod 777 "$log" if [ $(wc -c "$log" | cut -f1 -d " ") -gt 1 ] ;then zenity $W --error --title "borg-zenity erreur" --text "$(cat $log)" @@ -268,7 +262,7 @@ fi elif [ "$choixmenu" = "dm" ];then # Démonter une archive - ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity $W $H $iconborg --list --title "Liste des points de montages" --column "Archive") + ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity $W $H --list --title "Liste des points de montages" --column "Archive") if [ ! "$ptnmontage" = "" ];then fusermount -u "$ptnmontage" | ZenityPulsate "Démontage de l'archive..." sleep 2 | ZenityPulsate "" @@ -297,9 +291,9 @@ fi # Supprimer des archives if [ "$filter" = "" ];then - Borg_Archive=$(borg list --short "$borg_repo" | sed s/^/\\n/g | zenity $H $W $iconborg --list --checklist --title "Listes des archives" --column "Sel" --column "Archive") + Borg_Archive=$(borg list --short "$borg_repo" | sed s/^/\\n/g | zenity $H $W --list --checklist --title "Listes des archives" --column "Sel" --column "Archive") else - Borg_Archive=$(borg list --short "$borg_repo" | grep "$filter" | sed s/^/S\\n/g | zenity $H $W $iconborg --list --checklist --title "Listes des archives" --column "S" --column "Archive") + Borg_Archive=$(borg list --short "$borg_repo" | grep "$filter" | sed s/^/S\\n/g | zenity $H $W --list --checklist --title "Listes des archives" --column "S" --column "Archive") fi if [ ! "$Borg_Archive" = "" ];then diff --git a/profile-manager.sh b/profile-manager.sh index cf1eb70..e4854ed 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -6,7 +6,7 @@ W="--width=600" H="--height=500" ZenityPulsate () { -zenity $W --window-icon=borg --progress --pulsate --auto-close +zenity $W --progress --pulsate --auto-close } TestBorgRepo () { @@ -36,7 +36,7 @@ cp\nCréer un nouveau profil/dépôt\n\ ajd\nCréer un nouveau profil et le lier à un dépôt existant\n\ ap\nAfficher les profils\n\ mp\nModifier un profil (connaissance en ligne de commande borg requise)\ -" | zenity $H $W --window-icon=borg --list --column "id" --column "choix" --hide-column=1 --hide-header) +" | zenity $H $W --list --column "id" --column "choix" --hide-column=1 --hide-header) # Gestion des choix du menu ########################################################### @@ -127,14 +127,14 @@ zenity $W --info --text "Le dépôt à bien été ajouté.\nLancez «Borg Zenity ### Afficher les profils ### elif [ "$choixmenu" = "ap" ];then -fichierprofil=$(ls -1 *.conf | zenity $H $W --window-icon=borg --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil") +fichierprofil=$(ls -1 *.conf | zenity $H $W --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil") if [ "$fichierprofil" != "" ];then zenity $W $H --info --text="$(cd "$dossierprofil" && cat "$fichierprofil")" fi ### Modifier un profil ### elif [ "$choixmenu" = "mp" ];then -fichierprofil=$(ls -1 *.conf | zenity $H $W --window-icon=borg --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil") +fichierprofil=$(ls -1 *.conf | zenity $H $W --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil") cp "$fichierprofil" "$fichierprofil.tmp" return=$(zenity $W $H --text-info --editable --title="profil $fichierprofil" --filename "$fichierprofil.tmp") if [ "$return" = "" ];then