Skip to content

Instantly share code, notes, and snippets.

@wilbeibi
Last active May 16, 2021 03:10
Show Gist options
  • Save wilbeibi/57e63d59ee8446d579e879c8324ba36e to your computer and use it in GitHub Desktop.
Save wilbeibi/57e63d59ee8446d579e879c8324ba36e to your computer and use it in GitHub Desktop.
dropbox ignore hammerspoon config
-- Ignore generated target/ in certain Dropbox folders.
function igonreWater(paths, flags)
for idx, path in pairs(paths) do
if path:sub(-6) == "target" and flags[idx].itemIsDir == true and flags[idx].itemRenamed == true and flags[idx].itemXattrMod ~= true then
print("Ignoring" .. path)
hs.execute(string.format("xattr -w com.dropbox.ignored 1 '%s'", path))
end
end
end
local dropboxWatcher = hs.pathwatcher.new(os.getenv("HOME") .. "/Dropbox/blabla/RustRepos/", igonreWater):start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment