All pastes #455212 Raw Edit

Something

public text v1 · immutable
·published 2007-04-24 02:03 UTC
rendered paste body
xset +dpms
xset dpms force on
PHOTOSDIR="/photos/"    #directory with photos
DELAY="10"              #slideshow delay in seconds

export DISPLAY=:0

echo $@

case "$1" in
        screen)
                if [ "$2" == "on" ]
                then
                        xset dpms force on                   
                elif [ "$2" == "off" ]
                then
                        xset dpms force off
                fi
                exit 0
        ;;
        start)
          shift
          while getopts d:p: opt
          do
                case "$opt" in
                        d) DELAY="$OPTARG";;
                        p) PHOTOSDIR="$OPTARG";;
                esac
          done
          /usr/bin/feh --quiet --recursive --randomize --full-screen --hide-pointer -D $DELAY $PHOTOSDIR &
          exit 0
        ;;
        stop)
                pkill feh
                exit 0
        ;;

        restart)
          shift
          $0 stop
          $0 start $@
        ;;
        *)
          echo "Usage: {start | restart} [ -d DELAY , -p PHOTODIR] {stop}"
          exit 1
        ;;
esac

set +x

exit 0;