- Geektool Scripts Geeklets
- Geeklets
- Geektool Scripts Weather Image
- Geektool Scripts Geeklets
- Geektool Scripts Calendar
42 Astoundingly Useful Scripts and Automations for the Macintosh
- The desktop is very simple and doesn't take a lot of resources—consisting of nothing more than a number of GeekTool scripts to put system information on the desktop. The full list includes: Airport.
- Install the script below in /scripts/shadow.sh (you can put it anywhere, just be sure to modify the upcoming instructions appropriately). Make the script executable: chmod a+x /scripts/shadow.sh; Set up a shell geeklet or nerdlet (GeekTool or NerdTool) to refresh every 60 seconds and run this command: /scripts/shadow.sh 2&1. Alternatively, you can run this with cron.
- GeekTool will execute the script and display the output the way you want it. Image Whether it is a remote webcam, a network graph stored on a monitoring server, or a folder full of holidays pictures, GeekTool can put it on your desktop and refresh automatically, rotate through pictures, etc.
- Mega Roundup of GeekTool Scripts on Francesco Mugnai's blog (which contains links to many other sites). In the video, I show one GeekTool entry that displays my external IP address, which can be.
2019 August 23/6:00 AM
Work faster and more reliably. Add actions to the services menu and the menu bar, create drag-and-drop apps to make your Macintosh play music, roll dice, and talk. Create ASCII art from photos. There’s a script for that in 42 Astounding Scripts for the Macintosh.
5 Examples of Mac Os Desktop Customization using GeekTool. Among the Mac Os X desktop customization tools available, GeekTool is my favorite one. It is a really neat utility that will allow you to run little scripts or “geeklets” to display useful informatiom such as RAM, CPU usage, calender, images and etc. On your Mac’s desktop. Here are 5 good examples of Mac desktop customization using GeekTool.
- Amazon•
GeekTool’s “shell” Geeklet is a great way of displaying the results of command-line scripts on your desktop. I currently have the following shell Geeklets on my computer for monitoring my sites:
- /usr/bin/curl http://www.example.com/server-status?auto
- /usr/bin/ssh monitor@web /usr/bin/uptime
- /usr/bin/ssh monitor@web '/bin/ps -axe | /usr/bin/grep httpd | /usr/bin/wc -l | /usr/bin/sed -E 's/ +//;'
- /usr/bin/ssh monitor@web '/usr/bin/tail -40 /var/log/apache2/error_log'
- /usr/bin/ssh monitor@web bin/freemem
- /usr/bin/ssh monitor@web bin/hightimes
The first one is just grabbing the text version of Apache’s server status page. The second one displays the uptime and current load. The third one counts up the number of httpd processes currently running. And the fourth one displays the last 40 lines of Apache’s error log.
Looking at system stats is as simple as using Expose to pull all windows aside and reveal the desktop. “The memory’s green, the system is clean.”
The final two are a little more complex: freemem and hightimes are Perl scripts I’ve written to display color-coded warnings. It’s easy to add ANSI escape codes using Perl. The escape character is ‘e’. Follow it by an open bracket, the code, and the letter m1. Look for the codes on Wikipedia’s ANSI escape code.
[toggle code]
- #!/usr/bin/perl
- $critical='e[31m'; #red
- $warning='e[35m'; #magenta
- $notice='e[33m'; #yellow
- $clear='e[0m';
- @processes = `/bin/ps -u _www -o time,pid | /usr/bin/sort -nr`;
- for $process (@processes) {
- chomp $process;
- if ($process =~ m/^ +([0-9:.]+) +([0-9]+)/) {
- ($time, $processId) = ($1, $2);
- if ($time =~ m/([0-9]+):([0-9]+).([0-9]+)/) {
- ($hours, $minutes, $minuteFraction) = ($1, $2, $3);
- if ($hours) {
- print '$critical$process$clearn';
- } elsif ($minutes > 10) {
- print '$warning$process$clearn';
- } elsif ($minutes > 5) {
- print '$notice$process$clearn';
- } else {
- #at the end of cputime-intensive processes
- exit;
- }
- } else {
- print '${critical}UNKNOWN TIME FORMAT: $time$clearn';
- }
- }
- }
This runs the ‘ps’ command, getting only processes owned by _www, and displaying only the time and pid columns. The results of ps get piped through sort so that the most time-consuming processes are at the top.
Processes owned by _www that take up a lot of cpu time are displayed in red; those that might be about to take up a lot of cpu time are displayed magenta; and those that are probably just dipping over the line temporarily are displayed in yellow. Otherwise, it doesn’t display at all.
[toggle code]
- #!/usr/bin/perl
- $okay='e[32m'; #green
- $critical='e[31m'; #red
- $problem='e[33m'; #yellow
- $clear='e[0m';
- $usage = `/usr/bin/vm_stat`;
- $warning = $critical;
- if ($usage =~ m/page size of ([0-9]+) bytes/) {
- $pageSize = $1;
- if ($usage =~ m/Pages free: *([0-9]+)/) {
- $free = $1;
- $free = int($free*$pageSize/(1024*1024));
- if ($free > 8000) {
- $warning = $okay;
- } elsif ($free > 6000) {
- $warning = $problem;
- }
- $message = '$free megabytes free';
- } else {
- $message = 'Unable to find free pages';
- }
- } else {
- $message = 'Unable to find page size';
- }
- print $warning, $message, $clear, 'n';
- if ($warning eq $critical) {
- exit(1);
- }
This parses the output of vm_stat to get the current free memory. It also will adjust the green response dot you see in some of the screenshot’s geeklets. The green dot normally means only that the script did okay. For direct commands, you can’t make it be anything else. For your own scripts, however, if you want to change the color of that button you can exit with an error. In Perl, this is as simple as “exit(1)”.
That’s why the free memory script checks to see if the warning is critical before exiting. If the free memory is low enough to justify a critical color code, the script exits with an error code. GeekTool responds to this by turning the normally green dot red.
The hightimes script doesn’t bother with an exit code because it doesn’t display anything at all if there’s nothing out of the ordinary.
Obviously, this isn’t a replacement for a good system monitoring tool like Zenoss2. But for keeping an eye on something command-line oriented through both good and bad, GeekTool is a great little tool.
Note: I’m guessing what the time format is for ps in the first script. I don’t understand what the “ps.1p” means in %l:ps.1p, in the man page description. That’s why I have an error condition for unknown time formats.
I was looking for something else this morning and ran across Term::ANSIColor. Instead of having to look up the color codes in a table and output them exactly right, Term::ANSIColor makes manipulating ANSI codes much easier—and thus less likely to error.
There may be some cases where I don’t want to introduce any dependencies or overhead, but for the most part, Term::ANSIColor should be a much better choice.
In each of the two scripts, it’s just a matter of replacing the variables. Instead of:
- $critical='e[31m'; #red
- $warning='e[35m'; #magenta
- $notice='e[33m'; #yellow
- $clear='e[0m';
Import Term::ANSIColor:
- use Term::ANSIColor;
- $critical = color 'red on_black';
- $warning = color 'magenta on_black';
- $notice = color 'yellow on_black';
- $clear = color 'reset';
Everything else remains the same.
And for the vm_stat script:
- use Term::ANSIColor;
- $okay = color 'green';
- $critical = color 'red';
- $problem = color 'yellow';
- $clear = color 'reset';
One odd issue I ran into is that GeekTool appears to need the ‘reset’ to be followed by a carriage return. Running this Whammy Burger script directly on the command line will act normally—print the text in green—but running it in GeekTool will display an “[0m” at the end of the green text.
- #!/usr/bin/perl
- use Term::ANSIColor;
- print color 'green';
- print 'Whammy Burger!n';
- print color 'reset';
The solution is to move the final ‘n’ below the reset.
- I’m not sure what the ‘m’ means. Monitor?↑
- Which is what provides the graphs in the screenshot. They’re created using Zenoss and displayed via a public URL, using Geektool’s image geeklet.↑
- ANSI escape code
- “ANSI escape sequences are used to control text formatting, color, and other output options on text terminals.”
- GeekTool
- “GeekTool is a System Preferences module for Mac OS 10.5. It lets you display on your desktop different kind of informations, provided by 3 default plugins.” The plugins let you monitor files (such as error logs), view images (such as live graphs), and display the results of command-line scripts.
- Zenoss
- “Open Source Server and Network Monitoring”. Zenoss is built in Python and, at least on OS X, was very easy to set up.
More GeekTool
- icalBuddy and eventsFrom/to
- Ali Rantakari’s icalBuddy has an error in the documentation for the “eventsFrom/to” command-line option. Rather than “tomorrow at time” use “time tomorrow”.
- Put a relative clock on your Desktop with GeekTool
- There are a lot of desktop clocks that show the absolute time. But sometimes you just want to know if the time is today, or yesterday, or two days ago. Here’s how to do it with Python and GeekTool.
- Apple Mail on the Desktop with GeekTool
- Here’s a simple AppleScript to use with GeekTool to put your inbox on the Desktop.
- GeekTool, TaskPaper, and XML
- A script to convert a TaskPaper file to XML so as to filter it for specific tags and display the results on the Desktop.
- Command-line mail on OS X: re-alpine and Geektool
- If you do a lot of automated command-line scripts, you probably also generate a lot of mail to /var/mail. OS X only has the mail program built-in, and its GUI mail client hasn’t been able to add simple mail accounts since about OS X 10.2. Alpine can get you a better mail client, and Geektool can provide better notices.
Remember the Geek: RTM for GeekTool
I started playing around with GeekTool (http://projects.tynsoe.org/en/geektool/) this weekend. For those who haven't heard of it before, GeekTool is a Mac program that displays 'stuff' directly on the desktop. 'Stuff' can be files, images, or anything output by a script. It's a very useful program, so I highly recommend all Mac users try it out.
After getting the weather and a calendar setup, I looked for a way to display my RTM tasks on it. The scripts I found seemed to be needlessly complex, so I decided to write a nice, simple one using the Atom feeds. In case someone else here uses GeekTool, I'm sharing it with the world:
http://www.starsage.net/files/scripts/rememberthegeek.py.zip
I included needlessly detailed instructions in the file, so hopefully there won't be any problems. I'd love feedback, though, so if you do have any issues, let me know.
After getting the weather and a calendar setup, I looked for a way to display my RTM tasks on it. The scripts I found seemed to be needlessly complex, so I decided to write a nice, simple one using the Atom feeds. In case someone else here uses GeekTool, I'm sharing it with the world:
http://www.starsage.net/files/scripts/rememberthegeek.py.zip
I included needlessly detailed instructions in the file, so hopefully there won't be any problems. I'd love feedback, though, so if you do have any issues, let me know.
Hi dws90,
Neat script. :) I just wanted to let you know that your tip is a Tips & Tricks Tuesday winner. We've upgraded your RTM account to have a free year of Pro. :)
Neat script. :) I just wanted to let you know that your tip is a Tips & Tricks Tuesday winner. We've upgraded your RTM account to have a free year of Pro. :)
Awesome. Thanks!
Hi, I can't seem to find the instructions. All that I get is a python script.
How do I install it? Thanks very much (I love GeekTool).
How do I install it? Thanks very much (I love GeekTool).
Great, but fails at the first accent character :( (é,à, è, ...)
This also works great in Conky (linux). Thanks!
It seems to fail at the first accent character, or Euro symbol, when the script is used within GeekTool.
It works well from the Terminal.
I tried adding: '# coding: utf-8' as the first or second line in the script but I had no luck.
Any hint? :(
It works well from the Terminal.
I tried adding: '# coding: utf-8' as the first or second line in the script but I had no luck.
Any hint? :(
Yeah, a solution for this would be great ... otherwise it isn't much help, though it looks great when it runs in the terminal ^_^
I found a recipe that works for me:
in function displayList, substitute any occurrence of:
print <some_string>
with:
print unicode(<some_string>).encode('utf-8')
I'm sure there's a more clever way of doing this, though :)
Credits go to these guys:
http://www.saltycrane.com/blog/2008/11/python-unicodeencodeerror-ascii-codec-cant-encode-character/#comments
in function displayList, substitute any occurrence of:
print <some_string>
with:
print unicode(<some_string>).encode('utf-8')
I'm sure there's a more clever way of doing this, though :)
Credits go to these guys:
http://www.saltycrane.com/blog/2008/11/python-unicodeencodeerror-ascii-codec-cant-encode-character/#comments
I'm getting invaild syntax on line 84:
with open(path, 'r') as f:
^
with open(path, 'r') as f:
^
what shall i do after the terminal opens?
@t.h.chia - The instructions are at the top of the script. Open the script in a text editor and it should be pretty obvious.
@ the rest of you: It's failing on accented characters, but only when run through GeekTool? That sounds like a GeekTool bug, so I'm not sure there's much a can do, but I'll look into it.
@ the rest of you: It's failing on accented characters, but only when run through GeekTool? That sounds like a GeekTool bug, so I'm not sure there's much a can do, but I'll look into it.
Is the first accent character problem related to this error?:
Traceback (most recent call last):
File '~/Documents/Scripts/rememberthegeek.py', line 187, in
displayFeeds(feeds)
File '~/Documents/Scripts/rememberthegeek.py', line 182, in displayFeeds
displayList(listTitle, tasks)
File '~/Documents/Scripts/rememberthegeek.py', line 149, in displayList
print 't%sntt%stt%s' % (task['title'], task['due'], task['list'])
UnicodeEncodeError: 'ascii' codec can't encode character u'xe9' in position 68: ordinal not in range(128)
Thank you very much!
Traceback (most recent call last):
File '~/Documents/Scripts/rememberthegeek.py', line 187, in
displayFeeds(feeds)
File '~/Documents/Scripts/rememberthegeek.py', line 182, in displayFeeds
displayList(listTitle, tasks)
File '~/Documents/Scripts/rememberthegeek.py', line 149, in displayList
print 't%sntt%stt%s' % (task['title'], task['due'], task['list'])
UnicodeEncodeError: 'ascii' codec can't encode character u'xe9' in position 68: ordinal not in range(128)
Thank you very much!
The script still doesn't seem to be executable for me. Anyone else have this problem?
...I'm still running 10.4.11, if that makes a difference.
@viewer: yes it's related to that error
@dws90: if we run your Python script redirecting its output to a file, then it raises that Unicode error above
@dws90: if we run your Python script redirecting its output to a file, then it raises that Unicode error above
I should note that the error I posted above came straight out of the terminal. My desktop doesn't have enough space to display enough of my tasks to reach that point.
It was just a simple encoding issue. I've posted a new version of the script that should fix it (same URL as before), so give it a shot and let me know if things still aren't working.
Will this only work for public lists? My lists are private and require username and password, yet there doesn't seem to be any place to enter in the script. Obviously, when I run the script in Geektool I get 'Unable to access feed'. Am I missing something?
Of course, two seconds later I figured it out. Private addresses need to be turned on.
To fix problems with Unicode, add these lines to the top of the Script:
import codecs
import locale
import sys
sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
sys.stdin = codecs.getreader(locale.getpreferredencoding())(sys.stdin)
import codecs
import locale
import sys
sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
sys.stdin = codecs.getreader(locale.getpreferredencoding())(sys.stdin)
I'm getting the same error as rplakas
This is what I get in Terminal:
rememberthegeek.py:87: Warning: 'with' will become a reserved keyword in Python 2.6
File 'rememberthegeek.py', line 87
with open(path, 'r') as f:
^
SyntaxError: invalid syntax
Running on 10.5 with Python 2.5.1 to one that comes with Leopard
This is what I get in Terminal:
rememberthegeek.py:87: Warning: 'with' will become a reserved keyword in Python 2.6
File 'rememberthegeek.py', line 87
with open(path, 'r') as f:
^
SyntaxError: invalid syntax
Running on 10.5 with Python 2.5.1 to one that comes with Leopard
Actually the ^ sits under the o in open in the out not quite like it has been shown above.
It now works flawlessly. Thanks dws90 for your responsiveness!
I'm getting the same error as @rplakas and @zathraszero. Bummer, this sounds really cool!
I also am getting the same error as zathraszero and rplakas...
No errors, but the box is just blank.
try running the script in terminal, my box was blank as well...
In terminal, it does nothing. Just prints the same line waiting for me to add another command.
The new version works with accented characters – great, works perfectly. Thanks!
Remember that in both the terminal and in Geektool you have to phrase the run command as:
python /Users/yourusername/path/to/rememberthegeek.py
python /Users/yourusername/path/to/rememberthegeek.py
Adding 'python' to the front in GeekTool changes nothing. In terminal, it returns this:
88: Warning: 'with' will become a reserved keyword in Python 2.6
File '/Users/krayziesaiko/Sphen/rtm.desktop/rememberthegeek.py', line 88
with open(path, 'r') as f:
^
SyntaxError: invalid syntax
88: Warning: 'with' will become a reserved keyword in Python 2.6
File '/Users/krayziesaiko/Sphen/rtm.desktop/rememberthegeek.py', line 88
with open(path, 'r') as f:
^
SyntaxError: invalid syntax
rememberthegeek.py:88: Warning: 'with' will become a reserved keyword in Python 2.6
File 'rememberthegeek.py', line 88
with open(path, 'r') as f:
^
SyntaxError: invalid syntax
I get this unfortunate error.
File 'rememberthegeek.py', line 88
with open(path, 'r') as f:
^
SyntaxError: invalid syntax
I get this unfortunate error.
It would appear that I was using something introduced in Python 2.6, which doesn't seem to be in Leopard. I don't have a Leopard machine available to test with, but I just uploaded a new version that should fix the error some of you are getting. Please download the new version of the script and let me know if you continue to get the error.
(It was a silly little thing. That's what I get for listening to the documentation when it says 'You should do it this clever way because it's better!')
(It was a silly little thing. That's what I get for listening to the documentation when it says 'You should do it this clever way because it's better!')
This sounds like a great idea, but like several others, I receive the following error and a blank GeekTool box:
File '/Users/Jameson/Documents/GeekTool/Scripts/rememberthegeek.py', line 89
with open(path, 'r') as f:
^
SyntaxError: invalid syntax
(the ^ should be under the 'o' in 'open').
If it helps, I'm running OS X 10.4.11 and Python 2.3.5 (came with Tiger) and redownloaded the script after dws90's most recent post.
File '/Users/Jameson/Documents/GeekTool/Scripts/rememberthegeek.py', line 89
with open(path, 'r') as f:
^
SyntaxError: invalid syntax
(the ^ should be under the 'o' in 'open').
If it helps, I'm running OS X 10.4.11 and Python 2.3.5 (came with Tiger) and redownloaded the script after dws90's most recent post.
thanks for the update, worked just fine on machine with the update...its a leopard machine...and it is definitely Python 2.6. No more with syntax error.
Anyway very cool script, it looks like you are parsing the xml, so theoretically you could print whatever attributes show up in the file right?
For example I only use the due date on one list, but use urls and priorities for most of the others. I'm guessing it wouldn't take much work to set that up...?
Anyway very cool script, it looks like you are parsing the xml, so theoretically you could print whatever attributes show up in the file right?
For example I only use the due date on one list, but use urls and priorities for most of the others. I'm guessing it wouldn't take much work to set that up...?
@jameson.smith: The line mentioned in your error message is no longer present in the latest version of the script, so it looks like you have an older version. Please redownload the script and try again.
@bmcquist: Yes, it's quite easy to change the output. You'll need to modify the createDictionaryFromTask() function to grab the attribute(s) you want, and then change displayList() to print it out. Just follow the example of what's already there.
@bmcquist: Yes, it's quite easy to change the output. You'll need to modify the createDictionaryFromTask() function to grab the attribute(s) you want, and then change displayList() to print it out. Just follow the example of what's already there.
Working now. Thanks.
Thanks for sharing!
I have everything install with private address 'on' and get unable to access the feed. I get the feed ok when I click the Atom feed.
Geektool Scripts Geeklets
yes
Geeklets
@filemakerdave
I had the same problem. I first copied and pasted the URL of my feed into rememberthemilk.py before I went into Settings and set private address 'on'.
I was still getting 'unable to access the feed'
Then I went in and checked the URL again, and found that after I had turn private addresses on, it indeed gave me a private address (doh) that was much longer the the public address I had initially tried.
So I pasted the uber long private address into rememberthemilk.py, and voila, works like a charm.
Though I'd share my rookie mistake. Hope it helps someone :-)
I had the same problem. I first copied and pasted the URL of my feed into rememberthemilk.py before I went into Settings and set private address 'on'.
I was still getting 'unable to access the feed'
Then I went in and checked the URL again, and found that after I had turn private addresses on, it indeed gave me a private address (doh) that was much longer the the public address I had initially tried.
So I pasted the uber long private address into rememberthemilk.py, and voila, works like a charm.
Though I'd share my rookie mistake. Hope it helps someone :-)
Hi all,
I'm using OSX 10.6.1, and RTMFetch 1.1. I followed the instructions but I keep getting this error message:
2009-11-25 20:16:09.258 Python[54047:d07] Error loading /Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain: dlopen(/Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain, 265): no suitable image found. Did find:
/Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain: no matching architecture in universal wrapper
Traceback (most recent call last):
File 'rtmfetch.py', line 33, in
from RTMFetcher.RTMFetcher import RTMFetcher
File '/Applications/RTMFetch 1.1/RTMFetcher/RTMFetcher.py', line 41, in
objc.loadBundle('RTMKeychain', RTMKeychain.__dict__, bundle_path=os.path.join(os.path.dirname(__file__), '../RTMKeychain.framework'))
ImportError: Bundle could not be loaded
Any clues? (Apparently, I'm running Python 2.6.1.)
Thanks!
I'm using OSX 10.6.1, and RTMFetch 1.1. I followed the instructions but I keep getting this error message:
2009-11-25 20:16:09.258 Python[54047:d07] Error loading /Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain: dlopen(/Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain, 265): no suitable image found. Did find:
/Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain: no matching architecture in universal wrapper
Traceback (most recent call last):
File 'rtmfetch.py', line 33, in
from RTMFetcher.RTMFetcher import RTMFetcher
File '/Applications/RTMFetch 1.1/RTMFetcher/RTMFetcher.py', line 41, in
objc.loadBundle('RTMKeychain', RTMKeychain.__dict__, bundle_path=os.path.join(os.path.dirname(__file__), '../RTMKeychain.framework'))
ImportError: Bundle could not be loaded
Any clues? (Apparently, I'm running Python 2.6.1.)
Thanks!
@perezcarballo: You're using a different script than mine. I can't help you with that, other than suggesting that you give mine a shot (download in the first post).
The RTMFetch topic is:
https://www.rememberthemilk.com/forums/tips/7027/
The RTMFetch topic is:
https://www.rememberthemilk.com/forums/tips/7027/
I just downloaded your script and it seems to work nicely in terminal but when I put that same command in geektool, it doesn't want to work. It just shows a blank box.
Great script btw, I've been looking around for this.
Great script btw, I've been looking around for this.
Hey I can't get it to access my RTM feed, it keeps saying, 'Unable to access feed' does it matter which private RSS address I use in the script? I just used the RSS private script from my 'All Tasks' Tab. Private Addresses are enabled, and I've tried resetting my private addresses and pasting the new URLs into the script but I'm still getting the same persistent error :[
But it seems like a great script, just wish I could get it to access my feeds ;[
But it seems like a great script, just wish I could get it to access my feeds ;[
Nevermind fixed it, for those of you who may be having the same problem as me, change your RSS address, if you just directly copy and paste it, it will appear as
'feed://www.rememberthemilk.com/atom/...'
Change the 'feed://'
to
'http://'
That fixed my problem :]
'feed://www.rememberthemilk.com/atom/...'
Change the 'feed://'
to
'http://'
That fixed my problem :]
It's telling me the wrong date for everything. It's saying something is for Sunday, June 13, but its really for Monday, June 14. Any ideas?
The script takes the date directly from the feed, so if the date's wrong, that implies that RTM is outputting the wrong date for some reason. Check the feed yourself (open the URL in your browser) and double-check that that is the case. If so, look at your RTM settings. Perhaps it's a timezone issue?
Quick question. Is there away of not displaying due date when the due date is 'never'. I don't know anything about Python, but I gave it a shot and had this
if(task['due'] != 'never'):
s = '%s' % (task['title'])
print s.encode('utf-8')
else:
s = '%snt%s' % (task['title'], task['due'])
print s.encode('utf-8')
But it does not work. Does this make sense? Is there a quick fix?
Thanks!
if(task['due'] != 'never'):
s = '%s' % (task['title'])
print s.encode('utf-8')
else:
s = '%snt%s' % (task['title'], task['due'])
print s.encode('utf-8')
But it does not work. Does this make sense? Is there a quick fix?
Thanks!
Oops. There was an indentation problem (among other little things). I sorted it out now.
For what is worth, I've thrown a dirty patch for handling private feeds. Replacing the loadOnlineFeed() method with this one does the job:
---
def loadOnlineFeed(feedURL):
backupFilePath = CACHE_DIRECTORY + hashlib.md5(feedURL).hexdigest() + '.xml'
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
password_mgr.add_password(None, feedURL, username, password)
handler = urllib2.HTTPBasicAuthHandler(password_mgr)
opener = urllib2.build_opener(handler)
try:
feed = opener.open(feedURL).read()
createBackupFile(backupFilePath,feed)
except:
return False
return feed
---
(identation seems to be lost here, just ident it like the original one)
hope this helps
---
def loadOnlineFeed(feedURL):
backupFilePath = CACHE_DIRECTORY + hashlib.md5(feedURL).hexdigest() + '.xml'
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
password_mgr.add_password(None, feedURL, username, password)
handler = urllib2.HTTPBasicAuthHandler(password_mgr)
opener = urllib2.build_opener(handler)
try:
feed = opener.open(feedURL).read()
createBackupFile(backupFilePath,feed)
except:
return False
return feed
---
(identation seems to be lost here, just ident it like the original one)
hope this helps
Geektool Scripts Weather Image
this is fantastic ... but, I have to get to the web through a proxy.
I've got it all set up with my feeds. the result is 'unable to access feed'.
I assume it's my proxy getting in the way. true?
any solution? I'm no CLI pro and certainly not much of a Python developer.
I've got it all set up with my feeds. the result is 'unable to access feed'.
I assume it's my proxy getting in the way. true?
any solution? I'm no CLI pro and certainly not much of a Python developer.
Thanks... Works perfectly!
hey any updates to this post or is there something better? I want my RTM things to be on my desktop but this script does not work, all it does is give me a blank screen.. Please help me someone!!!
Geektool Scripts Geeklets
Just picked this up -- works mostly quite well. I'm trying to recreat @perezcarballo's apparent success hiding 'never' dates, though, without much success. Any assistance welcome.
Geektool Scripts Calendar
to post a reply.