α gemini kaethorn at gmail.com

Setting up Enlightenment DR17 in pdaXrom

To install just the desktop shell issue

$ ipkg install e17
libiconv and libcurl is needed, so it might be wise to install those, too. libcurl is in the official pdaXrom feed while libconv can be downloaded here. Unpack it, copy it to /usr/lib and execute ldconfig:
$ ipkg install libcurl
$ cd /usr/lib
$ wget http://alphagemini.org/files/zaurus/libiconv.tar.gz
$ tar xfz libiconv.tar.gz
$ rm libiconv.tar.gz
$ ldconfig

Dependencies should be automatically satisfied during the installation. In case something goes wrong, these are the libraries which need to be installed alongside:

$ ipkg install libeet libevas libecore libembryo libedje

Once enlightenment is installed you might want to add eutils which requires ewl and engrave. Please consult www.get-e.org for detailed setup instructions.

To start enlightenment at boot time automatically, I've replaced /etc/X11/xinit/xinitrc with the following (download):

#!/bin/sh

test -e /proc/power_key_off && echo "0" >/proc/power_key_off 2>/dev/null
test -f /etc/profile && . /etc/profile

HOME=/home/root/
export HOME
cd /home/root

if [ ! -d $HOME/Choices/common ]; then
   mkdir -p $HOME/Choices/common
fi

if [ -f $HOME/Choices/lightnpower.cfg ]; then
   lightnpower.py --loadandquit
fi

test -f /etc/X11/kb/akita.xmodmap && xmodmap /etc/X11/kb/akita.xmodmap
test -f /etc/X11/kb/userdefined.xmodmap && \ 
        xmodmap /etc/X11/kb/userdefined.xmodmap
test -f /usr/bin/chkhinge && /usr/bin/chkhinge 2>/dev/null >/dev/null

enlightenment 2>/dev/null

test -e /proc/power_key_off && echo "1" >/proc/power_key_off 2>/dev/null

The following needs to be saved as /etc/rc.d/init.d/startx (download):

#!/bin/sh

. /etc/profile

start_xdm() {
    local p
    p=`pidof X`
    test $p && exit 0

    export LD_LIBRARY_PATH=/usr/X11R6/lib:/usr/local/lib:$LD_LIBRARY_PATH
    if [ ! -f /etc/pointercal ]; then
        /usr/bin/ts_calibrate
    fi
    if [ -f /etc/sysconfig/x11 ]; then
        . /etc/sysconfig/x11
        export X11_RIGHT_MOUSE_BUTTON X11_RIGHT_MOUSE_BUTTON_MOD
        export X11_MIDDLE_MOUSE_BUTTON_MOD
    fi
    test -f /etc/sysconfig/keyboard/kernel.map -a -f /usr/bin/loadkeys && \
         /usr/bin/loadkeys /etc/sysconfig/keyboard/kernel.map
    cd /home/root
    startx &
}

stop_xdm() {
    local p
    p=`pidof X`
    test $p && kill $p
}

usage()
{
    echo "Usage: $0 {start|stop}"
}


if [ $# -lt 1 ] ; then usage ; exit 0 ; fi
action=$1

case "$action" in

start)
    start_xdm
    ;;

stop)
    stop_xdm
    ;;

*)
    usage
    ;;

esac

exit 0
Now make sure that both files are executable and that the latter file is linked to the default runlevel:
$ chmod 755 /etc/X11/xinit/xinitrc /etc/rc.d/init.d/startx
$ ln -s /etc/rc.d/init.d/startx /etc/rc.d/rc5.d/S99startx

update: since e17 uses efreet to display xdg menus, binary icons are obsolete.

To start with I've gzipped my gant-based 48x48 icons and .order files here. Unpacking them in the appropriate home directory will result in a bar filled with important icons such as onscreen-keyboard, rotate and file-browser and a favourite menu containing several categories. The Settings category contains pdaXrom specific applications. To tailor these icons to your needs open them with e_util_eapp_edit contained in the eutils package. This tool also lets you create new icons. The .order files containing the menu structure can be edited with a normal text editor.

To install the icons:

$ cd
$ wget http://www.alphagemini.org/files/zaurus/base-z-icons.tar.gz
$ tar xvfz  base-z-icons.tar.gz

To apply some sane defaults to E17's configuartion one could run the following bash script. It loads and unloads some modules, maps keys, such as the magnification and screen rotation and a bunch of performance options suitable for a PDA. It's also useful to restore settings in case the internal configuration format changes (download):

#!/bin/bash

export E_IPC_SOCKET=`find /tmp/enlightenment-*/disp* |sed s/\|0//g`

############
# Settings #
############

# how to invoke enlightenment-remote
ER="enlightenment_remote -display :0.0"
# modules to unload
UNLOAD_MODULES="cpufreq start dropshadow temperature"
# modules to load
LOAD_MODULES="ibar clock battery"
# keybindings without modifiers 
KEY_BINDINGS=( 
                 "XF86RotateWindows" "rotate.sh"
                 "XF86MenuKB" "xterm" 
              )
# for keybindings with modifiers, see below

########
# Main #
########

# assign keybindings 
for i in `seq 1 "$[${#KEY_BINDINGS[@]}/2]"`;
do
   $ER -binding-key-add ANY "${KEY_BINDINGS[$[2*i-2]]}" "" 0 "exec" \
      "${KEY_BINDINGS[$[2*i-1]]}"
done
# assign keybindings with modifiers
# map the magnification keys
$ER -binding-key-add ANY 1 "CTRL" 0 "exec" "xrandr -s 640x480"
$ER -binding-key-add ANY 2 "CTRL" 0 "exec" "xrandr -s 320x240"
# map the brightness keys
$ER -binding-key-add ANY 3 "CTRL" 0 "exec" "setfl -"
$ER -binding-key-add ANY 4 "CTRL" 0 "exec" "setfl +"

# unloading modules

for module in $UNLOAD_MODULES;
do
   $ER -module-unload $module
done

# loading modules

for module in $LOAD_MODULES;
do
   $ER -module-load $module
   $ER -module-enable $module
done

# speed and misc settings
$ER -border-shade-animate-set 0
$ER -framerate-set 15
$ER -image-cache-set 512
$ER -font-cache-set 128
$ER -edge-flip-set 0

# focus settings
$ER -always-click-to-raise-set 1
$ER -always-click-to-focus-set 1

# window manipulation settings
$ER -resize-info-visible-set 0
$ER -move-info-visible-set 0
$ER -maximize-policy-set SMART

# virtual desktop settings
#vertical column
$ER -desks-set 1 4
#horizontal row
#$ER -desks-set 4 1

Note: This script maps keybindings using this xmodmap file. Make sure it's saved in /etc/X11/kb/ and loaded at the startup of X (i.e. by using the startx script above) or provide a similar xmodmap file.

The above icons contain a keyboard button which calls xvkbdc. It starts a virtual keyboard and kills it again on second press. The shelf size is properly considered, given that it is placed at its default location, the bottom of the screen. Here's the content - make sure to make it executable:

#!/bin/sh
STATE=`xrandr | grep "Current rotation" | grep normal | wc -c`

if [ "$STATE" -gt 0 ]
then
    screenwidth=640
    screenheight=480
else
    screenheight=480
    screenwidth=640
fi

keyboardheight=150
size=36

xpos=0
ypos=$(($screenheight - $keyboardheight - $size))

geometry=${screenwidth}x${keyboardheight}+${xpos}+${ypos}

if pidof xvkbd >/dev/null; then
    kill `pidof xvkbd`
else
    xvkbd -no-keypad -geometry $geometry -dict /usr/share/dict/xvkbd.dic &
fi
It's highly recommended that you set xvkbd borderless and let E remember this. To achieve this alt-right-click the window (left kanji+FN key), select Remember, choose Window name and class and Border style and click OK. Alt-right-click the window again and choose Borderless this time.

OK, and finally a small wrapper which reduces the screen resolution before starting mplayer. Let's...erm...call it emplayer (for Cx60):

#!/bin/sh

MPLAYER="mplayer -fs -framedrop -vo sdl"

if [ `xrandr|grep -e '*'|grep 640|wc -c` -gt 0 ]
then
	xrandr -s 320x240
	$MPLAYER $1
	xrandr -s 640x480
else
	$MPLAYER $1
fi
The Cx000 version is slightly different.

For those in need of some precompiled E17 wallpapers:

Note: From now on wallpapers can be imported directly from common image formats via E17's configuration dialog. No need to compile edj's anymore.

Screenshots after some tweaking: