kregory a écrit 3 commentaires

  • [^] # Re: path

    Posté par  . En réponse au message gconftool wallpaper. Évalué à 1.

    Ca marche en ayant rajouté ce qui suit en début de script


    export DISPLAY=0

    while read line ; do
    echo $line | grep -vqe "^#"
    if [ $? -eq 0 ]; then export $line; fi
    done < ~/.dbus/session-bus/$(cat /var/lib/dbus/machine-id)-$DISPLAY
  • [^] # Re: path

    Posté par  . En réponse au message gconftool wallpaper. Évalué à 1.

    Oui, entre autre c'est vrai...
    Mais j'ai trouvé
    merci

    https://bugs.launchpad.net/ubuntu/+source/gconf/+bug/285937
  • [^] # Re: path

    Posté par  . En réponse au message gconftool wallpaper. Évalué à 1.

    Non je ne pense pas, tout est en dur


    #!/bin/bash
    #set -x

    export WALL_DIR='/data/Photos/'
    export TMP_FILE=`mktemp`

    #find ${WALL_DIR} -type f -name "*jpg" | nl -s: -n rz > ${TMP_FILE}
    find ${WALL_DIR} -type f | grep -v "/_" | nl -s: -n rz > ${TMP_FILE}
    NB=`wc -l ${TMP_FILE} | cut -d' ' -f1`
    let num=$RANDOM%$NB
    wallpaper=`grep -e "^0*$num:" ${TMP_FILE} | cut -d: -f2-`
    file "$wallpaper"|grep -qi image
    if [ $? -eq 0 ]; then
    /usr/bin/gconftool-2 -t sting --set /desktop/gnome/background/picture_filename "${wallpaper}"
    /usr/bin/gconftool-2 -t sting --set /desktop/gnome/background/picture_options "scaled"
    fi
    rm ${TMP_FILE}