mirror of
https://github.com/kittywitch/konawall-py.git
synced 2026-02-09 04:19:19 -08:00
macOS changes
This commit is contained in:
parent
b2cf9c4870
commit
6cc517c163
5 changed files with 224 additions and 80 deletions
|
|
@ -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])
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue