π

Emacs: Quick Access to Agenda on Android

Show Sidebar

When I am away from my computers, I often need to see the appointments of the upcoming weeks in order to make arrangements. Unfortunately, I can't make Android MobileOrg sync with my local Android calendar. As a workaround, I generate a screenshot of one of my agendas (a month, no todos, only appointments).

Since I am not able to define this PNG image as my lock-screen background (my original plan), I created a lock-screen link to the image instead. To get to the agenda from lock-screen I have to slide the lock-screen link, enter my security pattern, and then my image viewer shows me the agenda.

To semi-automate the generation/update of the screenshot image, I am using following Elisp snippet:

  (defun my-export-month-agenda-to-png-via-screenshot()
    (interactive)
    (message "Generating agenda ...")
    (org-agenda nil "n") ; generates agenda "n" (one month without todos)
    (if (my-buffer-exists "*Org Agenda*")
        (switch-to-buffer "*Org Agenda*")
      (org-agenda-list)
      )
    (message "Waiting for Screenshot ...")
    (sit-for 1) ; (sleep 1) ... doesn't re-display and thus screenshot
                ; showed buffer before switching to agenda
    (message "Say cheese ...")
    (setq myoutput
          (shell-command-to-string "/usr/bin/import -window root /home/vk/phonesync/agenda.png"))
    (message (concat "Screenshot done (" myoutput ")"))
    )	  

Comment via email or via Disqus comments below: