- Joined
- Apr 18, 2010
- Messages
- 60
- Reaction score
- 2
- Points
- 8
- Location
- the Netherlands
- Your Mac's Specs
- MBPU 13" (Late '09); 2.53GHz 4GB; OSX 10.6.3
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:
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.
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:
Code:
#! /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"
fi
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.