1

I have recently installed the E17 fork, Moksha, on my Sabayon Linux machine the problem is that the graphical tools for changing the wallpaper to JPG or PNG files are causing me grief (and yes I have tried to get support for this from the Bodhi Linux community, see this forum post), but I seem to be able to use wallpapers (including animated ones) in .edj format quite easily. So I was hoping that someone would have a shell script (that's simple enough for me to be able to use) or something I can run from the command-line to convert my JPG and PNG wallpapers to the .edj file format.

0

I'll give you the extract of the code for variety that does this. This version of the code just embeds a path to the image rather then including the image in the edj file as well.

OUTPUT_DIR="$HOME/.e/e/backgrounds"

TEMPLATE='
images { image: "@IMAGE@" USER; }
collections {
  group {
  name: "e/desktop/background";
  data { item: "style" "4"; item: "noanimation" "1"; }
  max: @WIDTH@ @HEIGHT@;
  parts {
    part {
    name: "bg";
    mouse_events: 0;
    description {
      state: "default" 0.0;
      aspect: @ASPECT@ @ASPECT@;
      aspect_preference: NONE;
      image { normal: "@IMAGE@"; scale_hint: STATIC; }
    }
    }
  }
  }
}
'

OFILE="$OUTPUT_DIR/variety_wallpaper_$RANDOM"

DIMENSION="$(identify -format "%w/%h" "$WP")"

if [ ! -z "$DIMENSION" ]; then
    WIDTH=$(echo $DIMENSION | cut -d/ -f1)
    HEIGHT=$(echo $DIMENSION | cut -d/ -f2)
    IMAGE="$(echo "$WP" | sed 's/[^[:alnum:]_-]/\\&/g')"

    if [ -z "$HEIGHT" -o "$HEIGHT" = "0" ]; then
        ASPECT="0.0"
    else
        ASPECT=$(echo "scale=9; $DIMENSION" | bc)
    fi
fi

printf "%s" "$TEMPLATE" | \
sed "s/@ASPECT@/$ASPECT/g; s/@WIDTH@/$WIDTH/g; s/@HEIGHT@/$HEIGHT/g; s|@IMAGE@|$IMAGE|g" > "$OFILE.edc"
edje_cc "$OFILE.edc" "$OFILE.edj" 2>/dev/null
rm "$OFILE.edc"

Full source is http://bazaar.launchpad.net/~peterlevi/variety/trunk/view/head:/data/scripts/set_wallpaper

If you want to embed the image you might do the following, I got this by creating a wallpaper through enlightenments UI and decompiling it with edje_decc

images { image: "1920x1080.png" LOSSY 90; }
collections {
  group { name: "e/desktop/background";
  data { item: "style" "4"; }
    data.item: "noanimation" "1";
    parts {
      part { name: "bg"; mouse_events: 0;
        description { state: "default" 0.0;
          aspect: 1.777777778 1.777777778; aspect_preference: NONE;
          image { normal: "1920x1080.png";  scale_hint: STATIC; }
        }
      } 
    } 
  }
}

you would then build the theme with edje_cc -id . -fd . e_bgdlg_new.edc -o 1920x1080.edj presuming the above was in the file e_bgdlg_new.edc and your image was in the same directory as where you were calling the script

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.