-
yad > fenêtre de Drag’n'Drop
Par défaut, la fenêtre de Drag’n'Drop se présente ainsi :
yad --dnd
Après y avoir déposer le(s) fichier(s), yad retourne en sortie :
file:///chemin/fichierFaire un pipe vers
sedpour avoir le chemin correct (on supprime les 7 premiers caractères) :yad --dnd | sed 's/^.......//' /root/Desktop/tmp
Pour afficher un texte d’invite :
yad --text="Déposez vos fichiers ici :" --dnd
md5sum
#!/bin/sh v=`yad --text="Déplacer vos fichiers ici" --dnd | sed 's/^.......//'` o=`md5sum $v` yad --width=500 --height=200 --title="MD5SUM Check" --text="$o"
Autre méthode :
#!/bin/sh killall yad for i in "$@"; do case "${i}" in *) o=`md5sum "${i}"` yad --title="CheckSum Calculator" --form --field="" "$o" --no-buttons --geometry=550x50+500+0 ;; esac done
--command=CMDRun command when data received. Data strings pass to command as an argument. By default data just prints to stdout.