Added windows compatibility #5
No reviewers
No assignees
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
sahin/binary-clock-wallpaper!5
Loading…
Reference in a new issue
No description provided.
Delete branch "CT-66/windows-compatibility"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have added a few lines that adds support for windows too.
@@ -82,1 +82,4 @@canvas.save(result_image_path, quality=95)# windows compatibilityfrom sys import platformI try to follow PEP8 standards in this project. So the import line should be at top of the file.
@@ -83,0 +88,4 @@import ctypesSPI_SETDESKWALLPAPER = 20img_path_win = os.path.join(os.getcwd(), "img", "result.png")os.getcwdreturns the directory where the script is being run. If you run the script from another directory this will fail.Also,
result_image_pathshould contain the correct path. Why did you create the same thing again?@@ -83,0 +92,4 @@png = Image.open(img_path_win).convert("RGB")png.save(os.path.join(os.getcwd(), "img", "result.jpg"))jpg = os.path.join(os.getcwd(), "img", "result.jpg")ctypes.windll.user32.SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, jpg, 0)The task of this script is only creating an image. Setting the wallpaper is another task and it should be handled outside of this script. You can look at
set_binary_wallpaper.shand write something similar to it for windows. Maybe a.batfile, I don't know much about windows.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.