Get Tomboy Notes into Conky
I know all of most of you use Conky to remind yourself, about your cpu specs ;)
Anyway here is simple tutorial on getting your Tomboy notes into Conky.
Tomboy is great for jotting down notes, but I don't like to have it open when I am not using. While Conky is perfect for displaying information in a subtle manner.
This Tutorial attempts to take advantage of this, using the awesome D-Bus interface.
This neat tutorial on Arstechnica was of great help.
http://arstechnica.com/journals/linu...-bus-interface
Step One Tomboy
I have a note in Tomboy called "Tasks" where I will note down tasks and important reminders. You can use any note in Tomboy for this tutorial.
I was able to write a simple python script (my first python script ) to extract this Tomboy note to a text file. In the script you need to set 2 variables, the name of theTomboy note and the file path to the export text file.
Code:
#!/usr/bin/env python
import sys, dbus, gobject, dbus.glib
#Varibale you need to assign values to
noteName = "Tasks" #enter the name of your tomboy note
exportFileName = '/home/myhomefolder/journal/tasks.txt' # the export file
#Read the tomboy note
bus = dbus.SessionBus()
obj = bus.get_object("org.gnome.Tomboy", "/org/gnome/Tomboy/RemoteControl")
tomboy = dbus.Interface(obj, "org.gnome.Tomboy.RemoteControl")
note = tomboy.GetNoteContents(tomboy.FindNote(noteName))
#export the note
file = open(exportFileName, 'w')
file.write(note) # write the file
file.close() # close it
You need to cut and past the above code into a file called exportTomboyNote.py in a folder.
Then you can run the script in a terminal by
Code:
python /pathtoFolder/ exportTomboyNote.py
If you want you can get the script to run every X minutes by editing your cron. I don't want to go into this . This thread deals Cron comprehensively
http://ubuntuforums.org/showthread.php?t=102626
Step Two Conky
To get the note in your Conky, edit your config file.
Then find the word "TEXT" in it, below it you can add the following line
Code:
${head /pathToexportFile/tasks.txt 30 20}
Note. 30 is the number of lines from the top of text file. You also need to increase your text buffer if you planning to read many lines by editing the following lines.
Code:
# Maximum size of buffer for user text, i.e. below TEXT line.default is 16384 bytes
max_user_text 32768
That's it.
This was tested on the Tomboy & Conky that came with Hardy 8.04
Re: Get Tomboy Notes into Conky
Wow, didn't realise this got approved.
Sadly no one found it useful :(
Re: Get Tomboy Notes into Conky
This is great, thanks! Now I'm trying to get todays appointments from evolution calendar / google ical into conky.
Re: Get Tomboy Notes into Conky
Quote:
Originally Posted by
Mandrake12
This is great, thanks! Now I'm trying to get todays appointments from evolution calendar / google ical into conky.
Thanks
I will post a Tutorial in getting you calendar items from Google Calendar into Conky using gcalcli (it's in the repos) soon.
http://code.google.com/p/gcalcli/
I have submitted the thread I will msg you when it gets approved.
Re: Get Tomboy Notes into Conky
Well, thanks for the tomboy script, but please let me know for the Google Calendar I am more than interested!
Re: Get Tomboy Notes into Conky
Well, while we are talking about Tomboy in Conky, It will be nice for the scripts to fetch the layout and also the font (bold/underline/etc etc)
Thanks,
Re: Get Tomboy Notes into Conky
Wow this is really cool :) Do you have time to post any screenshots and files? :D
Re: Get Tomboy Notes into Conky
Well, to update the note automatically I placed the following option in my conky:
${execi 900 ~/.scripts/exportTomboyNote.py}
(900 secondes => 15minutes!)
However, every times it does update, tomboy is lunch, and when already lunch the log file become empty.
Is there a way, for the script to be fetching the information without lunching tomboy, and to fetch the information, when tomboy is open?
Re: Get Tomboy Notes into Conky
Quote:
Originally Posted by
sweetthdevil
Well, while we are talking about Tomboy in Conky, It will be nice for the scripts to fetch the layout and also the font (bold/underline/etc etc)
Thanks,
I wanted to be able to do strike through but Conky doesn't seem to be able to handle different changes italics, bold or strike through in fonts.
Conky can do colour and a complete change in font, so I was planning to do a script will show the finished tasks in a different color
so in the above code rather calling GetNoteContents you need to call GetNoteContentsXml
You get an output like this:
Code:
<note-content version="0.1">Tasks
Clean Fridge
Clear Dust from Computer
<strikethrough>Clean Bathroom
Hair cut</strikethrough>
<strikethrough>
</strikethrough>
<bold><size:large>Reoccuring</size:large></bold>
.
So you will need to then write a script that will replace <strikethrough> to ${color lightgrey}.
1 Attachment(s)
Re: Get Tomboy Notes into Conky
Quote:
Originally Posted by
edmondt
Wow this is really cool :) Do you have time to post any screenshots and files? :D
Not sure what you mean by files the small changes you need to make to your conky are listed in my first post.
Attached is a screenshot which has conky listing my tasks.