aboutsummaryrefslogtreecommitdiff
path: root/pywal/colors.py
diff options
context:
space:
mode:
authorCaleb Noelke <cjn075@sheriffmediocre.xyz>2022-03-15 14:44:28 -0400
committerCaleb Noelke <cjn075@sheriffmediocre.xyz>2022-03-15 14:44:28 -0400
commit80a1507ccd557db0701a211ef121be28fad37965 (patch)
treedbec2fca2a0fd02187eff2c11bf0b677bc756c8b /pywal/colors.py
parente136433ceadc567b5e84325ede6749314feffd5a (diff)
parent236aa48e741ff8d65c4c3826db2813bf2ee6f352 (diff)
Merge remote-tracking branch 'upst/master'HEADmaster
merge
Diffstat (limited to 'pywal/colors.py')
-rw-r--r--pywal/colors.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pywal/colors.py b/pywal/colors.py
index 49e5571..8688b4b 100644
--- a/pywal/colors.py
+++ b/pywal/colors.py
@@ -18,11 +18,19 @@ def list_backends():
os.scandir(os.path.join(MODULE_DIR, "backends"))
if "__" not in b.name]
+def normalize_img_path(img: str):
+ """Normalizes the image path for output."""
+ if os.name == 'nt':
+ # On Windows, the JSON.dump ends up outputting un-escaped backslash breaking
+ # the ability to read colors.json. Windows supports forward slash, so we can
+ # use that for now
+ return img.replace('\\', '/')
+ return img
def colors_to_dict(colors, img):
"""Convert list of colors to pywal format."""
return {
- "wallpaper": img,
+ "wallpaper": normalize_img_path(img),
"alpha": util.Color.alpha_num,
"special": {