item de menu agréable à libre

assignation de variables courtes pour le menu
cacher la première collonne
This commit is contained in:
Djan GICQUEL 2021-03-10 19:47:29 +01:00
parent f53cdbd2b8
commit 6b8395a81b
1 changed files with 20 additions and 17 deletions

View File

@ -94,50 +94,53 @@ TestBorgRepo
################################################################################# #################################################################################
# Gestion des options du menu # Gestion des options du menu
################################################################################# #################################################################################
while [ ! "$choixmenu" = "QUITTER" ] while [ ! "$choixmenu" = "qu" ]
do do
choixmenu=$(echo -e "\ choixmenu=$(echo -e "\
creer_sauvegarde\n\ cs\nCréer une archive\n\
monter_sauvegarde\n\ ms\nMonter une archive\n\
demonter_sauvegarde\n\ dm\nDemonter une archive\n\
supprimmer_sauvegarde\n\ ss\nSupprimmer une archive\n\
info_sauvegarde\n\ is\nInformation archive\n\
info_depot\n\ id\nInformation sur le dépôt\n\
afficher_profil\n\ ap\nAfficher le profil\n\
QUITTER\ qu\nQuitter\
" | zenity --list --height=400 --width=400 --title "BORG GUI" --column "Nom : $nomsauvegarde") " | zenity --list \
--height=400 --width=400 \
--title "BORG GUI : $nomsauvegarde" \
--hide-header --hide-column=1 --column "id" --column "choix")
if [ "$choixmenu" = "creer_sauvegarde" ] ;then if [ "$choixmenu" = "cs" ] ;then
TestBorgRepo TestBorgRepo
SauvegardeBorg SauvegardeBorg
elif [ "$choixmenu" = "monter_sauvegarde" ];then elif [ "$choixmenu" = "ms" ];then
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive") borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
mkdir $HOME/$borg_archive mkdir $HOME/$borg_archive
borg mount $borg_repo::$borg_archive $HOME/$borg_archive borg mount $borg_repo::$borg_archive $HOME/$borg_archive
zenity --width=400 --info --text="La sauvegarde est disponible dans le dossier\n$HOME/$borg_archive" zenity --width=400 --info --text="La sauvegarde est disponible dans le dossier\n$HOME/$borg_archive"
elif [ "$choixmenu" = "demonter_sauvegarde" ];then elif [ "$choixmenu" = "dm" ];then
ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity --width=500 --height=400 --list --title "Liste des points de montages" --column "") ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity --width=500 --height=400 --list --title "Liste des points de montages" --column "")
fusermount -u $ptnmontage fusermount -u $ptnmontage
sleep 5 sleep 5
rmdir $ptnmontage rmdir $ptnmontage
elif [ "$choixmenu" = "supprimmer_sauvegarde" ];then elif [ "$choixmenu" = "ss" ];then
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive") borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
borg delete $borg_repo::$borg_archive | zenity --width=400 --progress --pulsate --auto-close --title="Suppression en cours..." borg delete $borg_repo::$borg_archive | zenity --width=400 --progress --pulsate --auto-close --title="Suppression en cours..."
zenity --width=200 --info --text="Suppresion terminée" zenity --width=200 --info --text="Suppresion terminée"
elif [ "$choixmenu" = "info_sauvegarde" ];then elif [ "$choixmenu" = "is" ];then
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive") borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
info=$(borg info $borg_repo::$borg_archive) info=$(borg info $borg_repo::$borg_archive)
zenity --width=600 --info --text="<tt>$info</tt>" zenity --width=600 --info --text="<tt>$info</tt>"
elif [ "$choixmenu" = "info_depot" ];then elif [ "$choixmenu" = "id" ];then
info=$(borg info $borg_repo) info=$(borg info $borg_repo)
zenity --width=600 --info --text="<tt>$info</tt>" zenity --width=600 --info --text="<tt>$info</tt>"
elif [ "$choixmenu" = "afficher_profil" ];then elif [ "$choixmenu" = "ap" ];then
info=$(cd $dossierprofil && cat $fichierprofil) info=$(cd $dossierprofil && cat $fichierprofil)
zenity --width=600 --height=400 --info --text="<tt>$info</tt>" zenity --width=600 --height=400 --info --text="<tt>$info</tt>"