Welcome Guest Login Register Member List
ExpressionEngine Forums
Advanced Search
Username: Password:
Remember Me? forgot password?
You are here: Forum Home  >  Installation  >  Linux  >  Thread
   
 
My one-line script for fast task entry
 
Ewoutstam
Posted: 26 February 2007 10:35 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  1
Joined  2007-02-26

I just wrote a little script which combines the KDE tool kdialog with the newTodo.rb script.

When I’m in the middle of something, and I suddenly realise there a task to be done, I just press a hotkey, enter the task, and continue with what I was doing, the task now safely recorded in my Tracks system.

You can get the newTodo.rb script here: http://www.rousette.org.uk/projects/downloads/comments/ruby-command-line-api-script/

Be sure to have properly preconfigured the newTodo.rb script, just open it up with a text editor.

My script is only one line (I’m assuming newTodo.rb can be found in the ~/bin folder in your homedir):

~/bin/newTodo.rb "`kdialog --inputbox "Enter task here"`" 


Add this to your KDE menu (just paste it in the command box), or stick it in a text file and make it executable. If you’ve used the KDE menu, you can also assign a hotkey to this command, like WIN+T.

Then all that’s left to do is to press the hotkey, and enter the task. It will then show up in the context you have specified in newTodo.rb.

I personally have made an “Inbox” context for this purpose, because the task still needs to be moved to a proper context, given a better descript and a deadline, etc. newTodo.rb can only add to one context. Or you could define more entries in your menu and assign more hotkeys, one for each context. The newTodo.rb script will accept a context argument like so:

~/bin/newTodo.rb -c 14 "`kdialog --inputbox "Enter task here"`" 


The -c 14 bit will put the task in context number 14, no matter the preconfigured setting in newTodo.rb.

Note it doesn’t check if you’ve entered more than 100 chars, anything which exceeds it will be cut off.

Obviously, my script is pretty basic, but it could be expanded to first ask about a context, which could then be converted to the appropriate context id. Since I’m not much of a bash programmer, that’s unlikely to happen, but the current script alone I find tremendously useful so I can record tasks quickly with minimum effort.

Profile
 
bsag
Posted: 26 February 2007 07:31 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  217
Joined  2006-03-05

Nice! It’s very cool what you can do with a command line and an API grin

Luke’s new RESTful API (in the trunk, and will be in the next stable release) has a lot more power and flexibility to interact with the app, so it should be pretty easy to specify all sorts of things from the command line.

Profile
 
   
 
 
‹‹ basic question about apache and tracks      Error on rake ››

Powered By ExpressionEngine
Template Design By Sonnenvogel.com
Select a theme:

ExpressionEngine Discussion Forum - Version 2.1.1 (20081028)
Script Executed in 0.1129 seconds

Atom Feed
RSS 2.0