1

Just change/add/remote the pathOfTrash variables. Then call the script from your Geeklet.

#!/bin/sh
#
pathOfTrash[0]="/Users/myusername/.Trash"
pathOfTrash[1]="/.Trashes"
pathOfTrash[2]="/Volumes/Drobo TimeCapsule/.Trashes"
pathOfTrash[3]="/Volumes/RAID Storage/.Trashes"

diskUsageCommnd=$(du -sckh /Volumes/*/.Trashes ~/.Trash/)
trashSize=$(echo $diskUsageCommnd | egrep -o '([0-9\.GMBK]+)\stotal' | head -n1 | egrep -o '([0-9\.GMBK]+)')
totalFiles=0
for i in "${pathOfTrash[@]}"
do
    :
    filesInFolder=$(find "$i" -type f | wc -l)
    folderName="${i/.Trashes/}"
    folderName="${folderName/.Trash/}"
    if [ $filesInFolder -gt 0 ]
    then
    if [ $filesInFolder -gt 1 ]
    then
        echo $filesInFolder "files in" $folderName
    else
        echo $filesInFolder "file in" $folderName
    fi
else
    #echo "No files in" $i
    zippo=0
fi
totalFiles=$(($filesInFolder+$totalFiles))
done

if [ $totalFiles -gt 0 ]
then
if [ $totalFiles -gt 1 ]
then
    itemName="Items"
    totalName="that are"
else
    itemName="Item"
    totalName="that is"
fi
echo "A total of" $totalFiles $itemName $totalName $trashSize
else
echo "Trash is empty!"
fi

`


Geeklet files to download

Comments

User Avatar
Eryta 52 days ago
Advertising is your main tool to have the business ready to go. Actually, everybody is busy in their company marketing over the World Wide Web. Unfortunately, online company is scammed with scammers. On occasion the provider hires you freelance, or occasionally it is a site designer which orders the copy google At an identical time, if you decide on the most suitable company having excellent reviews and reputation, you will enjoy well composed works.

http://google.com/
User Avatar
Eryta 52 days ago
Half a century ago, the pretty, decorated shrugs were plainly meant to lend a bit of cozy warmth to chilly shoulders, but sweaters now prove to be a sign of elegance - Riccardo Tsici, you did good. Seventy years ago, wh
User Avatar
Triloka 52 days ago
Wow! Thank you for interesting and very useful information. I was searching for such code, but couldn't find it for a long time. I need it for my university lesson. i even wanted to purchase a paper about this theme, but when I saw [Coolessay.net rating ](https://topwritingreviews.com/services/coolessay) I decided to postpone this buy. And then I've found your post! You literally saved me! Thank you so much!

Log in to comment or register here.