My GeekTool Scripts
Few days ago I published a screenshot of my latest desktop. Now, it is time to publish my favourite shell scripts which I use every day (now I run them with GeekTool).
Date:
-day: date +%A
-month: date +%B
Active processes:
top -ocpu -FR -l2 -n20 | grep '^....[1234567890] ' | grep -v ' 0.0% ..:' | cut -c 1-24,33-42,64-77
Network:
-sh /…/airport.sh
!/bin/sh
myvar1=`system_profiler SPAirPortDataType | grep -e "Current Wireless Network:" | awk '{print $4}'`
myvar2=`system_profiler SPAirPortDataType | grep -e "Wireless Channel:" | awk '{print $3}'`
echo "Airport : $myvar1 - $myvar2"
-bash /…/ip.bash
#! /bin/bash
myen0=`ifconfig en0 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`
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}'`
if [ "myen1" != "" ]
then
echo "AirPort : $myen1"
else
echo "Airport : INACTIVE"
fi
Uptime:
uptime | awk '{print "UPTIME : " $3 " " $4 " " $5 }' | sed -e 's/.$//g'; top -l 1 | awk '/PhysMem/ {print "RAM USED: " $8 " "}' ; top -l 2 | awk '/CPU usage/ && NR > 5 {print $6, $7=":", $8, $9="user ", $10, $11="sys ", $12, $13}'
Battery info:
echo "Battery"
ioreg -w0 -l | grep DesignCapacity | awk '{ print substr($0,19,50) }' | sed 's/"//g'
ioreg -w0 -l | grep MaxCapacity | awk '{ print substr($0,19,50) }' | sed 's/"//g'
ioreg -w0 -l | grep CurrentCapacity | awk '{ print substr($0,19,50) }' | sed 's/"//g'
HDD info(code updated to work with my partition table):
df -h | grep disk0s2 | awk '{print "MacBook HD:", $4, "remaining"}'
df -h | grep disk0s3 | awk '{print "Data:", $4, "remaining"}'
du -sh ~/.Trash/ | awk '{print $1, "used for Trash"}'


February, 15th 2010 at 20:04
a wiesz może jak sobie poradzić z GeekToolem i wyświetlaniem okładki granego utworu w iTunes?
February, 15th 2010 at 20:49
Trzeba zrobić do tego skrypt. Widziałam kilkanaście na macthemes.