macOS changes

This commit is contained in:
Kat Inskip 2023-10-06 14:43:37 -07:00
parent b2cf9c4870
commit 6cc517c163
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
5 changed files with 224 additions and 80 deletions

View file

@ -10,4 +10,5 @@ This sets wallpapers on Darwin.
def set_wallpapers(files: list, displays: list):
for i, file in enumerate(files):
# Run osascript to set the wallpaper for each monitor
subprocess.run(["osascript", "-e", f'tell application "System Events" to set picture of desktop {i} file "{file}"'])
command = f'tell application "System Events" to set picture of desktop {i} to "{file}"'
subprocess.run(["osascript", "-e", command])

View file

@ -1,7 +1,6 @@
import os
import ctypes
import logging
import winreg
from imager import combine_to_viewport
from module_loader import add_environment
@ -20,6 +19,7 @@ This sets wallpapers on Windows.
"""
@add_environment("win32_setter")
def set_wallpapers(files: list, displays: list):
import winreg
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)