{"id":355,"date":"2021-06-10T12:29:11","date_gmt":"2021-06-10T11:29:11","guid":{"rendered":"https:\/\/amasan.co.uk\/vandragt\/?p=355"},"modified":"2021-06-25T09:55:50","modified_gmt":"2021-06-25T08:55:50","slug":"syncing-wallpaper-images-spoon","status":"publish","type":"post","link":"https:\/\/2022.vandragt.com\/project\/syncing-wallpaper-images-spoon\/","title":{"rendered":"Syncing Wallpaper Images Spoon"},"content":{"rendered":"\n<p>As a macOS user with a multi monitor setup and a laptop I frequently switch between 1 to 3 screens. I  use task related spaces (general, coding, organisation, social) and to reinforce this habit I installed some <a href=\"https:\/\/unsplash.com\/\">Unsplash<\/a> wallpaper images relating to the task.<\/p>\n\n\n\n<p>In some undefined situations I lose the wallpaper image on certain screens on certain desktops (I have already disabled reordering  and removing spaces) but dragging wallpapers across multiple screens on multiple spaces is too much work; and why not see if this can be automated.<\/p>\n\n\n\n<p>Thanks to <a href=\"https:\/\/www.hammerspoon.org\/\">Hammerspoon<\/a> and a few minutes time you can benefit from my script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- SYNC WALLPAPER --\nfunction sync_wallpaper()\n    wp = hs.screen.primaryScreen():desktopImageURL()\n    for index,screen in ipairs(hs.screen.allScreens()) do\n        if screen:desktopImageURL() ~= wp then\n            print('Syncing Wallpaper')\n            screen:desktopImageURL(wp)\n        end\n    end\nend\n\nhs.spaces.watcher.new(sync_wallpaper):start()\n-- \/SYNC WALLPAPER --<\/code><\/pre>\n\n\n\n<p>Add this to your <code>.hammerspoon\/init.lua<\/code> and switch spaces to sync wallpapers to all screens on that space!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">By the way<\/h2>\n\n\n\n<p>I&#8217;m using the following wallpapers:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/unsplash.com\/photos\/1_CMoFsPfso\">General<\/a><\/li><li><a href=\"https:\/\/unsplash.com\/photos\/FWoq_ldWlNQ\">Coding<\/a><\/li><li><a href=\"https:\/\/unsplash.com\/photos\/mO3s5xdo68Y\">Organise<\/a><\/li><li><a href=\"https:\/\/unsplash.com\/photos\/4vr9a_sdJ78\">Social<\/a><\/li><\/ul>\n\n\n\n<p><\/p>\n<div class=\"syndication-links\"><\/div>","protected":false},"excerpt":{"rendered":"<p>As a macOS user with a multi monitor setup and a laptop I frequently switch between 1 to 3 screens. I use task related spaces (general, coding, organisation, social) and to reinforce this habit I installed some Unsplash wallpaper images relating to the task. In some undefined situations I lose the wallpaper image on certain [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"mf2_syndication":[],"webmentions_disabled_pings":false,"webmentions_disabled":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-355","post","type-post","status-publish","format-standard","hentry","category-project"],"_links":{"self":[{"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/posts\/355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/comments?post=355"}],"version-history":[{"count":2,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/posts\/355\/revisions"}],"predecessor-version":[{"id":357,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/posts\/355\/revisions\/357"}],"wp:attachment":[{"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/media?parent=355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/categories?post=355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/tags?post=355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}