Amy Grinn UP | HOME Fedi

Share with Org

I've created a Tasker project which adds an item to the Android share menu to launch Org capture. It will cost about $1.49 to purchase AutoShare for this to work, however there is a free 7 day trial.

In addition, the Org capture process can be launched by clicking a widget and filling in required fields. This part is free; you can just ignore all AutoShare instructions.

Configure

Termux

Install Termux and Termux:Tasker from F-Droid.

Open the Termux app and install Emacs.

pkg install emacs

Emacs

Add the following to your Emacs init file, usually ~/.emacs or ~/.emacs.d/init.el. Make sure to edit the location (file "~/org/IN.org") with the location you would like to save items to. This can include a tramp protocol, such as (file "/ssh:laptop:some/file.org")

You can add multiple templates here and choose between them in the capture dialog.

;; See variable documentation for options
(setq org-capture-templates
      '(("l" "Quick link" entry (file "~/org/IN.org")
         "* %a\n%U\n\n%i\n"
         :immediate-finish t
         :kill-buffer t)))

;; Load org protocol after starting the daemon
(with-eval-after-load 'server
  (require 'org-protocol))

Tasker

Install Tasker and AutoShare from the Play store.

In the AutoShare app, you can start a 7-day free trial or purchase a permanent license.

Next, from the main menu of AutoShare, click Manage Commands, click the + in the top right corner and enter Org as the name. You can use this url for the icon:

https://orgmode.org/resources/img/org-mode-unicorn.png

Go back to the main menu, click Share Targets and make sure only "AutoShare Command" is enabled.

Open the Tasker app and configure permissions as instructed. In addition, open the Settings app, click Apps, find Tasker, click Permissions, then at the bottom of the list click Additional permissions, then Run commands in Termux environment, and make sure Allow is selected.

Import the following Tasker project. It will ask for a comma-separated list of template keys. If you used the Emacs config above, keep the default, which should be l.

Org Capture

You should now be able to see the AutoShare icon in the share menu. Click on it to send it to Org mode.

The dialog that is displayed when capturing can be used to edit the entry before it is saved. Because of the lack of empty variables in Tasker, whenever there is no content to display you will see the variable name, such as %title or %notes, instead of an empty box.

In addition to the share menu, you can use a home screen widget to launch the Org Capture task. Long press on the home screen to add a widget, then click and drag any of the Tasker widgets to the desired location on the home screen. When it asks, select the "Org Capture" task. The next part is a little buggy. It will launch Tasker and display the task. From here you must use the back gesture on your phone to get the widget to populate correctly. Typically, this is dragging from the side of the screen, or there might be a virtual or physical button at the bottom of the screen.

That's it! If you have any issues or suggestions feel free to reach out.

I've made some further simplifications and improvements here: https://blog.amygr

Created: 2024-09-28

Last modified: 2024-11-16