forgot password?


   
 
Tips with Tracks; Geektool
Posted: 17 August 2006 10:06 PM   [ Ignore ]  
Newbie
Rank
Total Posts:  20
Joined  2006-07-26

http://kvet.ch/articles/2006/08/14/tricks-with-tracks

I suspect you can do the same with ActiveDesktop.

I thought I had posted this here but apparently I did not!

Profile
 
 
Posted: 20 December 2006 01:40 PM   [ Ignore ]   [ # 1 ]  
Newbie
Rank
Total Posts:  2
Joined  2006-12-20

I tried to place the tracks on the desktop by the means of ActiveDesktop, but it requested to login. And when I login the browser is loaded and I’m now in its window instead of ActiveDesktop. And if I can stay in the ActiveDesktop it will be very useful, cuz I don’t need to browse through my tabs to get to tracks. I just hit the clear desktop button and here I am with the tracks before my eyes! Very useful! Is there a way to do it?

Profile
 
 
Posted: 20 December 2006 02:44 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  20
Joined  2006-07-26

Pick the TXT feed url and put that on your desktop.

Profile
 
 
Posted: 20 December 2006 02:49 PM   [ Ignore ]   [ # 3 ]  
Newbie
Rank
Total Posts:  2
Joined  2006-12-20

Thanks! But it’s just text. It’s not the tracks itself. In this case i only can monitor it and not work with it. I once again need to go to my browser window, browse through tabs and so on… :(

Profile
 
 
Posted: 20 December 2006 03:10 PM   [ Ignore ]   [ # 4 ]  
Newbie
Rank
Total Posts:  20
Joined  2006-07-26

yeah, i like having just the list on the desktop.  on the mac you could have a dashboard widget show the html version.

you could always look at making a Konfabulator widget, or see if there is a pre-made one that can be pointed at a url.

Profile
 
 
Posted: 20 December 2006 06:06 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  223
Joined  2006-03-05

alex-and-r: I’m not a Windows user, so I’m probably no help at all on this. What happens in ActiveDesktop usually when you click a link? Does it open that link in IE itself? If so, then it’s going to be tough, because the login page redirects you to the main page. If ActiveDesktop can store cookies, one hacky option might be to log in using IE, then copy the Tracks session cookie across to ActiveDesktop. Then it would think you were logged in and show you the main page.

Anyone else got any ideas? I agree that a Konfabulator/Dashboard widget would be great. With the recent changes in Rails 1.2, we should be able to beef up the API quite a bit, which would make a widget quite capable.

Profile
 
 
Posted: 20 December 2006 09:14 PM   [ Ignore ]   [ # 6 ]  
Newbie
Rank
Total Posts:  28
Joined  2006-06-28

I’ve been using GeekTool to display my due today or tomorrow tasks on my Mac desktop and I love it. I use this:

curl http://127.0.0.1:3000/feed/text/Craig/[token]?due=1 

What I’d like to do is have these same tasks listed, but color coded for those due today or previously (red) and those due tomorrow (yellow). I imagine there’s some fancy way to do this with shell commands (and having GeekTool add the color to the different outputs). For example, could you do the above curl with due=0 to get the red ones, then somehow do a kind of diff between the results of that curl and a curl with due=1 to get the others? I’m not experienced enough with command-line-fu to get this to work: would anyone else want to take up the challenge?

 Signature 

Tracks 1.042 on Locomotive / Camino 1.0.1

Profile
 
 
Posted: 21 December 2006 05:28 PM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  223
Joined  2006-03-05

Craig: Hmm, that’s a fun little problem. I’m working on a solution now, and I think it will work. More later…

Profile
 
 
Posted: 21 December 2006 08:51 PM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  223
Joined  2006-03-05

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{|lineline =~ /\s+\[Due:/ or line =~ /^\w/}
tomorrow 
= `curl -s "#{URL}"?due=1`.split("\n").select{|lineline =~ /\s+\[Due:/ or line =~ /^\w/}
this_week 
= `curl -s "#{URL}"?due=6`.split("\n").select{|lineline =~ /\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.

Image Attachments
coloured_actions.png
Profile
 
 
Posted: 22 December 2006 04:14 AM   [ Ignore ]   [ # 9 ]  
Newbie
Rank
Total Posts:  28
Joined  2006-06-28

Thanks for taking up my challenge.

I’m not getting it to work for me. I’m afraid I might need still clearer directions. When you say run the script, should that be accomplished by just typing its name in Terminal “bin/coloured_actions.rb”? That gets me “(-h will show valid options)” but no files in ~/tmp/.

Or am I to type in “ruby bin/coloured_actions.rb”? That gets no error, but also no files in ~/tmp/.

Does it matter than I run Locomotive for Tracks? That I didn’t have a pre-existing ~/bin directory?

I imagine these sound like dumb questions. If you don’t have the patience or time to hand-hold me through this I’d certainly understand.

Again, I appreciate your efforts to make my idea a reality.

 Signature 

Tracks 1.042 on Locomotive / Camino 1.0.1

Profile
 
 
Posted: 22 December 2006 08:17 AM   [ Ignore ]   [ # 10 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  223
Joined  2006-03-05

OK, first things first.

1. Make sure that you’ve changed the URL and the TEMP_DIR path at the top of the script to match your set up. The URL should be the plain TXT feed url, without the ?due=0 part (that gets added automatically). So it will be something like:

http://0.0.0.0:3000/feed/text/YOURTRACKSUSERNAME/YOURTOKEN 

If you’re using ~/tmp as your temp directory, make sure it actually works, and use the full path in the script. The ‘shebang’ line (the first in the script) should find where you have Ruby on most systems, but just to check, type ‘which ruby’ (without the quotes) in the Terminal and copy that path into the shebang, to replace /usr/bin/env ruby.

If that’s all OK, copy the file to ~/bin if you haven’t already, and no, it doesn’t matter if you have to create the file. Check that it’s executable, and if necessary do

cd ~/bin
chmod 
+x coloured_actions.rb 

Now, while you’re still in the bin directory in Terminal, run the following:

ruby ./coloured_actions.rb 

That *should* work wink

Then you should be able to choose those files to view in GeekTool, as if you were viewing a Console file. I just remembered that GeekTool allows you to show an icon (different on success and failure) for a script, so that’s what I’ve got now to actually call the script periodically. I made a tiny transparent window which sits in the bottom right of my screen. When the script runs without error, it shows a little green spot, and if it fails, it shows a little red spot.

Profile
 
 
Posted: 22 December 2006 04:25 PM   [ Ignore ]   [ # 11 ]  
Newbie
Rank
Total Posts:  28
Joined  2006-06-28

No luck.

When I enter “which ruby” in a regular Terminal window, I get “/usr/bin/ruby”
When I go into Locomotive and open a Terminal window associated with my Tracks, I get “/Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/powerpc/bin/ruby”
But neither of these seem to work when entered into the shebang line. Am I supposed to keep the -wKU switches, or are those for the env command only? (I think I tried both ways with no luck.)

On permissions, my ~/bin directory is 755 and ~/bin/coloured_actions.rb is 755 too; my ~/tmp directory is 777. From my home directory I was able to “touch /tmp/testfile” and it appeared in the directory.

curl works fine, so the problem doesn’t seem to be getting stuff from Tracks - it must be either working with the stuff or writing it to those txt files.

 Signature 

Tracks 1.042 on Locomotive / Camino 1.0.1

Profile