• # notify-send

    Posté par (site web personnel) . En réponse au journal De l'art de la notification. Évalué à 10.

    Fourni par un collègue.

    function doAndWarn () 
     { 
     echo "doAndWarn 1ドル";
     START=`date`;
     send_alias=$(alias);
     cmd="1ドル";
     shift;
     args=${1:+$(IFS='"' echo "\"${*//\"/\\\"}\"")};
     if bash -O expand_aliases ; then
     notify-send -u low -i /usr/share/icons/gnome/scalable/emblems/emblem-default.svg "Command $cmd is finished.";
     else
     notify-send -u critical -i /usr/share/icons/gnome/scalable/emblems/emblem-important.svg "Command $cmd failed!";
     fi <<EOF
     cd $PWD
     $send_alias
     $cmd $args
     EOF
     echo "Started at $START.";
     echo "Ended at" `date`"."
     }
    
    

    Affiche une pop-up de notification avec logo & message adapté au résultat.