OK, I’ve got something working. What I decided to do was to use a Ruby script to fetch the feeds and process them into three separate text files (stored locally) which contain today/overdue actions, actions due tomorrow and actions due in the next week. You can then display each of the text files using GeekTool, placing and colouring each of the files as you wish (see attached screenshot).
Put the following into a file called
coloured_actions.rb
somewhere in your home folder (~/bin is a good place) and make it executable with
chmod +x coloured_actions.rb
:
#!/usr/bin/env ruby -wKU
# Generate 3 seperate text files from Tracks TXT feeds
# listing actions due today (or overdue), tomorrow or
# in the next 7 days.
# You can then pull these text files into GeekTool and colour
# them separately.
# ======== Constants to set with your values ===============
#
# URL for the base feed: http://yourdomain.tld/feed/text/[token]
URL = "http://0.0.0.0:3000/feed/text/admin/[TOKEN]"
# Path to temporary directory
TEMP_DIR = "/Users/YOURUSERNAME/tmp"
#
# =============================================
# Grab each feed, split into lines, then get rid of any non-action lines
today = `curl -s "#{URL}"?due=0`.split("\n").select{|line| line =~ /\s+\[Due:/ or line =~ /^\w/}
tomorrow = `curl -s "#{URL}"?due=1`.split("\n").select{|line| line =~ /\s+\[Due:/ or line =~ /^\w/}
this_week = `curl -s "#{URL}"?due=6`.split("\n").select{|line| line =~ /\s+\[Due:/ or line =~ /^\w/}
# Get rid of repeated actions in tomorrow and this_week
tomorrow = tomorrow - today
today_or_tomorrow = today + tomorrow
this_week = this_week - today_or_tomorrow
# Print the info to three files, stored in TEMP_DIR
file = File.new("#{TEMP_DIR}/today.txt", "w")
file.print "\nToday:\n" + today.join("\n")
file.close
file = File.new("#{TEMP_DIR}/tomorrow.txt", "w")
file.print "\nTomorrow:\n" + tomorrow.join("\n")
file.close
file = File.new("#{TEMP_DIR}/later.txt", "w")
file.print "\nLater:\n" + this_week.join("\n")
file.close
When you run this, you should get 3 text files in your TEMP_DIR, called today.txt, tomorrow.txt and later.txt.
Set up display of those files in GeekTool, then you just need to arrange for the coloured_actions.rb script to be called periodically. You could either do this using cron, or set up a script in GeekTool, making the window tiny and transparent, then set it to refresh every 30 mins or whatever you choose.
I’m sure the script could be made more elegant. One thing is that some of the context headers get removed from the later file, because they are often duplicated in the different periods.
Click thumbnail to see full-size image