From 80fd0ff64668966ca5d37355c8369090e61b102b Mon Sep 17 00:00:00 2001 From: Gremious Grenald Date: Tue, 27 Jun 2023 21:10:12 +0100 Subject: [PATCH 1/2] Use bytestring for wallpaper path on Windows --- pywal/wallpaper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py index 6a506279..2903a2a5 100644 --- a/pywal/wallpaper.py +++ b/pywal/wallpaper.py @@ -175,7 +175,10 @@ def set_win_wallpaper(img): if "x86" in os.environ["PROGRAMFILES"]: ctypes.windll.user32.SystemParametersInfoW(20, 0, img, 3) else: - ctypes.windll.user32.SystemParametersInfoA(20, 0, img, 3) + # 'W' funcitons take uniqcode strings, + # while 'A' functions take UTF-8 bytestrings. + # (Python 3 strings are Unicode by default.) + ctypes.windll.user32.SystemParametersInfoA(20, 0, str.encode(img), 3) def change(img): From 22c112569af8f36a2953014365c5388f66422981 Mon Sep 17 00:00:00 2001 From: Gremious Date: Thu, 3 Aug 2023 12:09:18 +0100 Subject: [PATCH 2/2] Fix space in wallpaper.py --- pywal/wallpaper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py index 2903a2a5..77fe8a20 100644 --- a/pywal/wallpaper.py +++ b/pywal/wallpaper.py @@ -175,7 +175,7 @@ def set_win_wallpaper(img): if "x86" in os.environ["PROGRAMFILES"]: ctypes.windll.user32.SystemParametersInfoW(20, 0, img, 3) else: - # 'W' funcitons take uniqcode strings, + # 'W' funcitons take uniqcode strings, # while 'A' functions take UTF-8 bytestrings. # (Python 3 strings are Unicode by default.) ctypes.windll.user32.SystemParametersInfoA(20, 0, str.encode(img), 3)