#!/bin/bash
# Compile all themes for canola

source "utils/helper-functions"

EDJE_CC="edje_cc $1"
THEMES_DIR=$(cat canola.conf | grep -e '^themes_dir' |
    sed 's/^themes_dir\s*=\s*\(.*\)$/\1/')

[ ! -d $THEMES_DIR ] && mkdir $THEMES_DIR

msg "Compiling themes"
cd data/themes
for theme in *
do
    msg_begin "   $theme"
    cd $theme
    $EDJE_CC $theme.edc && cp -f $theme.edj ../../../$THEMES_DIR/
    msg_end $?
    cd ..
done

msg_begin "Compiling conf theme"
cd ../etk-themes/default
$EDJE_CC -id images default.edc && \
    cp -f default.edj ../../../$THEMES_DIR/conf.edj
msg_end $?
