diff --git a/AUTHORS b/AUTHORS index 0151c38..035f1e0 100644 --- a/AUTHORS +++ b/AUTHORS @@ -19,6 +19,7 @@ https://github.com/vician https://github.com/wesbarnett https://github.com/xenithorb https://github.com/yupyupp +https://github.com/konosubakonoakua https://www.reddit.com/u/officerchrister diff --git a/README.md b/README.md index 3c6b595..7f07254 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,10 @@ near-realtime picture of Earth. * GNOME 3 * Cinnamon 2.8.8 * KDE +* Win10 1909 with python3.7 ### Not Supported + * any other desktop environments that are not mentioned above. ## Configuration @@ -159,6 +161,41 @@ Finally, to launch it, enter this into the console: launchctl load ~/Library/LaunchAgents/org.boramalper.himawaripy.plist +### For Win10 Users + +- change background color + + ![](./win/figures/bg.png) + +- install from source + + `python3 setup.py install` + + after the installation,you can use `hiwamaripy` to fetch photos. + + ![](./win/figures/tutorial-win-cmd.gif) + + + +- modify `./win/auto.bat` + + add your own parameters + + ![](./win/figures/pic2.png) + + + +- modify `./win/task.xml` + + replace the content of `` with your `run_silently.vbs` abs path, + + so as the content of `` + + ![](./win/figures/pic1.png) + +- gif tutorial + + ![](./win/figures/tutorial-win.gif) ## Uninstallation diff --git a/himawaripy/utils.py b/himawaripy/utils.py index 4047b8b..527d157 100644 --- a/himawaripy/utils.py +++ b/himawaripy/utils.py @@ -4,11 +4,21 @@ import subprocess from distutils.version import LooseVersion +import win32api +import win32gui +from win32.lib import win32con + def set_background(file_path): de = get_desktop_environment() - - if de == "mac": + if de == "windows": + key = win32api.RegOpenKeyEx(win32con.HKEY_CURRENT_USER, + "Control Panel\\Desktop", 0, win32con.KEY_SET_VALUE) + win32api.RegSetValueEx(key, "WallpaperStyle", 0, win32con.REG_SZ, "6") + # 2 for stretching, 0 for centering, 6 for fitting + win32api.RegSetValueEx(key, "TileWallpaper", 0, win32con.REG_SZ, "0") + win32gui.SystemParametersInfo(win32con.SPI_SETDESKWALLPAPER, file_path, 1 + 2) + elif de == "mac": subprocess.call(["osascript", "-e", 'tell application "System Events"\n' 'set theDesktops to a reference to every desktop\n' diff --git a/setup.py b/setup.py index 25c7def..b713b87 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ +#-*- coding: utf-8 -*- from setuptools import setup, find_packages -with open("README.md", "r") as f: +with open("README.md", "r",encoding="utf-8") as f: long_description = f.read() setup( diff --git a/win/auto.bat b/win/auto.bat new file mode 100644 index 0000000..dfa2a64 --- /dev/null +++ b/win/auto.bat @@ -0,0 +1 @@ +himawaripy --level=4 \ No newline at end of file diff --git a/win/figures/bg.png b/win/figures/bg.png new file mode 100644 index 0000000..06475a2 Binary files /dev/null and b/win/figures/bg.png differ diff --git a/win/figures/pic1.png b/win/figures/pic1.png new file mode 100644 index 0000000..b1d75fd Binary files /dev/null and b/win/figures/pic1.png differ diff --git a/win/figures/pic2.png b/win/figures/pic2.png new file mode 100644 index 0000000..67d2fa5 Binary files /dev/null and b/win/figures/pic2.png differ diff --git a/win/figures/tutorial-win-cmd.gif b/win/figures/tutorial-win-cmd.gif new file mode 100644 index 0000000..3393656 Binary files /dev/null and b/win/figures/tutorial-win-cmd.gif differ diff --git a/win/figures/tutorial-win.gif b/win/figures/tutorial-win.gif new file mode 100644 index 0000000..f2bced1 Binary files /dev/null and b/win/figures/tutorial-win.gif differ diff --git a/win/install.bat b/win/install.bat new file mode 100644 index 0000000..fbf198b --- /dev/null +++ b/win/install.bat @@ -0,0 +1,3 @@ +@Echo off +schtasks /Create /XML ./task.xml /TN himawari8 +pause \ No newline at end of file diff --git a/win/run_silently.vbs b/win/run_silently.vbs new file mode 100644 index 0000000..43de7e9 --- /dev/null +++ b/win/run_silently.vbs @@ -0,0 +1,6 @@ +Dim path +set oShell = CreateObject("WScript.Shell") +set fso = CreateObject("Scripting.FileSystemObject") +path = fso.GetAbsolutePathName("./auto.bat") +' msgbox path +oShell.run path, 0, ture diff --git a/win/task.xml b/win/task.xml new file mode 100644 index 0000000..0a04b64 --- /dev/null +++ b/win/task.xml @@ -0,0 +1,55 @@ + + + + konosubakonoakua + get himawari8 images and set as background + \himawari8 + + + + + PT1H + P1D + false + + 2019-12-03T11:25:30 + true + + 1 + + + + + + InteractiveToken + LeastPrivilege + + + + IgnoreNew + true + true + true + false + false + + true + false + + true + true + false + false + false + true + false + PT72H + 7 + + + + D:\doc\repo\himawaripy\win\run_silently.vbs + D:\doc\repo\himawaripy\win + + + \ No newline at end of file diff --git a/win/uninstall.bat b/win/uninstall.bat new file mode 100644 index 0000000..cdbb8c7 --- /dev/null +++ b/win/uninstall.bat @@ -0,0 +1,3 @@ +schtasks /Delete /TN himawari8 + +pause \ No newline at end of file