You are not logged in.

#1 2005-07-07 18:31:55

Legout
Member
From: Wuerburg/germany
Registered: 2004-01-19
Posts: 292

Script for creating EAP files for E17

Because it´s a pain in the ... to create or edit EAP file with the grafical EAPP Editor, i wrote this little script to generate them.
You just have to know the /path/to/the/icon/you/wanna/use !

Maybe it´s ugly, but it works  :twisted:

BTW, I call this script "e17_gen-eap":?:

######
#!/bin/bash
#
#  Author: Legout (volker@lorrmann.de)
#
#  This is my little script, that helps me to generate
#  EAP files for the wonderfull window manager 
#  Enlightenment DR17.
#
########

. /etc/rc.conf
. /etc/rc.d/functions 
###
# Help
###

usage ()
{
   echo "Usage: "
   echo "  e17_gen-eap [Options] </path/to/icon.png>"
   echo
   echo "Options:"
   echo
   echo "The following options are needed. YOU MUST SET THEM!!!"
   echo 
   echo "    -n <name>        Name of the program,"
   echo "    -e <executable>    The path to the executable or name of executable"
   echo 
   echo "The options below are optional!"
   echo
   echo "    -g <name>    Generic name of the program"
   echo "      -wn <name>    The window name (IF YOU DON`T KNOW WHAT THIS IS,"
   echo "                DON`T USE IT)" 
   echo "    -w <name>     The window class (IF YOU DON`T KNOW WHAT THIS IS,"
   echo "                DON`T USE IT)" 
   exit
}

###
# Funtion for build the .eap binary
###

eap_build ()
{ # actually compile an edje file with all the gfx etc.
  edje_cc $@ -id . -fd . $NAME.edc $NAME.eap
  # add eap properties to the file - they are ALL optional EXCEPT name$
  # and exe is optional for directory .eap files
  enlightenment_eapp 
  $NAME.eap 
  -set-name "$NAME" 
  -set-generic "$GENERIC" 
  -set-comment "" 
  -set-exe "$EXEC" 
  -set-win-name "$WINNAME" 
  -set-win-class "$WINCLASS"
}

###
# Function that generates an .edc file
###

gen_icon ()
{ echo -e "images {n"
"   image: "`basename $ICON`" COMP;n"
"}n"
"collections {n"
"   group {n"
"      name: "icon";n"
"      max: 128 128;n"
"      parts {n"
"     part {n"
"        name: "image";n"
"        mouse_events: 0;n"
"        description {n"
"           state: "default" 0.0;n"
"           aspect: 1.0 1.0;n"
"           image.normal: "`basename $ICON`";n"
"        }n"
"     }n"
"      }n"
"  }n"
"}n"
} 

[ -z $1 ] && usage


###
#OK Let´s start
###

printhl ".:Let´s go...:."

while [ "$#" -gt "1" ]; do
   case $1 in
      -h)
         usage
     shift
         ;;
      -n)
         NAME="$2"
         shift
         ;;
      -e)
         EXEC="$2"
         shift
         ;;
      -g)
         GENERIC="$2"
         shift
         ;;
      -wn)
         WINNAME="$2"
         shift
         ;;
      -wc)
         WINCLASS="$2"
         shift
         ;;
      *)
         printhl "Unkown paramater '$1'!!"
      ;;
   esac
   shift
done 

ICON="$1"

printhl ".:Building. This will take nearly no time ;-):."
cp $ICON .
gen_icon > ./$NAME.edc
eap_build

printhl ".:Cleaning up:."
mv $NAME.eap ~/.e/e/applications/all/
rm $NAME.edc `basename $ICON`

printhl ".:Done:."

Offline

#2 2005-07-07 18:42:36

CyberTron
Member
From: Gotland ,Sweden
Registered: 2005-03-17
Posts: 645
Website

Re: Script for creating EAP files for E17

great work legout!!  althought. what is the difference from enlihtenment_eapp utillity? (included with e17)?


edit: just saw the difference


http://www.linuxportalen.com  -> Linux Help portal for Linux and ArchLinux (in swedish)

Dell Inspiron 8500
Kernel 2.6.14-archck1  (selfcompiled)
Enlightenment 17

Offline

#3 2005-07-07 18:56:22

Legout
Member
From: Wuerburg/germany
Registered: 2004-01-19
Posts: 292

Re: Script for creating EAP files for E17

great work legout!! althought. what is the difference from enlihtenment_eapp utillity? (included with e17)?

Have a look at the eap_build function. I fact the script uses the enlightenment_eapp utility. It generates an $NAME.edc (function gen_icon)
an copy´s the $ICON.png to the actual path. Than builds an $NAME.eap and modifies it (funtion eap_build). At least it copies the $NAME.eap to ~/.e/e/applications/all

That´s all.

Maybe this would be interesting too!

Offline

#4 2005-07-07 18:58:37

Dreameen
Member
From: Poland
Registered: 2004-09-06
Posts: 252

Re: Script for creating EAP files for E17

I hate using the graphical editor. Great script you've made Legout. Thanks smile

Offline

#5 2005-07-07 19:04:54

Legout
Member
From: Wuerburg/germany
Registered: 2004-01-19
Posts: 292

Re: Script for creating EAP files for E17

Maybe we should start a "HINTS AND TIPS fo e17" Topic in the forum. With screenshot,scrits, how tos...

Offline

#6 2005-07-07 19:19:21

CyberTron
Member
From: Gotland ,Sweden
Registered: 2005-03-17
Posts: 645
Website

Re: Script for creating EAP files for E17

that is a good idea, although, no screeens in it, that is what the monthly screenshot thread are for...

otherwise, I am ready to post big_smile


http://www.linuxportalen.com  -> Linux Help portal for Linux and ArchLinux (in swedish)

Dell Inspiron 8500
Kernel 2.6.14-archck1  (selfcompiled)
Enlightenment 17

Offline

#7 2005-07-08 00:17:36

Cam
Member
From: Brisbane, Aus
Registered: 2004-12-21
Posts: 658
Website

Re: Script for creating EAP files for E17

I haven't looked for a while but before the GUI utility came about, e_utils contained a bash script that did the exact same thing.

Offline

#8 2005-07-08 08:32:33

Legout
Member
From: Wuerburg/germany
Registered: 2004-01-19
Posts: 292

Re: Script for creating EAP files for E17

I´ve search for this scrit, but i can´t find it, is it still  in e_utils? Where?

Offline

#9 2005-07-09 06:46:24

Cam
Member
From: Brisbane, Aus
Registered: 2004-12-21
Posts: 658
Website

Re: Script for creating EAP files for E17

Legout wrote:

I´ve search for this scrit, but i can´t find it, is it still  in e_utils? Where?

I just had a quick look and I couldn't see it but I know it used to be there cause I've used it before, was ages ago but. Unless I got it form somewhere online, possible but I don't think I would've.

Offline

Board footer

Powered by FluxBB