mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-25 17:33:09 +01:00
wallpaper: Use sqlite3 command.
This commit is contained in:
parent
3540645a32
commit
0b7a91a8e5
@ -3,7 +3,7 @@ import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from .settings import CACHE_DIR, OS
|
||||
from .settings import CACHE_DIR, HOME, OS
|
||||
from . import util
|
||||
|
||||
|
||||
@ -83,8 +83,11 @@ def set_desktop_wallpaper(desktop, img):
|
||||
|
||||
def set_mac_wallpaper(img):
|
||||
"""Set the wallpaper on macOS."""
|
||||
subprocess.call(["osascript", "tell", "application", "Finder", "set",
|
||||
"desktop", "picture", "to", "POSIX", "file", img])
|
||||
db_file = HOME / "Library/Application Support/Dock/desktoppicture.db"
|
||||
subprocess.call(["sqlite3", db_file, f"update data set value = {img}"])
|
||||
|
||||
# Kill the dock to fix issues with wallpapers sharing names.
|
||||
util.disown("killall", "Dock")
|
||||
|
||||
|
||||
def change(img):
|
||||
|
Loading…
Reference in New Issue
Block a user