aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Eikenberry <[email protected]>2017-08-02 23:20:31 -0500
committerAaron Eikenberry <[email protected]>2017-08-02 23:20:31 -0500
commit6a4c7de6510e914b029a36461e2777633eb69060 (patch)
tree56c778489ff0bdebf41bcfe1f4611d923e394f94
parentAdds support for changing tab bar color in iTerm (diff)
downloadpywal-6a4c7de6510e914b029a36461e2777633eb69060.tar.xz
pywal-6a4c7de6510e914b029a36461e2777633eb69060.zip
fixes mac wallpaper
-rw-r--r--pywal/wallpaper.py9
-rwxr-xr-xtests/test_sequences.py5
2 files changed, 6 insertions, 8 deletions
diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py
index dae0f24..17c60a1 100644
--- a/pywal/wallpaper.py
+++ b/pywal/wallpaper.py
@@ -83,14 +83,7 @@ def set_desktop_wallpaper(desktop, img):
def set_mac_wallpaper(img):
"""Set the wallpaper on macOS."""
- 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 cached wallpapers.
- # macOS caches wallpapers and if a wallpaper is set that shares
- # the filename with a cached wallpaper, the cached wallpaper is
- # used instead.
- util.disown(["killall", "Dock"])
+ subprocess.Popen(f"""osascript -e 'tell application "Finder" to set desktop picture to POSIX file "{img}"'""", shell=True)
def change(img):
diff --git a/tests/test_sequences.py b/tests/test_sequences.py
index dd69e62..66f4084 100755
--- a/tests/test_sequences.py
+++ b/tests/test_sequences.py
@@ -29,6 +29,11 @@ class Testsequences(unittest.TestCase):
result = sequences.set_color(11, COLORS["colors"]["color0"])
self.assertEqual(result, "\033]4;11;#1F211E\007")
+ def test_set_iterm_tab_color(self):
+ """> Create iterm tab color sequences"""
+ result = sequences.set_iterm_tab_color(COLORS["special"]["background"])
+ self.assertEqual(len(result), 3)
+
if __name__ == "__main__":
unittest.main()