mirror of
https://github.com/kittywitch/konawall-py.git
synced 2026-02-09 04:19:19 -08:00
Rearchitecture the project for Poetry support.
This commit is contained in:
parent
6cc517c163
commit
4ae3ddc2c0
16 changed files with 603 additions and 47 deletions
14
konawall/environments/darwin.py
Normal file
14
konawall/environments/darwin.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import subprocess
|
||||
from module_loader import add_environment
|
||||
|
||||
"""
|
||||
This sets wallpapers on Darwin.
|
||||
|
||||
:param files: A list of files to set as wallpapers
|
||||
"""
|
||||
@add_environment("darwin_setter")
|
||||
def set_wallpapers(files: list, displays: list):
|
||||
for i, file in enumerate(files):
|
||||
# Run osascript to set the wallpaper for each monitor
|
||||
command = f'tell application "System Events" to set picture of desktop {i} to "{file}"'
|
||||
subprocess.run(["osascript", "-e", command])
|
||||
Loading…
Add table
Add a link
Reference in a new issue