From ca96b32295cd38cdb4a150c1111159cbc9c77f2f Mon Sep 17 00:00:00 2001 From: Greg Darke Date: Tue, 15 Apr 2008 15:16:56 +1000 Subject: [PATCH] Various bug fixes. * Store the file cache after any change (so that we don't loose our place if we crash) * Add a RELOAD command * Support checking if X11 is running on OSX 10.5 --- bin/randombg2_ipc.py | 5 +++++ lib/WallChanger.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/randombg2_ipc.py b/bin/randombg2_ipc.py index b18b672..7a94fc0 100755 --- a/bin/randombg2_ipc.py +++ b/bin/randombg2_ipc.py @@ -138,6 +138,7 @@ class Server(object): debug('Could not set wallpaper. Returned "%s"' % ret) debug('About to sleep for "%d" seconds' % self.cycle_time, DEBUG_LEVEL_LOW) self.callbackObj = self.socketHandler.addCallback(self.cycle_time, self.cycle_next) + self.filelist.doStoreCache(CACHE_LOCATION) return ret def cycle_prev(self): @@ -148,6 +149,7 @@ class Server(object): debug('About to sleep for "%d" seconds' % self.cycle_time, DEBUG_LEVEL_LOW) # Yes this is ment to be cycle_next self.callbackObj = self.socketHandler.addCallback(self.cycle_time, self.cycle_next) + self.filelist.doStoreCache(CACHE_LOCATION) return ret def _finished(self): @@ -182,6 +184,9 @@ class Server(object): def _cmd_RESCAN(self): self.parent.filelist.doScanPaths() self._cmd_NEXT() + def _cmd_RELOAD(self): + self._removeOldTimer() + self.parent.cycle_reload() def _processLine(self, line): prefix, cmd = line.split(None, 1) if prefix != 'CMD': diff --git a/lib/WallChanger.py b/lib/WallChanger.py index 1fb3e82..147518b 100644 --- a/lib/WallChanger.py +++ b/lib/WallChanger.py @@ -22,7 +22,7 @@ def RandomBG(*args, **kwargs): if commands.getstatusoutput("ps ax -o command -c|grep -q WindowServer")[0] == 0: ret = __OSXChanger(*args, **kwargs) - if 'DISPLAY' not in os.environ: + if 'DISPLAY' not in os.environ or os.environ['DISPLAY'].startswith('/tmp/launch'): # X11 is not running return ret else: -- 2.39.2