#!/bin/bash

############
# 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

