s e 7 e n
Power Member
GeekTool is a PrefPane (System Preferences module) for Panther or Tiger to show system logs, unix commands output, or images (i.e. from the internet) on your desktop (or even in front of all windows).
Alguns códigos:
Clock:
Código:
All using the 'Shell' selection:
Date: date +%d
Month: date +%B
Day: date +%A
Time: date +"%I:%M"
AM/PM: date +"%p"
Font: Helvetica Neue (Regular, Bold, Light)
Weather (need Lynx) [Shell]:
Código:
Temperature: lynx -dump [url]http://printer.wunderground.com/cgi-bin/findweather/getForecast?query=YOURZIPCODE|awk[/url] '/Temp/{printf $2, ": "; for (i=3; i<=3; i++) printf $i " " }'
Conditions: lynx -dump [url]http://printer.wunderground.com/cgi-bin/findweather/getForecast?query=YOURZIPCODE|awk[/url] '/Cond/ && !/Fore/ {for (i=2; i<=10; i++) printf $i " " }'
Process Monitor:
Código:
#!/bin/bash
### Curby's GeekTool process listing script (ps+top version)
### by Michael 'Curby' Lee
### v1.00.00, 2007-02-17
### Description
#
# Outputs a list of processes using the most CPU time recently,
# processes having used the most CPU time since they started, and
# processes using the most memory (largest resident memory size).
#
# Compared to geektool-ps and geektool-top, this runs the slowest
# but displays the heftiest programs sorted in three ways and has
# the slimmest output (horizonally).
#
### Suggested use
#
# This script can be executed from the OS X commandline without
# administrative priveleges, but is intended for use with GeekTool
# with a refresh time of 10 seconds. The number of processes
# displayed can be customized below. This script was tested on
# OS X v10.4.8 with GeekTool v2.1.2(112). The script may fail with
# other versions of ps and top.
#
### License
#
# Copyright (C) 2007 Michael Lee
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#-------------------------------------------------------------------------------
# Configuration
#-------------------------------------------------------------------------------
cpu_rows=15
time_rows=15
mem_rows=15
#-------------------------------------------------------------------------------
# Output
#-------------------------------------------------------------------------------
echo "COMMAND PID %CPU"
ps -c -r -ax -o command,pid,pcpu | sed 's/^\(.\{10\}\).\{6\}\(.\{6\}\)..\(.\{4\}\)$/\1\2 \3/' | head -n $(($cpu_rows+1)) | tail -n $cpu_rows
echo
top -l1 -otime -n $time_rows -F -R | tail -n $(($time_rows+1)) | sed 's/\(.\{5\}\) \(.\{10\}\).\{8\}\(.\{8\}\).*/\2 \1 \3/'
echo
ps -c -m -ax -o command,pid,pmem | sed 's/^\(.\{10\}\).\{6\}\(.\{6\}\).\(.\{4\}\)$/\1\2 \3/' | head -n $(($mem_rows+1))
Depois no Terminal fazer chmod 755 ao ficheiro
Depois no GeekTool meter: (substituir o path)
Código:
bash /Users/jvl_iMac/bin/processinfo.bash
Monthly calendar:
Código:
cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./#/g') /"
Displaying the System Log:
Código:
syslog -k Time ge -600
Displaying iTunes Info:
Código:
tell application "System Events"
set powerCheck to ((application processes whose (name is equal to "iTunes")) count)
if powerCheck = 0 then
return ""
end if
end tell
tell application "iTunes"
try
set playerstate to (get player state)
end try
if playerstate = paused then
set trackPaused to " (paused)"
else
set trackPaused to ""
end if
if playerstate = stopped then
return "Stopped"
end if
set trackID to the current track
set trackName to the name of trackID
set theStream to the current stream title as text
if theStream is not "missing value" then
set totalData to "Stream : " & trackName & trackPaused & "
Title : " & theStream
else
set artistName to the artist of trackID
set albumName to the album of trackID
set totalData to "Track : " & trackName & trackPaused & "
Artist : " & artistName & "
Album : " & albumName
end if
return totalData
end tell
Depois no GeekTool: (alterar o path)
Código:
osascript /Users/jvl_iMac/bin/iTunesInfo.scpt
Display Your Computer’s Uptime And Total CPU/Memory Usage:
Código:
uptime | awk '{print "UPTIME : " $3 " " $4 " " $5 }' | sed -e 's/.$//g'; top -l 1 | awk '/PhysMem/ {print "RAM : " $8 " "}' ; top -l 2 | awk '/CPU usage/ && NR > 5 {print $6, $7=":", $8, $9="user ", $10, $11="sys ", $12, $13}'
Display Drive Info
Código:
df -H -l
Display IP Address and Network Info
Código:
#! /bin/bash
myvar1=`system_profiler SPAirPortDataType | grep -e "Current Wireless Network:" | awk '{print $4}'`
myvar2=`system_profiler SPAirPortDataType | grep -e "Wireless Channel:" | awk '{print $3}'`
echo "External :" `curl -s http://checkip.dyndns.org/ | awk '{print $6}' | cut -f 1 -d "<"`
myen0=`ifconfig en0 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'| grep -v inet`
if [ "$myen0" != "" ]
then
echo "Ethernet : $myen0"
else
echo "Ethernet : INACTIVE"
fi
myen1=`ifconfig en1 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'| grep -v inet`
if [ "myen1" != "" ]
then
echo "AirPort : $myen1 [$myvar1 : CH.$myvar2]"
else
echo "Airport : INACTIVE"
fi
No Terminal fazer: chmod 755 ipadd.bash
Depois no GeekTool: (alterar o path)
Código:
bash /Users/jvl_iMac/bin/ipadd.bash
Mais aqui e aqui...
A maior parte já são repetidos ou são outra maneira de fazer o mesmo.
Alguns Desktops