New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

Geektool/Nerdtool: Conditional Images? [Bash]

Post Reply New Thread Subscribe

Thread Tools

Member Since: Apr 18, 2010
Location: the Netherlands
Posts: 60
Kaham is on a distinguished road
Mac Specs: MBPU 13" (Late '09); 2.53GHz 4GB; OSX 10.6.3

Kaham is offline
Hey all,

I've recently discovered Geektool and its spin-off Nerdtool, and I've found a way I wish to implement this:

If my battery charge falls below a certain threshold, I would like script to display an image. However, I have not yet found out how. This is the script I am currently using:

#! /bin/bash
charge=`/usr/sbin/ioreg -l | /usr/bin/grep -i capacity | /usr/bin/tr '\n' ' | ' | /usr/bin/awk '{printf("%.0f",$10/$5 * 100)}'`

if [ $charge -lt "20" ]; then
echo "20"
This displays a simple "20" if the charge is less than 20%. Now instead, I would like to replace this with an image. I'm new to Mac, so also a relative noob when it comes to bash scripts. Does anyone have a clue how to achieve this? (So I would like to replace the echo "20" part with something that says "hey, lets display image Y found in folder X".)

Any help would be greatly appreciated. Thanks guys.
QUOTE Thanks

Post Reply New Thread Subscribe

« Handouts in Keynote | Will Starcraft 2 Work On My Mac? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Starter
Last Post
Images from ONE website won't load Elixia OS X - Operating System 9 11-12-2011 12:13 PM
images on ipod classic tws iPod Hardware and Accessories 1 03-02-2009 09:52 PM
All Images bryanall Switcher Hangout 1 12-09-2008 10:04 PM
importing additional images into a project nick_harambee OS X - Apps and Games 0 03-28-2007 05:49 PM
Getting images to show up in Dreamweaver dziner Web Design and Hosting 4 07-22-2004 04:11 PM

All times are GMT -4. The time now is 11:10 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?