rsync.nvim icon indicating copy to clipboard operation
rsync.nvim copied to clipboard

Notification support

Open isentropic opened this issue 5 months ago • 5 comments

Would you accept a PR that would bring optional notification on each transfer listing success or failure or list of files transferred

isentropic avatar Sep 02 '25 09:09 isentropic

Sure, but what do you need this for? If you want to know if the repo is synced or not there already exists a status to retrieve that withrequire("rsync").status() if I remember correctly.

There is also the on_exit callback in the config, where you can get the exit code of each job. But which file was updated would be a lot more problematic to do.

OscarCreator avatar Sep 02 '25 13:09 OscarCreator

Sometimes I'm not sure if sync worked or not, and I'm left in the confused state. I was thinking that a small notification in style of LSP could help visually to remind that rsync worked

isentropic avatar Sep 03 '25 15:09 isentropic

BTW amazing repo, exactly what i was looking for. Sometimes automatic mode is confusing in the sense if its working or not, it is too seamless and I usually double check about success of copy.

isentropic avatar Sep 03 '25 15:09 isentropic

I usually have the status as a part of the statusline, that way you always know if it's synced or not. Depending on how often you save files, a notification every time might be a bit much. But it shouldn't be too hard to add a callback at least.

OscarCreator avatar Sep 03 '25 17:09 OscarCreator

@isentropic I don't know if this is useful or not but I set up rudimentary notifications like this

return {
  "OscarCreator/rsync.nvim",
  build = "make",
  dependencies = "nvim-lua/plenary.nvim",
  config = function()
    require("rsync").setup({
      -- Your other rsync plugin settings here e.g. sync_on_save, project_config_path etc.
      on_exit = function(code, command)
        if code == 0 then
          vim.notify("✓ Rsync succeeded", vim.log.levels.INFO, { title = "Rsync" })
        else
          vim.notify("✗ Rsync failed (exit: " .. code .. ")", vim.log.levels.ERROR, { title = "Rsync" })
        end
      end,
    })
}

mtchavez avatar Oct 30 '25 21:10 mtchavez