diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2017-07-31 15:53:39 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2017-07-31 15:53:39 +1000 |
| commit | 0b7a91a8e535983ef68f346dff5a5759d264f1a6 (patch) | |
| tree | 062538c4aebbe5ccef324c2a36c260df24865577 | |
| parent | 3540645a32967d1e9030b5f72082d9e0a83bf038 (diff) | |
wallpaper: Use sqlite3 command.
| -rw-r--r-- | pywal/wallpaper.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py index e5e619e..424052a 100644 --- a/pywal/wallpaper.py +++ b/pywal/wallpaper.py @@ -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): |
