diff --git a/profile-manager.sh b/profile-manager.sh new file mode 100644 index 0000000..2d8580c --- /dev/null +++ b/profile-manager.sh @@ -0,0 +1,30 @@ +#! /bin/bash + +W="600" +H="500" +dossierprofil="$HOME/.config/borg/" +cd $dossierprofil +choixmenu=$(echo -e "\ +cp\nCréer un nouveau profil\n\ +ap\nAfficher les profils\ +" | zenity --height=$H --width=$W --window-icon=$HOME/.icons/borg.svg --list \ +--column "id" --column "choix") + +if [ "$choixmenu" = "cp" ];then +choixdossier=$(zenity --file-selection --directory) + +if [ -z "$(ls -A $choixdossier)" ]; then +zenity --width=$W --window-icon=$HOME/.icons/borg.svg --progress --pulsate --auto-close | zenity --notification --text "Initialisation du dépôt..." +else +zenity --width=$W --error --text="Erreur, le dossier n'est pas vide." +fi + + +elif [ "$choixmenu" = "ap" ];then +fichierprofil=$(ls -1 *.txt | zenity --height=$H --width=$W --window-icon=$HOME/.icons/borg.svg --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil") +zenity --width=$W --height=$H --info --text="$(cd $dossierprofil && cat $fichierprofil)" + + +elif [ "$choixmenu" = "" ];then +zenity --width=$W --info --text="Aucun choix, retour au menu." +fi