diff --git a/src/common/Makefile b/src/common/Makefile index b50e20107..a9960bbbc 100644 --- a/src/common/Makefile +++ b/src/common/Makefile @@ -6,7 +6,7 @@ LDFLAGS = `pkg-config --libs gtk+-2.0 pygtk-2.0` all: idle.so idle.so: - $(CC) $(CFLAGS) $(LDFLAGS) -shared idle.c $^ -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) -shared idle.c $^ -o $@ -L/usr/X11R6/lib -lX11 -lXss -lXext clean: rm -f *.so diff --git a/src/common/sleepy.py b/src/common/sleepy.py index b446e865a..4e041c18d 100644 --- a/src/common/sleepy.py +++ b/src/common/sleepy.py @@ -27,9 +27,12 @@ STATE_AWAKE = "awake" SUPPORTED = 1 try: - import common.idle + import common.idle as idle # when we launch gajim from sources except: - SUPPORTED = 0 + try: + import idle # when Gajim is installed + except: + SUPPORTED = 0 class Sleepy: @@ -39,7 +42,7 @@ class Sleepy: self.interval2 = interval2 self.state = STATE_AWAKE ## assume were awake to stake with try: - common.idle.init() + idle.init() except: SUPPORTED = 0 self.state = STATE_UNKNOWN @@ -47,7 +50,7 @@ class Sleepy: def poll(self): if not SUPPORTED: return 0 - idleTime = common.idle.getIdleSec() + idleTime = idle.getIdleSec() if idleTime > self.interval2: self.state = STATE_XAWAY elif idleTime > self.interval1: