diff --git a/borg-gui.sh b/borg-gui.sh index 93a75cc..613a535 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -72,8 +72,13 @@ if [ ! $1 = "" ]; then fichierprofil="$1" . "$1" else - fichierprofil=$(ls -1 "$dossierprofil"*.conf | zenity $H $W $iconborg --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil") - . $fichierprofil + cd $dossierprofil + fichierprofil=$(ls -1 *.conf | cut -d. -f1 | \ + zenity $W $H $iconborg --list \ + --title "Liste des profils" \ + --text "Choisir un profil dans la liste" \ + --column "Fichier de profil"\ + ) && . "$dossierprofil"/"$fichierprofil".conf fi if [ "$fichierprofil" = "" ]; then @@ -133,23 +138,27 @@ qu\nQUITTER\ fi elif [ "$choixmenu" = "ms" ];then - # Monter une archive - + # Monter une archive if [ "$filter" = "" ];then - borg_archive=$(borg list --short $borg_repo | zenity $H $iconborg --list --title "Listes des archives" --column "Archive") + BorgList="borg list --short $borg_repo" else - borg_archive=$(borg list --short $borg_repo | grep $filter | zenity $H $iconborg --list --title "Listes des archives" --column "Archive") + BorgList="borg list --short $borg_repo | grep $filter" fi - mkdir $HOME/$borg_archive - borg mount $borg_repo::$borg_archive $HOME/$borg_archive | ZenityPulsate - zenity $W --info --text="La sauvegarde est disponible dans le dossier\n$HOME/$borg_archive" + echo $BorgList + #borg_archive=$($BorgList | zenity $H $iconborg --list --title "Listes des archives" --column "Archive") + + #if [ ! "$borg_archive" = "" ];then + #mkdir $HOME/$borg_archive + #borg mount $borg_repo::$borg_archive $HOME/$borg_archive | ZenityPulsate + #zenity $W --info --text="La sauvegarde est disponible dans le dossier\n$HOME/$borg_archive" + #fi elif [ "$choixmenu" = "dm" ];then # Demonter une archive - ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity --width=500 $H $iconborg --list --title "Liste des points de montages" --column "Archive") - if [ "$ptnmontage" != "" ];then + ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity $W $H $iconborg --list --title "Liste des points de montages" --column "Archive") + if [ ! "$ptnmontage" = "" ];then fusermount -u $ptnmontage | ZenityPulsate sleep 2 | ZenityPulsate rmdir $ptnmontage | ZenityPulsate