taskd - assistance request
Forum rules
Your own work only.
Your own work only.
Re: GTD, Pomodoro etc.
ha, you guys will get a kick out of this. I don't use task list really. But I came across when; also some information here. Very basic, very simple. Able to choose default editor; emacs is default option if none selected.
And of course, and Joe would be proud, I piped it to bar. Wrote a pretty archaic script to take today's date, loop the file, print line with date greater than today. Simple use case; simple implementation.
And of course, and Joe would be proud, I piped it to bar. Wrote a pretty archaic script to take today's date, loop the file, print line with date greater than today. Simple use case; simple implementation.
Work hard; Complain less
Re: GTD, Pomodoro etc.
Very cool, dkeg.
Re: GTD, Pomodoro etc.
Thanks.
I'm realizing this is pretty wrong. That's cool though, it's s good starting point. I have an idea of where to start, and got some ideas on how.
Hopefully I'll have a better version tonight.
I'm realizing this is pretty wrong. That's cool though, it's s good starting point. I have an idea of where to start, and got some ideas on how.
Hopefully I'll have a better version tonight.
Work hard; Complain less
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: GTD, Pomodoro etc.
Of course, 'when'! That's the brother of 'remind' :D Thanks for the input, Drew.
..gnutella..
taskd - display upcoming tasks
alright, so I wrote a little script to iterate over the next few tasks and display in bar
EDIT: made some improvements and fixed the stops at 3 issue
problem is that it does not work in bar. Still investigating. It runs if I execute in the terminal, but it does stop after 3 passes. As of now, I can use a simple awk string to take the 'next' task and display in bar as in the scrot above, but with a little more cleaning of unwanted values
I know my script is quite not right even if it works. Any suggestions?
The output of when is as such
Code: Select all
#! /bin/bash
## taskd; by dkeg; 2014
## a simple script to iterate
## over the next few tasks
## Task file location
file="$HOME/.when/calendar"
## grab upcoming tasks
today=$(when | awk 'NR==3 {$2=$3=$4="";print}')
tomorrow=$(when | awk 'NR==4 {$2=$3=$4="";print}')
upcoming=$(when | awk 'NR==5 {$2="";print}')
## How long of a delay
#delay=$(sleep 6s)
## Loop the file, display the tasks I want in intervals
while :; do
sleep 6; echo $today
sleep 6; echo $tomorrow
sleep 6; echo $upcoming
done < $file
problem is that it does not work in bar. Still investigating. It runs if I execute in the terminal, but it does stop after 3 passes. As of now, I can use a simple awk string to take the 'next' task and display in bar as in the scrot above, but with a little more cleaning of unwanted values
Code: Select all
when | awk 'NR==3 {$2=$3=$4="";print}'
The output of when is as such
Code: Select all
+ when
Tue 2014 Dec 23 11:04
today 2014 Dec 23 Holiday Prep!
tomorrow 2014 Dec 24 Christmas Eve & Pageant
Thu 2014 Dec 25 Christmas Day
Work hard; Complain less
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: taskd - assistance request
I tried a few variants:
- in the taskd script, you don't actually need the < $file redirection at the end of the script, because the dates are read through awk before. If I keep it inside, bar doesn't show shit.
- if taskd redirects $file instead of calling when, like in cat $file | awk 'NR==1 {$2=$3=$4="";print}' I get a Segfault in bar
- throw this in the bar script:
and it werks. Of course then the sleep doesn't werk. I'll continue digging :)
- in the taskd script, you don't actually need the < $file redirection at the end of the script, because the dates are read through awk before. If I keep it inside, bar doesn't show shit.
- if taskd redirects $file instead of calling when, like in cat $file | awk 'NR==1 {$2=$3=$4="";print}' I get a Segfault in bar
- throw this in the bar script:
Code: Select all
taskd() {
cat $HOME/.when/calendar | awk 'NR==1 {$2=$3=$4="";print}'
}
..gnutella..
Re: taskd - assistance request
thank you. makes sense not needing the < $file. The key is only displaying one event at a time. The goal is to sleep like 300 or so between each task display. I wonder if something in BARs code that conflicts. Runs exactly how I want it to through the terminal, and debug mode doesn't throw anything.
Yes you can set past = 0 to only show today and forward, or -1 to show yesterday forward, and so on. Default is -1; I changed to 0.
Maybe should test with coky.
EDIT: and I'll keep thinking about. I must be missing something. Maybe I can output to a tmp file and redirect each event read; overwriting the previous read; so bar is reading from a simple file with no code.
Let's see how that might work ...
Yes you can set past = 0 to only show today and forward, or -1 to show yesterday forward, and so on. Default is -1; I changed to 0.
Maybe should test with coky.
EDIT: and I'll keep thinking about. I must be missing something. Maybe I can output to a tmp file and redirect each event read; overwriting the previous read; so bar is reading from a simple file with no code.
Let's see how that might work ...
Work hard; Complain less
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: taskd - assistance request
I was thinking of the tmp file too, though it's not perfect. there must be a way to directly pipe the result into the bar's STDIN, and it seems that the 'echo' in taskd doesn't go STDOUT.
One more coffee, a cig, and then try again :)
And yeah, I was thinking the same wrt BAR having a conflict. Why else would it segfault? I mean, it is clear that it cannot work like this:
1) barscript is started and executes taskd, waiting for STDOUT or an error
2) taskd is run with a loop *and* sleep
3) barscript doesn't get the output to send to bar
4) ???
You know what i mean :)
Edit: really the easiest is to put the while loop into .xinitrc, and write the taskd output to a tmpfile. Not as elegant, but hey :)
One more coffee, a cig, and then try again :)
And yeah, I was thinking the same wrt BAR having a conflict. Why else would it segfault? I mean, it is clear that it cannot work like this:
1) barscript is started and executes taskd, waiting for STDOUT or an error
2) taskd is run with a loop *and* sleep
3) barscript doesn't get the output to send to bar
4) ???
You know what i mean :)
Edit: really the easiest is to put the while loop into .xinitrc, and write the taskd output to a tmpfile. Not as elegant, but hey :)
..gnutella..
Re: taskd - assistance request
Thank you for the help MB!! I really appreciate it.
With the working I solution I split the topic to new one, for cleanliness sake. I first wanted to rename this topic, but since I had split off the first few posts from another topic, I couldn't, so I felt this was the best solution.
taskd - display upcoming tasks
With the working I solution I split the topic to new one, for cleanliness sake. I first wanted to rename this topic, but since I had split off the first few posts from another topic, I couldn't, so I felt this was the best solution.
taskd - display upcoming tasks
Work hard; Complain less