Hi
I literally fallen in love with this geekleet and i'm trying to make something similar for cpu, but it simply doesn't work
This is the original tutorial for the diskspace
and the original DCM.scpt
this is my script
and my desktop
http://img651.imageshack.us/img651/8803/schermata20130103alle17.png
I simply want CPU.scpt working in order to have a circle like the hdd capacity indicator
I literally fallen in love with this geekleet and i'm trying to make something similar for cpu, but it simply doesn't work
This is the original tutorial for the diskspace
d13t
110923
Inspired by & adapted script from midnighttokerkate's [Circle Volume Indicator](http://www.macosxtips.co.uk/geeklets/system/circle-volume-indicator/)
INSTRUCTIONS
------------
1. Move DiskCapacityMeter folder to your preferred directory, eg to **Documents/Geektool/**
2. Edit the PATH variable in DCM.scpt to match the path of the DiskCapacityMeter folder,
eg **/Users/YOURUSERNAME/Documents/GeekTool/DiskCapacityMeter/**
3. Open GeekTool/NerdTool and set up a shell geeklet to do:
`osascript /PATH/DCM.scpt`
Where PATH is the path from step 2.
4. Then set up an image geeklet with image:
`file://localhost/PATH/temp.png`
Where PATH is the path from step 2. I placed the image geeklet bottom center of my screen and the 'blind' shell geeklet right under it. This is not ideal and somebody could make all this work without AppleScript but hey, it works!
5. Set refresh rate of the geeklets to what you like, I prefer 3600 seconds.
and the original DCM.scpt
Code:
-- @d13t
-- 110923
-- Inspired by & adapted script from midnighttokerkate's Circle Volume Indicator
-- http://www.macosxtips.co.uk/geeklets/system/circle-volume-indicator/
-- In GeekTool/NerdTool set up shell geeklet with: osascript /Users/d/Documents/GeekTool/DiskCapacityMeter/DCM.scpt
-- In GeekTool/NerdTool set up image geeklet with image: file://localhost/Users/d/Documents/GeekTool/DiskCapacityMeter/temp.png
-- Set refresh rate to what you like, I prefer 3600 seconds
on run
-- Set the path to the directory of the DiskCapacityMeter folder
-- For example: ""
set pathName to "/Users/me/Documents/Geektool/DiskCapacityMeter/"
-- df -hl | grep 'disk0s2' | awk '{sub(/%/, "");print $5}'
-- Substitute % with ""
set usedSpace to (do shell script "df -hl | grep 'disk1s2' | awk '{sub(/%/, \"\");print $5}'") as integer
-- Getting the rounded number
set theNumber to (round (usedSpace / 5)) * 5
-- Replacing the image
do shell script ("cp " & pathName & "/img/" & theNumber & ".png " & pathName & "/temp.png")
end run
this is my script
Code:
on run
set usedSpace to (do shell script "top -l 1 | awk 'CPU usage' | awk '{sub(/%/, \"\"); print $7}'") as integer
-- Getting the rounded number
set theNumber to (round (usedSpace / 5)) * 5
-- Replacing the image
do shell script ("cp " & pathName & "/img/" & theNumber & ".png " & pathName & "/temp.png")
end run
and my desktop
http://img651.imageshack.us/img651/8803/schermata20130103alle17.png
I simply want CPU.scpt working in order to have a circle like the hdd capacity indicator