From c84402307713ee71b9b6e5335bb1a0e4834c6c45 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sun, 18 Feb 2018 14:28:46 -0500 Subject: [PATCH] Use QUTE_DATA_DIR in readability userscript --- misc/userscripts/readability | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/misc/userscripts/readability b/misc/userscripts/readability index a5425dbac..f6df5000f 100755 --- a/misc/userscripts/readability +++ b/misc/userscripts/readability @@ -13,7 +13,13 @@ from __future__ import absolute_import import codecs, os -tmpfile=os.path.expanduser('~/.local/share/qutebrowser/userscripts/readability.html') +if 'QUTE_DATA_DIR' in os.environ: + tmpfile = os.path.join(os.environ['QUTE_DATA_DIR'], + 'userscripts/readability.html') +else: + tmpfile = os.path.expanduser( + '~/.local/share/qutebrowser/userscripts/readability.html') + if not os.path.exists(os.path.dirname(tmpfile)): os.makedirs(os.path.dirname(tmpfile))