mirror of
https://github.com/kittywitch/konawall-py.git
synced 2026-02-09 12:29:19 -08:00
win32: registry changes for span / fit
This commit is contained in:
parent
e04b7e8431
commit
d894d7176c
1 changed files with 7 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
import ctypes
|
||||
import logging
|
||||
import winreg
|
||||
from imager import combine_to_viewport
|
||||
from module_loader import add_environment
|
||||
|
||||
|
|
@ -21,8 +22,14 @@ This sets wallpapers on Windows.
|
|||
def set_wallpapers(files: list, displays: list):
|
||||
if len(files) > 1:
|
||||
logging.debug("Several monitors detected, going the hard route")
|
||||
desktop = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, winreg.KEY_ALL_ACCESS)
|
||||
wallpaper_style = winreg.SetValueEx(desktop, "WallpaperStyle", 0, winreg.REG_SZ, "5")
|
||||
desktop.Close()
|
||||
file = combine_to_viewport(displays, files)
|
||||
ctypes.windll.user32.SystemParametersInfoW(20, 0, file, 0)
|
||||
else:
|
||||
logging.debug("Detected only one monitor, setting wagilpaper simply")
|
||||
desktop = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, winreg.KEY_ALL_ACCESS)
|
||||
wallpaper_style = winreg.SetValueEx(desktop, "WallpaperStyle", 0, winreg.REG_SZ, "3")
|
||||
desktop.Close()
|
||||
ctypes.windll.user32.SystemParametersInfoW(20, 0, files[0] , 0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue