Geektool runs almost entirely on shell scripts, which update every few seconds to display useful information on the desktop. Customizing Geektool is made easy by packaged scripts called Geeklets, which can be installed quickly and do not require knowledge of shell scripts to use.
Geektool Mac Scripts
December 15, 2008 at 11:30 AM by Dr. Drang
GeekTool Scripts. A collection of scripts I wrote for use with Geektool on my Macs. GeekTool is an application for Mac OS 10.6+. It lets you display various kinds of information on your desktop. Implementing the Script as a Geeklet. Once you're finished coding, save out this script in your Geeklets folder. Now go back to GeekTool and drag out a new shell Geeklet. In the Command field, type 'osascript' followed by a space and the path to wherever you place the script. Here's what my command looks like. Implementing the Script as a Geeklet. Once you're finished coding, save out this script in your Geeklets folder. Now go back to GeekTool and drag out a new shell Geeklet. In the Command field, type 'osascript' followed by a space and the path to wherever you place the script. Here's what my command looks like. Using GeekTool and lsof, you can display an automatically updated list of open network connections directly on a Mac OS X desktop. This is tip is a “safe” alternative to the previously mentioned openports utility.
I stopped using this GeekTool setup for displaying iTunes album art on my Desktop quite a while ago, because I found that GeekTool kept sucking up memory the longer it ran. This only happened with the album art scripts; GeekTool’s memory use seemed pretty stable when running only the weather script, the SuperDuper script, and the text-based iTunes and Pandora scripts.
Two things made start running the album art script again:
Geektool Scripts Geeklets
- I now keep my Desktop clean. It’s still a convenient place to drop files temporarily, but I now place much more emphasis on the temporarily and clean it off at the end of each day. As such, album art on my Desktop won’t get covered with file icons.
- I saw this Flickr photo of a beautiful Desktop that was using my GeekTool setup for album art. I asked the owner if he was having memory problems with GeekTool and he said he wasn’t, so I figured it was worth trying again.
I hadn’t deleted the album art entries in GeekTool, only disabled them, so it was just a couple of clicks to get them started again. I liked having the album covers back in the lower right corner of my screen again.
Unfortunately, after several days of running, GeekTool’s memory use (as displayed by the Activity Monitor) was up around 100 MB after starting at less than 10 MB. For me, at least, the memory gobbling was still a problem. Toggling the Enable GeekTool checkbox in the Preference Pane off and then back on flushed the memory and restarted GeekTool back at the lower value. Periodically restarting GeekTool is no big deal, but how would I know when to do it?
The Unix
ps
command can monitor memory use if you give the right options. After fiddling around in the Terminal to get the options right, I set up a new GeekTool Shell entry with the commandThis tells
ps
to get the information on all processes (a
), even those not running in a terminal (x
), and displays the memory use in kilobytes and process name (o 'rss,ucomm'
) for each one. This information is piped to awk
, which plucks out the line for GeekTool (/Geek/
) and prints out just the memory use, converted to megabytes and rounded to two decimal places ({printf '%.2f', $1/1024}
).Update 11/16/09
I’ve changed this to
I’ve changed this to
because the
ps
command would sometimes return two lines with the string “Geek” or “GeekTool” and create two sets of output. Don’t know why, but the spurious one always had a smaller memory footprint than the real one, so a descending sort on memory (sort -nr
) and grabbing only the first “GeekTool” line (head -n 1
) filters out the unwanted data.The GeekTool entry looks like this:
It’s placed at the lower right corner of my screen, below the text that identifies the track.
The font is set to 9 point Lucida Grande Bold, right justified, in white with a drop shadow. This is not easy to read, but I didn’t want to distract from the song information, and I only need to know when the number gets big enough to restart GeekTool. Constant monitoring isn’t necessary, so I have GeekTool run the script just once an hour. Even that is probably too often.
I like the idea of using GeekTool to monitor itself. The next logical step will be to see if it can restart itself based on its memory use. That’s a project for another day.
10.6: A script to display available Apple software updates | 6 comments | Create New Account
Click here to return to the '10.6: A script to display available Apple software updates' hint |
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: A script to display available Apple software updates
This would be great if it also checked versions of your installed apps in Applications & ~/Applications for newer versions.
10.6: A script to display available Apple software updates
While interesting, that's certainly a complicated process to check for software updates from the command line. Type this in the Terminal to check for updates:
softwareupdate -l
Type this to install the updates (this requires admin rights):
sudo softwareupdate -i -a
Obviously there's other options if you want to gain more control over which updates are installed but that's the basics. You can even run them on a remote machine if you ssh into it first.
softwareupdate -l
Type this to install the updates (this requires admin rights):
sudo softwareupdate -i -a
Obviously there's other options if you want to gain more control over which updates are installed but that's the basics. You can even run them on a remote machine if you ssh into it first.
10.6: A script to display available Apple software updates
Mac OS X Software Update Notifications for Non-Admin-Users:
http://blog.kaputtendorf.de/2009/02/22/updatecheck/
It works pretty well :)
http://blog.kaputtendorf.de/2009/02/22/updatecheck/
It works pretty well :)
10.6: A script to display available Apple software updates
Yup. As it is written and stored at that hallow place on the Internet:
Thou shalt study thy libraries and strive not to reinvent them without cause, that thy code may be short and readable and thy days pleasant and productive.-- The Ten Commandments for C Programmers. By extension, applies to Unix utilities as well. That said, I didn't know about the command line utility either, and am glad about the comments here often bringing out such solutions.
Is it really a good idea not to run as admin? (OK, bad phrasing--it's never a bad idea. I really mean: is it a bad idea to run as admin?) Running as normal user instead of admin was certainly a good idea on pre-Vista versions of Windows--if you were an admin, you could do anything anywhere and nothing would even try to stop you (or an executable silently running as you).
However, on OS X and newer versions of Windows, you are prompted for your password (or, on Windows, at least just confirmation if you're already an admin) whenever you do anything that requires admin privileges--e.g., modifying anything in the file system besides your profile folder, changing system-wide settings (like power management or the computer's hostname), and the like. You're prompted even if your account currently is an administrator. Even from Terminal (in OS X) you have to sudo for certain commands (and in Windows you'll have to do the equivalent right-click-and-choose 'Run as Administrator,' even if you are one, when you start the command prompt, to give it that extra level of elevation).
I don't really see how it's different, other that running as a non-admin makes you think of the username, as well.
However, on OS X and newer versions of Windows, you are prompted for your password (or, on Windows, at least just confirmation if you're already an admin) whenever you do anything that requires admin privileges--e.g., modifying anything in the file system besides your profile folder, changing system-wide settings (like power management or the computer's hostname), and the like. You're prompted even if your account currently is an administrator. Even from Terminal (in OS X) you have to sudo for certain commands (and in Windows you'll have to do the equivalent right-click-and-choose 'Run as Administrator,' even if you are one, when you start the command prompt, to give it that extra level of elevation).
I don't really see how it's different, other that running as a non-admin makes you think of the username, as well.
10.6: A script to display available Apple software updates
Uh, what's wrong with running
softwareupdate -l
from the command line whenever you're curious?