Skip to content

Instantly share code, notes, and snippets.

@akastrin
Forked from tgdnt/org-mobile-sync.el
Created January 20, 2024 10:15
Show Gist options
  • Select an option

  • Save akastrin/c8c0157cc380a7f15f10a2f2b8685883 to your computer and use it in GitHub Desktop.

Select an option

Save akastrin/c8c0157cc380a7f15f10a2f2b8685883 to your computer and use it in GitHub Desktop.
org-mobile-sync
;; org-mobile-sync
(defun org-mobile-clean-pre-push()
(with-temp-buffer
(shell-command "rm ~/mobileorg/*" t)))
(defun org-mobile-rclone-sync-post-push()
(with-temp-buffer
(shell-command "rclone sync ~/mobileorg Dropbox:Apps/MobileOrg --exclude \.DS_Store" t)))
(defun org-mobile-rclone-sync-pre-pull()
(with-temp-buffer
(shell-command "rm ~/mobileorg/*" t)
(shell-command "rclone sync Dropbox:Apps/MobileOrg ~/mobileorg" t)))
(add-hook 'org-mobile-pre-push-hook 'org-mobile-clean-pre-push)
(add-hook 'org-mobile-post-push-hook 'org-mobile-rclone-sync-post-push)
(add-hook 'org-mobile-pre-pull-hook 'org-mobile-rclone-sync-pre-pull)
(add-hook 'kill-emacs-hook 'org-mobile-push)
(require 'org-mobile)
(org-mobile-pull)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment