]> git.armaanb.net Git - lightcards.git/commitdiff
Follow XDG_CACHE_HOME
authorArmaan Bhojwani <me@armaanb.net>
Sat, 13 Feb 2021 19:03:18 +0000 (14:03 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Sat, 13 Feb 2021 19:03:18 +0000 (14:03 -0500)
lightcards/progress.py

index 97fcf0c9ce68068db1f5f9914dbe49eb42f5e6e7..a4fdc43b267b687e984210b1e7670c4f2dfacf23 100644 (file)
@@ -5,8 +5,11 @@ import hashlib
 import os
 import pickle
 
 import os
 import pickle
 
-# TODO: Check for $XDG_CACHE_HOME
-dired = f"{os.path.expanduser('~')}/.cache/lightcards/"
+xdg = os.environ.get("XDG_CACHE_HOME")
+if xdg:
+    dired = f"{os.path.expanduser('~')}/{xdg}/lightcards/"
+else:
+    dired = f"{os.path.expanduser('~')}/.cache/lightcards/"
 
 
 def name_gen(stra):
 
 
 def name_gen(stra):