Skip to content

Commit

Permalink
Use bytestring for wallpaper path on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Gremious authored and eylles committed Aug 2, 2023
1 parent cac505a commit 095b169
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pywal/wallpaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,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):
Expand Down

0 comments on commit 095b169

Please sign in to comment.