facebook youtube twitter reddit stumbleupon delicious Blog
**Desklets are recommended for intermediate computer users only**

What are Desklets?
Basic Usage
Desklet F.A.Q.
Example Image Desklets
Example Shell Desklets

What are Desklets?

Desklets let you run Shell Commands, Images, and Text files on your Desktop. Shell Commands are Unix Commands that let you display all kinds of interesting information; using anything from simple commands to complex scripts. Image Desklets let you display images from either your local hard drive or images from around the web on your Desktop. And Text Desklets let you display text files (Plain text only, .txt) on your Desktop. Of the three kind of Desklets, Shell Desklets are the most powerful.


Basic Usage

To add a certain type of Desklet to the Desktop, click "Add Shell", "Add Image", or "Add Text." If you add a Shell Desklet, enter a command in the Command text field then hit Enter. If you add an Image Desklet, enter the URL or path to the image file and hit Enter. If you add an Text Desklet, enter the path to the text file (Plain text only, .txt) and hit Enter.

Once you have a Desklet displayed, you can set the font style, background color, refresh rate, and custom make it you however you want.

Please note that having too many Desklets refresh too often can have a negative impact on performance. It's recommended not to have more than two or three Desklets that refresh every 1 second. Most Desklets will be fine with the default refresh rate, which is 3600 seconds (one hour).


Desklet F.A.Q.

How can I paste a Command into the command text field?

Since Mach Desktop is a "faceless" app, normal keyboard combinations won't work. You can, however, right-click on the text field and choose "Paste."

Can I run Geeklet™ files with Mach Desktop?

You can't run Geeklet™ files directly. But many Geeklet files are bash, sh, ruby, python, or applescripts; all of which will run fine in Mach Desktop. Geeklet commands will work fine with Mach Desktop as well.

Can I run gDesklet™ files with Mach Desktop?

Again, you can't run gDesklet™ files directly. But many gDesklet files are python scripts; which will run fine in Mach Desktop.

How can I add an Image Desklet that shows an image file on my hard drive?

Enter to the path to the file, for example: /Users/yourname/Pictures/picture.jpg

How can I run a Bash script from a Shell Desklet?

/path/to/script.bash

How can I run a SH script from a Shell Desklet?

/path/to/script.sh

This will work also:

sh /path/to/script.sh

How can I run a Python script from a Shell Desklet?

python /path/to/script.py

You can also enter an argument like this:

python /path/to/script.py argument

How can I run a Ruby script from a Shell Desklet?

ruby /path/to/script.rb

How can I run an Applescript from a Shell Desklet?

osascript /path/to/script.scpt


Example Image Desklets

(The following Example Image Desklets use images from
123Webcam and Wunderground, two excellent sites featuring thousands of webcam and satellite images. You can, of course, choose any image from any website.)

Local Web Cam 1
http://www.clearwater-fl.com/beachcams/cam2/image.jpg

Local Web Cam 2
http://www.clearwater-fl.com/beachcams/cam_1/image.jpg

Local Cloud Coverage
http://wublast.wunderground.com/cgi-bin/WUBLAST?lat=27.95783043&lon=-82.45883179&zoom=3&width=192&height=192&key=sat_vis_thumb&basemap=1&gtt=0&num=1&timelabel=0&delay=25&borders=1&theme=WUBLAST_WORLD&extension=png&proj=ll&rand=1312303415

National Satellite
http://icons-ecast.wxug.com/data/640x480/2xus_rd.gif

Example Shell Desklets

(These can be copied and pasted directly into the Command text field, with exception to the Weather Shell.)

Text
echo 'Hello, World!'

Month:
date +"%B"

Date of the Month:
date +"%d"

Day of the Week:
date +"%A"

Full Date:
date +"%A %B %d, %Y"

Time:
date +"%l:%M"

Seconds:
date +"%S"

AM/PM:
date +"%p"

Simple Calendar: (Works best with a Fixed-width font)
cal

Horizontal Calendar: (Works best with a Fixed-width font)
cal | sed -e '1d' -e '2p;2p;2p;2p' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | sed "s/^/ /;s/$/ /;s/ $(date +%e) /\|$(date +%e)\|/"


Conditions and Temperature (Replace "POSTALCODE" with your postal code, change the two "f"s to "c"s for Celsius)
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=POSTALCODE&u=f" | grep -E '(Current Conditions:|F<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'
On this Day:
curl http://www.infoplease.com/rss/dayinhistory.rss | grep CDATA | sed -e 's/\(.*\[\)//' -e 's/\].*//'

Quote of the Day:
curl -s http://www.dailyzen.com/ | sed -n "/<\!--Add Quote for correct day-->/,/<\/TD>/p"|sed -e "s/<[^>]*>//g" |strings|fold -sw60

Homeland Security Level
curl -s http://www.dhs.gov/dhspublic/getAdvisoryCondition | grep CONDITION

Clipboard Contents
pbpaste

Basic Computer Information
scutil --get ComputerName;
sw_vers | awk -F':\t' '{print $2}' | paste -d ' ' - - -;
sysctl -n hw.memsize | awk '{print $0/1073741824" GB RAM"}';
sysctl -n machdep.cpu.brand_string;

Hard Disk Space
df -hl | grep 'disk0s2' | awk '{print $4"/"$2" free ("$5" used)"}'

Battery Percentage
bat=$((`ioreg -rc "AppleSmartBattery" | awk '/CurrentCapacity/{print $3}'` * 100 / `ioreg -rc "AppleSmartBattery" | awk '/MaxCapacity/{print $3}'`));echo $bat"%"

Number of Unread Mail Messages
echo 'tell application "Mail" to return unread count of inbox as string & ""' | osascript

Current iTunes Track
echo 'tell application "iTunes" to return name of current track' | osascript