On installation, fix the prefix used in the script.
[embrace.git] / bin / embrace
index 79d57c892ae374d3498066c19d2e5072e936c11e..f6616ea70480a9fa8f8c07468c8c3516aa19367c 100755 (executable)
@@ -17,6 +17,7 @@
 # along with this program; if not, write to the Free Software Foundation,
 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 
+require "evas"
 require "ecore"
 require "ecore_x"
 require "ecore_evas"
@@ -25,10 +26,11 @@ require "yaml"
 require "embrace/imap"
 
 PKG_NAME = "embrace"
-DATADIR = "/usr/local/share/#{PKG_NAME}/"
+PREFIX = nil
+DATADIR = "#{PREFIX || "/usr/local"}/share/#{PKG_NAME}/"
 
 module Embrace
-       VERSION = "0.0.1"
+       VERSION = "0.1.0"
        ICON_FILE = DATADIR + "l33t_MAI_envelope.png"
 
        class ZeroToOneAnimator < Ecore::Animator
@@ -202,7 +204,7 @@ module Embrace
                        super
 
                        @bg = Evas::Rectangle.new(evas)
-                       @bg.set_color(0, 0, 0, 8)
+                       @bg.set_color(0, 0, 0, 0)
 
                        add_member(@bg)
 
@@ -393,9 +395,7 @@ module Embrace
 
                private
                def on_timer
-                       return unless @server.nil?
-
-                       @server = IMAP::Session.new(@config)
+                       @server ||= IMAP::Session.new(@config)
 
                        true
                end