From a8c0834e172681d82e170c3c952e1686ada1ffbb Mon Sep 17 00:00:00 2001 From: Martijn Hoogendoorn Date: Thu, 3 Sep 2015 14:19:13 +0200 Subject: [PATCH] Fix Okular not refreshing updated pdf. Okular (using KDE Frameworks 5) does not automatically reload if the pdf is updated. This commit adds a `touch` in `LatexCommit._execute` if the pdf has changed. Using `os.utime` as it updates modification time. This means it still works on filesystems mounted with `noatime`. --- latexrun | 1 + 1 file changed, 1 insertion(+) diff --git a/latexrun b/latexrun index 3fb2dec..ebbcc8d 100755 --- a/latexrun +++ b/latexrun @@ -1018,6 +1018,7 @@ class LaTeXCommit(Task): debug('commiting {} to {}', outname, commit) shutil.copy(outname, outname + '~') os.rename(outname + '~', commit) + os.utime(commit) except OSError as e: raise TaskError('error committing latex output: {}'.format(e)) from e self._input('file', outname)