Project D

Bchanger2 - EDJ Strikes back

Well, I got tired waiting for e17setroot to be resurrected and decided to create / modified my bchange2.sh script to create an edj file for the background while keeping the jpg original for the fakeroot.

I dont really like this method since my harddrive will have to accomodate for both of the edj and jpg while both basically are the SAME picture file. Just a waste of harddisk space IMHO.

but until now I havent got any better idea to do this right.

Well here is the script :


#!/bin/bash

IMGDIR=/home/duckz/Images # set this to your jpg image dir
EDJDIR=~/.e/e/backgrounds
SLEEPTIME=3600 # in seconds
LOSSYRATE=90 # 0 - 100
WIDTH=1024 #Desktop width
HEIGHT=768 #Desktop height

while [ 1=1 ] ;

do

getrandomimg()
{
  ls $IMGDIR | perl -e '@f=<>; print $f[int(rand($#f+1))]'
  }

  IMG1=`getrandomimg`

  COMPARE=`ls $EDJDIR | grep $IMG1.edj`
  if [ "$COMPARE" != "$IMG1" ] ; then

        echo "images { image: "$IMGDIR/$IMG1" LOSSY $LOSSYRATE; }" >> $IMGDIR/$IMG1.edc
        echo "collections {" >> $IMGDIR/$IMG1.edc
        echo "group { name: "e/desktop/background";" >>  $IMGDIR/$IMG1.edc
        echo "data { item: "style" "0"; }" >>  $IMGDIR/$IMG1.edc
        echo "max: $WIDTH $HEIGHT;" >> $IMGDIR/$IMG1.edc
        echo "parts {" >>  $IMGDIR/$IMG1.edc
        echo "part { name: "bg"; mouse_events: 0;" >> $IMGDIR/$IMG1.edc
        echo "description { state: "default" 0.0;" >>  $IMGDIR/$IMG1.edc
        echo "image { normal: "$IMGDIR/$IMG1"; }" >>  $IMGDIR/$IMG1.edc
        echo "} } } } }" >> $IMGDIR/$IMG1.edc                          

  edje_cc $@ -id . -fd . $IMGDIR/$IMG1.edc -o $EDJDIR/$IMG1.edj
  enlightenment_remote -default-bg-set $EDJDIR/$IMG1.edj
  else
  enlightenment_remote -default-bg-set $EDJDIR/$IMG1.edj
  fi

  #Set the Fake root

  Esetroot -s $IMGDIR/$IMG1

  # Delete the edc file
  rm -f $IMGDIR/$IMG1.edc

        sleep $SLEEPTIME
done
exit 0

enjoy and hopefully this will eat your harddisk space harr harr harr!

-= end transmission =-

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • LinkedIn
  • Slashdot
  • StumbleUpon
  • blinkbits
  • eKudos
  • Live
  • Share/Save/Bookmark

RSS Fresh Ebuild