31 lines
1.0 KiB
Bash
31 lines
1.0 KiB
Bash
|
#! /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="<tt>$(cd $dossierprofil && cat $fichierprofil)</tt>"
|
||
|
|
||
|
|
||
|
elif [ "$choixmenu" = "" ];then
|
||
|
zenity --width=$W --info --text="Aucun choix, retour au menu."
|
||
|
fi
|