matryer / xbar-plugins

Plugin repository for xbar (the BitBar reboot)
https://xbarapp.com
2.46k stars 1.04k forks source link

re: Todo Colour #811

Closed andrewcockerham closed 7 years ago

andrewcockerham commented 7 years ago

FAO: (@Srdgh) How do I add items? I tried adding lines to the "Users/Andrew/todotodo.txt" file, but they don't show up. Sorry for my ignorance!

screen shot 2017-07-11 at 7 31 10 am

Srdgh commented 7 years ago

Sorry for the delay replying. Just to check two things (sorry if this is too obvious):

1) Have you changed the second half of line 13 to your todo file location? i.e. change: todo_directory = "#{Dir.home}/todo/" to todo_directory = "#{Dir.home}/" (assuming that Users/Andrew/ is your home directory. Otherwise, you could just write: todo_directory = "Users/Andrew/" [edited 15/07/2017 to correct some incorrect advice]

2) On your screenshot, the file seems to be named todotodo.tx but the file location you've given is Users/Andrew/todotodo.txt -- could this mismatch be at the source of the problem?

Let me know if neither of these works, and I'll see what else I can think of.

(NB: the plugin itself can't add items --- you can do that through the usual command line route. The plugin just shows the items, and allows you to click them to mark them done.)

andrewcockerham commented 7 years ago

Yes, I had not edited line 13 correctly, and I fixed the extension to be .txt. Sort of works, but clicking on an item doesn't remove it.

Srdgh commented 7 years ago

Thanks for the feedback. Two things:

1) My previous advice wasn't exactly correct. For you,

-  Line 13 should (given the information you've given me) be `todo_directory = "Users/Andrew/"`, and
-  Line 31 should be `todo_file = File.open("#{todo_directory}todotodo.txt")`

(I mistakenly told you to put the file location in line 13, but in fact line 13 is just for the location of the folder the file is in! I'll now edit this above in case anyone else reads the thread.)

2) In terms of your point about clicking the item to mark it "done", I think this may be because you don't have the small application todo.sh installed. (It's free: here is the main page --- http://todotxt.com/ --- and here is the direct download: http://github.com/ginatrapani/todo.txt-cli/releases ). This bitbar plugin is intended as a way to get the information from the todo.txt file that todo.sh creates into your menubar. Looking at my plugin description I realise this isn't completely clear, so I'll update the description accordingly. I do very highly recommend todo.sh --- and if you do decide to use it, I hope you find this plugin useful.

fabiozc commented 7 years ago

Hi! Any news about how to click to make the task go to done? I've already installed todo.txt and moved the todo.sh to the task folders...

Srdgh commented 7 years ago

Hi fabiozc,

Sorry for the delay responding. If everything is working correctly, then clicking any todo item in the menu should send <full-path-to>todo.sh do <line-number> to your shell.

Perhaps the plugin has the wrong location for the todo.sh file. Does your Todo Colour plugin's line 13 correctly give the path to your todo.sh ? (You say you have moved todo.sh to the task folders, but this will only work without editing the plugin file if your tasks directory is HOME/todo/.)

Might be worth double checking that simply typing <full-path-to>todo.sh do <line-number> in a terminal emulator works.

Sorry if you've already tried those two -- let me know and I can have another think.

Srdgh

fabiozc commented 7 years ago

Srdgh.. in fact I was missing chmod +x todo.sh. Thank you anyway!