Table of Contents

This post isn’t strictly about what can be achieved within the emacsecosystem but what can be achieved outside it while still binding tothe workflow principles of org mode.

I have yet to convert to any of the internal shells/terminal emulatorswithin emacs, I have continued to Control-Alt-T (C-M-t) term my wayaround linux; although this is becoming less frequent due to mygreater proficiency with dired

As my org journey evolves I have now realised that I have two files Irely on for my quick capturing needs. When an idea pops into my headI am usually emacs bound anyway so org-capture is always there forme. But what if I am alfresco?, and maybe, just maybe I am in aterminal! Well I could quickly switch to emacs as it is 99% likely tobe already running, but what if it is not?!

I could open emacs and then do my thing but emacs now takes a fewseconds to load up and then for me just to close it down againafterwards?! (as if I would) Isn’t there another way?, a better way?Could I idea push to an org file from the terminal with a quick flickof the fingers, could bash help me out here?, so many questions…

Well the answer is that yes, bash can help me out.

For me, any new items using org-capture are always put under theheadline, hence using file+headline in my capture template. Howwill this help?, well using the power of bash and the venerable sedcommand I can search and replace the headline but replace with anextra piece of data, namely a string of my choosing, effectivelyplacing my TODO or note at the top of the org file list!

I thus came up with the following bash scripts:

todo

#!/bin/bashif [[ ! -z $@ ]]; then sed --in-place 's/* Tasks/* Tasks\n** TODO '"$(echo ${@})"'/g' \ "/home/jdyer/DCIM/content/aa--todo.org"fi

note

#!/bin/bashif [[ ! -z $@ ]]; then sed --in-place 's/* Notes/* Notes\n** '"$(echo ${@})"'/g' \ "/home/jdyer/DCIM/content/aa--notes.org"fi

Here is my original todo org file:

On the command line I can now enter:

todo generate art slideshows

and in a flash my org file would now be :

all nice and ready for the next time I open emacs!, and of course nowI can also add notes, or anything else of course.

My aim was for the scripts to be very simple, if you pass in no text /arguments no files will be augmented, generally the idea is just topass in a single string, maybe multiple lines could be passed using\n but that isn’t the way I wanted to use them.