]> code.delx.au - bg-scripts/commitdiff
Various bug fixes.
authorGreg Darke <greg@tsukasa.net.au>
Tue, 15 Apr 2008 05:16:56 +0000 (15:16 +1000)
committerGreg Darke <greg@tsukasa.net.au>
Tue, 15 Apr 2008 05:16:56 +0000 (15:16 +1000)
  * 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
lib/WallChanger.py

index b18b672f2fbde513549333ebb6de8434ccce10ea..7a94fc0febd89e3d67b849739a4dafefb6418a4f 100755 (executable)
@@ -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':
index 1fb3e82f587de93ff9b181186391ce05a66e93b3..147518bc468d002ccde58b120737c0c0074b063c 100644 (file)
@@ -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: